aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-10-27 13:23:25 -0400
committerChristoffer Dall <cdall@cs.columbia.edu>2013-03-06 18:48:44 -0500
commit9c7a6432fb081563f084b25bbd2774b1547c4fad (patch)
treea5aa3aa416b762feae8ea424f1ba374d30268592
parente7858c58d52237a4519e2fdb1ce8f2d9805ce0ce (diff)
ARM: KVM: use kvm_kernel_vfp_t as an abstract type for VFP containers
In order to keep the VFP allocation code common, use an abstract type for the VFP containers. Maps onto struct vfp_hard_struct on ARM. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--arch/arm/include/asm/kvm_host.h6
-rw-r--r--arch/arm/kvm/arm.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index f00a557c107a..0c4e643d939e 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -87,6 +87,8 @@ struct kvm_vcpu_fault_info {
87 u32 hyp_pc; /* PC when exception was taken from Hyp mode */ 87 u32 hyp_pc; /* PC when exception was taken from Hyp mode */
88}; 88};
89 89
90typedef struct vfp_hard_struct kvm_kernel_vfp_t;
91
90struct kvm_vcpu_arch { 92struct kvm_vcpu_arch {
91 struct kvm_regs regs; 93 struct kvm_regs regs;
92 94
@@ -103,8 +105,8 @@ struct kvm_vcpu_arch {
103 struct kvm_vcpu_fault_info fault; 105 struct kvm_vcpu_fault_info fault;
104 106
105 /* Floating point registers (VFP and Advanced SIMD/NEON) */ 107 /* Floating point registers (VFP and Advanced SIMD/NEON) */
106 struct vfp_hard_struct vfp_guest; 108 kvm_kernel_vfp_t vfp_guest;
107 struct vfp_hard_struct *vfp_host; 109 kvm_kernel_vfp_t *vfp_host;
108 110
109 /* VGIC state */ 111 /* VGIC state */
110 struct vgic_cpu vgic_cpu; 112 struct vgic_cpu vgic_cpu;
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 3c7c50a6a286..f0530499dec6 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -49,7 +49,7 @@ __asm__(".arch_extension virt");
49#endif 49#endif
50 50
51static DEFINE_PER_CPU(unsigned long, kvm_arm_hyp_stack_page); 51static DEFINE_PER_CPU(unsigned long, kvm_arm_hyp_stack_page);
52static struct vfp_hard_struct __percpu *kvm_host_vfp_state; 52static kvm_kernel_vfp_t __percpu *kvm_host_vfp_state;
53static unsigned long hyp_default_vectors; 53static unsigned long hyp_default_vectors;
54 54
55/* Per-CPU variable containing the currently running vcpu. */ 55/* Per-CPU variable containing the currently running vcpu. */
@@ -908,7 +908,7 @@ static int init_hyp_mode(void)
908 /* 908 /*
909 * Map the host VFP structures 909 * Map the host VFP structures
910 */ 910 */
911 kvm_host_vfp_state = alloc_percpu(struct vfp_hard_struct); 911 kvm_host_vfp_state = alloc_percpu(kvm_kernel_vfp_t);
912 if (!kvm_host_vfp_state) { 912 if (!kvm_host_vfp_state) {
913 err = -ENOMEM; 913 err = -ENOMEM;
914 kvm_err("Cannot allocate host VFP state\n"); 914 kvm_err("Cannot allocate host VFP state\n");
@@ -916,7 +916,7 @@ static int init_hyp_mode(void)
916 } 916 }
917 917
918 for_each_possible_cpu(cpu) { 918 for_each_possible_cpu(cpu) {
919 struct vfp_hard_struct *vfp; 919 kvm_kernel_vfp_t *vfp;
920 920
921 vfp = per_cpu_ptr(kvm_host_vfp_state, cpu); 921 vfp = per_cpu_ptr(kvm_host_vfp_state, cpu);
922 err = create_hyp_mappings(vfp, vfp + 1); 922 err = create_hyp_mappings(vfp, vfp + 1);