Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: booke: use vcpu reference from thread_struct

Like other places, use thread_struct to get vcpu reference.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

authored by

Bharat Bhushan and committed by
Alexander Graf
ffe129ec dd92d6f2

+3 -7
-2
arch/powerpc/include/asm/reg.h
··· 919 919 #define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG9 920 920 #define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG9 921 921 #endif 922 - #define SPRN_SPRG_RVCPU SPRN_SPRG1 923 - #define SPRN_SPRG_WVCPU SPRN_SPRG1 924 922 #endif 925 923 926 924 #ifdef CONFIG_8xx
+1 -1
arch/powerpc/kernel/asm-offsets.c
··· 117 117 #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 118 118 DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu)); 119 119 #endif 120 - #ifdef CONFIG_KVM_BOOKE_HV 120 + #if defined(CONFIG_KVM) && defined(CONFIG_BOOKE) 121 121 DEFINE(THREAD_KVM_VCPU, offsetof(struct thread_struct, kvm_vcpu)); 122 122 #endif 123 123
+2 -4
arch/powerpc/kvm/booke_interrupts.S
··· 56 56 _GLOBAL(kvmppc_handler_\ivor_nr) 57 57 /* Get pointer to vcpu and record exit number. */ 58 58 mtspr \scratch , r4 59 - mfspr r4, SPRN_SPRG_RVCPU 59 + mfspr r4, SPRN_SPRG_THREAD 60 + lwz r4, THREAD_KVM_VCPU(r4) 60 61 stw r3, VCPU_GPR(R3)(r4) 61 62 stw r5, VCPU_GPR(R5)(r4) 62 63 stw r6, VCPU_GPR(R6)(r4) ··· 402 401 lis r8, kvmppc_booke_handlers@ha 403 402 lwz r8, kvmppc_booke_handlers@l(r8) 404 403 mtspr SPRN_IVPR, r8 405 - 406 - /* Save vcpu pointer for the exception handlers. */ 407 - mtspr SPRN_SPRG_WVCPU, r4 408 404 409 405 lwz r5, VCPU_SHARED(r4) 410 406