aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic-v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/arm/vgic-v2.c')
-rw-r--r--virt/kvm/arm/vgic-v2.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c
index 416baedfc89f..2935405ad22f 100644
--- a/virt/kvm/arm/vgic-v2.c
+++ b/virt/kvm/arm/vgic-v2.c
@@ -71,35 +71,17 @@ static void vgic_v2_sync_lr_elrsr(struct kvm_vcpu *vcpu, int lr,
71 struct vgic_lr lr_desc) 71 struct vgic_lr lr_desc)
72{ 72{
73 if (!(lr_desc.state & LR_STATE_MASK)) 73 if (!(lr_desc.state & LR_STATE_MASK))
74 __set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr); 74 vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr |= (1ULL << lr);
75} 75}
76 76
77static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu) 77static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu)
78{ 78{
79 u64 val; 79 return vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr;
80
81#if BITS_PER_LONG == 64
82 val = vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr[1];
83 val <<= 32;
84 val |= vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr[0];
85#else
86 val = *(u64 *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr;
87#endif
88 return val;
89} 80}
90 81
91static u64 vgic_v2_get_eisr(const struct kvm_vcpu *vcpu) 82static u64 vgic_v2_get_eisr(const struct kvm_vcpu *vcpu)
92{ 83{
93 u64 val; 84 return vcpu->arch.vgic_cpu.vgic_v2.vgic_eisr;
94
95#if BITS_PER_LONG == 64
96 val = vcpu->arch.vgic_cpu.vgic_v2.vgic_eisr[1];
97 val <<= 32;
98 val |= vcpu->arch.vgic_cpu.vgic_v2.vgic_eisr[0];
99#else
100 val = *(u64 *)vcpu->arch.vgic_cpu.vgic_v2.vgic_eisr;
101#endif
102 return val;
103} 85}
104 86
105static u32 vgic_v2_get_interrupt_status(const struct kvm_vcpu *vcpu) 87static u32 vgic_v2_get_interrupt_status(const struct kvm_vcpu *vcpu)