diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2016-09-12 10:49:24 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2016-09-22 07:22:21 -0400 |
commit | acda5430bee4621f218391d0bcfbe4412adb3554 (patch) | |
tree | d279ce897d2666ca9481963dca9fc9aede6e85dd /arch/arm/include/asm | |
parent | a078bedf17c2e43819fea54bdfd5793845142e3a (diff) |
ARM: KVM: Support vgic-v3
This patch allows to build and use vgic-v3 in 32-bit mode.
Unfortunately, it can not be split in several steps without extra
stubs to keep patches independent and bisectable. For instance,
virt/kvm/arm/vgic/vgic-v3.c uses function from vgic-v3-sr.c, handling
access to GICv3 cpu interface from the guest requires vgic_v3.vgic_sre
to be already defined.
It is how support has been done:
* handle SGI requests from the guest
* report configured SRE on access to GICv3 cpu interface from the guest
* required vgic-v3 macros are provided via uapi.h
* static keys are used to select GIC backend
* to make vgic-v3 build KVM_ARM_VGIC_V3 guard is removed along with
the static inlines
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/kvm_asm.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/kvm_host.h | 5 | ||||
-rw-r--r-- | arch/arm/include/asm/kvm_hyp.h | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 05e47faf96a1..d7ea6bcb29bf 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h | |||
@@ -72,6 +72,9 @@ extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); | |||
72 | extern void __init_stage2_translation(void); | 72 | extern void __init_stage2_translation(void); |
73 | 73 | ||
74 | extern void __kvm_hyp_reset(unsigned long); | 74 | extern void __kvm_hyp_reset(unsigned long); |
75 | |||
76 | extern u64 __vgic_v3_get_ich_vtr_el2(void); | ||
77 | extern void __vgic_v3_init_lrs(void); | ||
75 | #endif | 78 | #endif |
76 | 79 | ||
77 | #endif /* __ARM_KVM_ASM_H__ */ | 80 | #endif /* __ARM_KVM_ASM_H__ */ |
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index de338d93d11b..c2c40a7ee738 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h | |||
@@ -39,7 +39,12 @@ | |||
39 | 39 | ||
40 | #include <kvm/arm_vgic.h> | 40 | #include <kvm/arm_vgic.h> |
41 | 41 | ||
42 | |||
43 | #ifdef CONFIG_ARM_GIC_V3 | ||
44 | #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS | ||
45 | #else | ||
42 | #define KVM_MAX_VCPUS VGIC_V2_MAX_CPUS | 46 | #define KVM_MAX_VCPUS VGIC_V2_MAX_CPUS |
47 | #endif | ||
43 | 48 | ||
44 | #define KVM_REQ_VCPU_EXIT 8 | 49 | #define KVM_REQ_VCPU_EXIT 8 |
45 | 50 | ||
diff --git a/arch/arm/include/asm/kvm_hyp.h b/arch/arm/include/asm/kvm_hyp.h index e604ad68a06b..343135ede5fa 100644 --- a/arch/arm/include/asm/kvm_hyp.h +++ b/arch/arm/include/asm/kvm_hyp.h | |||
@@ -106,6 +106,9 @@ void __vgic_v2_restore_state(struct kvm_vcpu *vcpu); | |||
106 | void __sysreg_save_state(struct kvm_cpu_context *ctxt); | 106 | void __sysreg_save_state(struct kvm_cpu_context *ctxt); |
107 | void __sysreg_restore_state(struct kvm_cpu_context *ctxt); | 107 | void __sysreg_restore_state(struct kvm_cpu_context *ctxt); |
108 | 108 | ||
109 | void __vgic_v3_save_state(struct kvm_vcpu *vcpu); | ||
110 | void __vgic_v3_restore_state(struct kvm_vcpu *vcpu); | ||
111 | |||
109 | void asmlinkage __vfp_save_state(struct vfp_hard_struct *vfp); | 112 | void asmlinkage __vfp_save_state(struct vfp_hard_struct *vfp); |
110 | void asmlinkage __vfp_restore_state(struct vfp_hard_struct *vfp); | 113 | void asmlinkage __vfp_restore_state(struct vfp_hard_struct *vfp); |
111 | static inline bool __vfp_enabled(void) | 114 | static inline bool __vfp_enabled(void) |