KVM: PPC: booke: use vcpu reference from thread_struct
authorBharat Bhushan <Bharat.Bhushan@freescale.com>
Tue, 15 Jan 2013 22:20:42 +0000 (22:20 +0000)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2013 11:56:39 +0000 (12:56 +0100)
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>
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/booke_interrupts.S

index 97d37278ea2da4f978bbf5b5967b5ed22912ee7d..11ae3d8ba3a2a95fb4672a6e5a18b04b145d4539 100644 (file)
 #define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG9
 #define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG9
 #endif
-#define SPRN_SPRG_RVCPU                SPRN_SPRG1
-#define SPRN_SPRG_WVCPU                SPRN_SPRG1
 #endif
 
 #ifdef CONFIG_8xx
index 4e23ba2f3ca7622d7f2fe66f6d0925bae26f0cf1..46f6afd2172aac2b006c21b9c9a870a624bad24b 100644 (file)
@@ -117,7 +117,7 @@ int main(void)
 #ifdef CONFIG_KVM_BOOK3S_32_HANDLER
        DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu));
 #endif
-#ifdef CONFIG_KVM_BOOKE_HV
+#if defined(CONFIG_KVM) && defined(CONFIG_BOOKE)
        DEFINE(THREAD_KVM_VCPU, offsetof(struct thread_struct, kvm_vcpu));
 #endif
 
index bb46b32f9813966724b0d59e8ea0b84923c7eb2c..ca16d57f7686da06bd23971aaff8cf59e5293bc0 100644 (file)
@@ -56,7 +56,8 @@
 _GLOBAL(kvmppc_handler_\ivor_nr)
        /* Get pointer to vcpu and record exit number. */
        mtspr   \scratch , r4
-       mfspr   r4, SPRN_SPRG_RVCPU
+       mfspr   r4, SPRN_SPRG_THREAD
+       lwz     r4, THREAD_KVM_VCPU(r4)
        stw     r3, VCPU_GPR(R3)(r4)
        stw     r5, VCPU_GPR(R5)(r4)
        stw     r6, VCPU_GPR(R6)(r4)
@@ -402,9 +403,6 @@ lightweight_exit:
        lwz     r8, kvmppc_booke_handlers@l(r8)
        mtspr   SPRN_IVPR, r8
 
-       /* Save vcpu pointer for the exception handlers. */
-       mtspr   SPRN_SPRG_WVCPU, r4
-
        lwz     r5, VCPU_SHARED(r4)
 
        /* Can't switch the stack pointer until after IVPR is switched,