aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-01-07 20:58:01 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:47 -0500
commit8e5b26b55a8b6aee2c789b1d20ec715f9e4bea5c (patch)
tree4e2d003852ce327a47153b6c100239c6d8e1418f /arch/powerpc/kvm/book3s.c
parent0d178975d0a5afe5e0fd3211bd1397905b225be5 (diff)
KVM: PPC: Use accessor functions for GPR access
All code in PPC KVM currently accesses gprs in the vcpu struct directly. While there's nothing wrong with that wrt the current way gprs are stored and loaded, it doesn't suffice for the PACA acceleration that will follow in this patchset. So let's just create little wrapper inline functions that we call whenever a GPR needs to be read from or written to. The compiled code shouldn't really change at all for now. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r--arch/powerpc/kvm/book3s.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index fd2a4d531582..574b24fb6e0e 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -658,7 +658,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
658 } 658 }
659 case BOOK3S_INTERRUPT_SYSCALL: 659 case BOOK3S_INTERRUPT_SYSCALL:
660#ifdef EXIT_DEBUG 660#ifdef EXIT_DEBUG
661 printk(KERN_INFO "Syscall Nr %d\n", (int)vcpu->arch.gpr[0]); 661 printk(KERN_INFO "Syscall Nr %d\n", (int)kvmppc_get_gpr(vcpu, 0));
662#endif 662#endif
663 vcpu->stat.syscall_exits++; 663 vcpu->stat.syscall_exits++;
664 kvmppc_book3s_queue_irqprio(vcpu, exit_nr); 664 kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
@@ -734,7 +734,7 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
734 regs->sprg7 = vcpu->arch.sprg6; 734 regs->sprg7 = vcpu->arch.sprg6;
735 735
736 for (i = 0; i < ARRAY_SIZE(regs->gpr); i++) 736 for (i = 0; i < ARRAY_SIZE(regs->gpr); i++)
737 regs->gpr[i] = vcpu->arch.gpr[i]; 737 regs->gpr[i] = kvmppc_get_gpr(vcpu, i);
738 738
739 return 0; 739 return 0;
740} 740}
@@ -759,8 +759,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
759 vcpu->arch.sprg6 = regs->sprg5; 759 vcpu->arch.sprg6 = regs->sprg5;
760 vcpu->arch.sprg7 = regs->sprg6; 760 vcpu->arch.sprg7 = regs->sprg6;
761 761
762 for (i = 0; i < ARRAY_SIZE(vcpu->arch.gpr); i++) 762 for (i = 0; i < ARRAY_SIZE(regs->gpr); i++)
763 vcpu->arch.gpr[i] = regs->gpr[i]; 763 kvmppc_set_gpr(vcpu, i, regs->gpr[i]);
764 764
765 return 0; 765 return 0;
766} 766}