Commit 740a179b authored by Aleksei Vetrov's avatar Aleksei Vetrov
Browse files

ANDROID: KVM: arm64: deduplicate kvm_hyp_iommu



Conditional definition of lock inside kvm_hyp_iommu results in duplicate
BTF types for all structures that directly or indirectly mention
kvm_hyp_iommu. However opaque type is needed to hide hypervisor only
spinlock from the kernel.

Remove "ifdef __KVM_NVHE_HYPERVISOR__" and leave only opaque u32 type.
Use __GENKSYMS__ hack to hide this change from CRC generation, since the
change is ABI compatible.

Add accessors to the lock to use instead of funcions from
"nvhe/spinlock.h". Move build time size check there, right where opaque
type is casted to a concrete type.

When adding accessors we found that no code uses hyp_spin_lock_init on
iommu->lock, so it also adds initializer to kvm_iommu_init_device.

Bug: 350677978
Change-Id: I59a34f9613732d3382fa57d9e9088d2c84d0b732
Signed-off-by: default avatarAleksei Vetrov <vvvvvv@google.com>
parent 691810c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment