arm: kvm: move kvm_vgic_global_state out of .text section
authorArd Biesheuvel <[email protected]>
Thu, 9 Mar 2017 20:51:59 +0000 (21:51 +0100)
committerCatalin Marinas <[email protected]>
Thu, 23 Mar 2017 13:53:46 +0000 (13:53 +0000)
The kvm_vgic_global_state struct contains a static key which is
written to by jump_label_init() at boot time. So in preparation of
making .text regions truly (well, almost truly) read-only, mark
kvm_vgic_global_state __ro_after_init so it moves to the .rodata
section instead.

Acked-by: Marc Zyngier <[email protected]>
Reviewed-by: Laura Abbott <[email protected]>
Reviewed-by: Mark Rutland <[email protected]>
Tested-by: Mark Rutland <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
virt/kvm/arm/vgic/vgic.c

index 654dfd40e449cb54afccdc19792b80a7cf59664a..7713d96e85b7412ec40dd6691a89f494d3c03c02 100644 (file)
@@ -29,7 +29,9 @@
 #define DEBUG_SPINLOCK_BUG_ON(p)
 #endif
 
-struct vgic_global __section(.hyp.text) kvm_vgic_global_state = {.gicv3_cpuif = STATIC_KEY_FALSE_INIT,};
+struct vgic_global kvm_vgic_global_state __ro_after_init = {
+       .gicv3_cpuif = STATIC_KEY_FALSE_INIT,
+};
 
 /*
  * Locking order is always: