Revert "ANDROID: KVM: arm64: Create empty S2MPU driver"

This reverts commit d907ef4ba5.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ia5ff3af0762f01243ab6b39317d993c24933d6b8
This commit is contained in:
Will Deacon
2022-07-07 15:51:49 +01:00
parent 5f11cfb675
commit 7101fee045
10 changed files with 2 additions and 63 deletions

View File

@@ -273,15 +273,8 @@ extern u64 kvm_nvhe_sym(hyp_cpu_logical_map)[NR_CPUS];
enum kvm_iommu_driver {
KVM_IOMMU_DRIVER_NONE,
KVM_IOMMU_DRIVER_S2MPU,
};
#ifdef CONFIG_KVM_S2MPU
int kvm_s2mpu_init(void);
#else
static inline int kvm_s2mpu_init(void) { return -ENODEV; }
#endif
struct vcpu_reset_state {
unsigned long pc;
unsigned long r0;

View File

@@ -135,6 +135,5 @@ struct kvm_iommu_ops {
};
extern struct kvm_iommu_ops kvm_iommu_ops;
extern const struct kvm_iommu_ops kvm_s2mpu_ops;
#endif /* __ARM64_KVM_HYP_H__ */

View File

@@ -54,13 +54,4 @@ config NVHE_EL2_DEBUG
If unsure, say N.
config KVM_S2MPU
bool "Stage-2 Memory Protection Unit support"
depends on KVM
help
Support for the Stage-2 Memory Protection Unit (S2MPU) and Stream
Security Mapping Table (SSMT) devices in KVM. This allows the
hypervisor to restrict DMA access to its memory and the memory of
protected guests.
endif # VIRTUALIZATION

View File

@@ -8,7 +8,7 @@ ccflags-y += -I $(srctree)/$(src)
KVM=../../../virt/kvm
obj-$(CONFIG_KVM) += kvm.o
obj-$(CONFIG_KVM) += hyp/ iommu/
obj-$(CONFIG_KVM) += hyp/
kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \
$(KVM)/vfio.o $(KVM)/irqchip.o $(KVM)/binary_stats.o \

View File

@@ -1770,13 +1770,7 @@ static bool init_psci_relay(void)
static int init_stage2_iommu(void)
{
int ret;
ret = kvm_s2mpu_init();
if (!ret)
return KVM_IOMMU_DRIVER_S2MPU;
return (ret == -ENODEV) ? KVM_IOMMU_DRIVER_NONE : ret;
return KVM_IOMMU_DRIVER_NONE;
}
static int init_subsystems(void)

View File

@@ -24,8 +24,6 @@ obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \
../fpsimd.o ../hyp-entry.o ../exception.o ../pgtable.o
obj-y += $(lib-objs)
obj-$(CONFIG_KVM_S2MPU) += iommu/s2mpu.o
##
## Build rules for compiling nVHE hyp code
## Output of this folder is `kvm_nvhe.o`, a partially linked object

View File

@@ -1,11 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2021 - Google LLC
* Author: David Brazdil <dbrazdil@google.com>
*/
#include <linux/kvm_host.h>
#include <asm/kvm_hyp.h>
const struct kvm_iommu_ops kvm_s2mpu_ops = (struct kvm_iommu_ops){};

View File

@@ -238,12 +238,6 @@ int select_iommu_ops(enum kvm_iommu_driver driver)
switch (driver) {
case KVM_IOMMU_DRIVER_NONE:
return 0;
case KVM_IOMMU_DRIVER_S2MPU:
if (IS_ENABLED(CONFIG_KVM_S2MPU)) {
kvm_iommu_ops = kvm_s2mpu_ops;
return 0;
}
break;
}
return -EINVAL;

View File

@@ -1,6 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for Kernel-based Virtual Machine module
#
obj-$(CONFIG_KVM_S2MPU) += s2mpu.o

View File

@@ -1,13 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2021 - Google LLC
* Author: David Brazdil <dbrazdil@google.com>
*/
#include <linux/kvm_host.h>
int kvm_s2mpu_init(void)
{
kvm_info("S2MPU driver initialized\n");
return 0;
}