From 2e19490f3f3f8dc6ed8de8a5b7463ef99f8db38b Mon Sep 17 00:00:00 2001 From: Mostafa Saleh Date: Mon, 10 Feb 2025 13:46:52 +0000 Subject: [PATCH] ANDROID: KVM: arm64: iommu: Use same type for kernel/hyp Although hyp_spinlock_t and u32 have the same size, that makes the build system duplicate the type for EL1/EL2 builds impacting KMI. Use a single type for lock, and cast it when used at EL2. Bug: 350677978 Bug: 357781595 Bug: 384432312 Change-Id: I13b7330dcf5c5340e3bad35eab9808388e9a84a3 Signed-off-by: Mostafa Saleh --- include/kvm/iommu.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/kvm/iommu.h b/include/kvm/iommu.h index 041182c60956..734dca08ad5f 100644 --- a/include/kvm/iommu.h +++ b/include/kvm/iommu.h @@ -5,9 +5,6 @@ #include #include #include -#ifdef __KVM_NVHE_HYPERVISOR__ -#include -#endif /* * Domain ID for identity mapped domain that the host can attach @@ -58,11 +55,7 @@ extern void **kvm_nvhe_sym(kvm_hyp_iommu_domains); (1 << get_order(KVM_IOMMU_DOMAINS_ROOT_SIZE)) struct kvm_hyp_iommu { -#ifdef __KVM_NVHE_HYPERVISOR__ - hyp_spinlock_t lock; -#else - u32 unused; -#endif + u32 lock; /* lock size verified in kvm_iommu_get_lock. */ struct kvm_power_domain power_domain; bool power_is_off; ANDROID_KABI_RESERVE(1);