aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBharat Bhushan <Bharat.Bhushan@freescale.com>2014-07-17 07:31:37 -0400
committerAlexander Graf <agraf@suse.de>2014-07-28 09:23:12 -0400
commita5414d4b5ed8a2b10a1c8fe84f30ed4f19d0a35e (patch)
treeaad2a7b44725a769889bfbdc68c63237d1fbd2b2 /arch
parent31579eea69c8088685a4dc82784ca839cfd5ae73 (diff)
kvm: ppc: booke: Use the shared struct helpers of SPRN_DEAR
Uses kvmppc_set_dar() and kvmppc_get_dar() helper functions Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/booke.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 3b43adb9689f..8e8b14b283d4 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -292,24 +292,6 @@ static void set_guest_mcsrr(struct kvm_vcpu *vcpu, unsigned long srr0, u32 srr1)
292 vcpu->arch.mcsrr1 = srr1; 292 vcpu->arch.mcsrr1 = srr1;
293} 293}
294 294
295static unsigned long get_guest_dear(struct kvm_vcpu *vcpu)
296{
297#ifdef CONFIG_KVM_BOOKE_HV
298 return mfspr(SPRN_GDEAR);
299#else
300 return vcpu->arch.shared->dar;
301#endif
302}
303
304static void set_guest_dear(struct kvm_vcpu *vcpu, unsigned long dear)
305{
306#ifdef CONFIG_KVM_BOOKE_HV
307 mtspr(SPRN_GDEAR, dear);
308#else
309 vcpu->arch.shared->dar = dear;
310#endif
311}
312
313static unsigned long get_guest_esr(struct kvm_vcpu *vcpu) 295static unsigned long get_guest_esr(struct kvm_vcpu *vcpu)
314{ 296{
315#ifdef CONFIG_KVM_BOOKE_HV 297#ifdef CONFIG_KVM_BOOKE_HV
@@ -447,7 +429,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
447 if (update_esr == true) 429 if (update_esr == true)
448 set_guest_esr(vcpu, vcpu->arch.queued_esr); 430 set_guest_esr(vcpu, vcpu->arch.queued_esr);
449 if (update_dear == true) 431 if (update_dear == true)
450 set_guest_dear(vcpu, vcpu->arch.queued_dear); 432 kvmppc_set_dar(vcpu, vcpu->arch.queued_dear);
451 if (update_epr == true) { 433 if (update_epr == true) {
452 if (vcpu->arch.epr_flags & KVMPPC_EPR_USER) 434 if (vcpu->arch.epr_flags & KVMPPC_EPR_USER)
453 kvm_make_request(KVM_REQ_EPR_EXIT, vcpu); 435 kvm_make_request(KVM_REQ_EPR_EXIT, vcpu);
@@ -1317,7 +1299,7 @@ static void get_sregs_base(struct kvm_vcpu *vcpu,
1317 sregs->u.e.csrr1 = vcpu->arch.csrr1; 1299 sregs->u.e.csrr1 = vcpu->arch.csrr1;
1318 sregs->u.e.mcsr = vcpu->arch.mcsr; 1300 sregs->u.e.mcsr = vcpu->arch.mcsr;
1319 sregs->u.e.esr = get_guest_esr(vcpu); 1301 sregs->u.e.esr = get_guest_esr(vcpu);
1320 sregs->u.e.dear = get_guest_dear(vcpu); 1302 sregs->u.e.dear = kvmppc_get_dar(vcpu);
1321 sregs->u.e.tsr = vcpu->arch.tsr; 1303 sregs->u.e.tsr = vcpu->arch.tsr;
1322 sregs->u.e.tcr = vcpu->arch.tcr; 1304 sregs->u.e.tcr = vcpu->arch.tcr;
1323 sregs->u.e.dec = kvmppc_get_dec(vcpu, tb); 1305 sregs->u.e.dec = kvmppc_get_dec(vcpu, tb);
@@ -1335,7 +1317,7 @@ static int set_sregs_base(struct kvm_vcpu *vcpu,
1335 vcpu->arch.csrr1 = sregs->u.e.csrr1; 1317 vcpu->arch.csrr1 = sregs->u.e.csrr1;
1336 vcpu->arch.mcsr = sregs->u.e.mcsr; 1318 vcpu->arch.mcsr = sregs->u.e.mcsr;
1337 set_guest_esr(vcpu, sregs->u.e.esr); 1319 set_guest_esr(vcpu, sregs->u.e.esr);
1338 set_guest_dear(vcpu, sregs->u.e.dear); 1320 kvmppc_set_dar(vcpu, sregs->u.e.dear);
1339 vcpu->arch.vrsave = sregs->u.e.vrsave; 1321 vcpu->arch.vrsave = sregs->u.e.vrsave;
1340 kvmppc_set_tcr(vcpu, sregs->u.e.tcr); 1322 kvmppc_set_tcr(vcpu, sregs->u.e.tcr);
1341 1323