summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/kvm_mmu.h
diff options
context:
space:
mode:
authorMarc Zyngier2017-12-03 20:28:56 +0100
committerMarc Zyngier2018-03-19 14:03:33 +0100
commit44a497abd621a71c645f06d3d545ae2f46448830 (patch)
tree61394ccb03c9e929ca279ba40baf8871cddb118b /arch/arm/include/asm/kvm_mmu.h
parentarm64: cpufeatures: Drop the ARM64_HYP_OFFSET_LOW feature flag (diff)
downloadkernel-qcow2-linux-44a497abd621a71c645f06d3d545ae2f46448830.tar.gz
kernel-qcow2-linux-44a497abd621a71c645f06d3d545ae2f46448830.tar.xz
kernel-qcow2-linux-44a497abd621a71c645f06d3d545ae2f46448830.zip
KVM: arm/arm64: Do not use kern_hyp_va() with kvm_vgic_global_state
kvm_vgic_global_state is part of the read-only section, and is usually accessed using a PC-relative address generation (adrp + add). It is thus useless to use kern_hyp_va() on it, and actively problematic if kern_hyp_va() becomes non-idempotent. On the other hand, there is no way that the compiler is going to guarantee that such access is always PC relative. So let's bite the bullet and provide our own accessor. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: James Morse <james.morse@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include/asm/kvm_mmu.h')
-rw-r--r--arch/arm/include/asm/kvm_mmu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index de1b919404e4..93395b7c2322 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -28,6 +28,13 @@
*/
#define kern_hyp_va(kva) (kva)
+/* Contrary to arm64, there is no need to generate a PC-relative address */
+#define hyp_symbol_addr(s) \
+ ({ \
+ typeof(s) *addr = &(s); \
+ addr; \
+ })
+
/*
* KVM_MMU_CACHE_MIN_PAGES is the number of stage2 page table translation levels.
*/