]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kvm: ppc: bookehv: Save restore SPRN_SPRG9 on guest entry exit
authorBharat Bhushan <Bharat.Bhushan@freescale.com>
Mon, 21 Jul 2014 05:53:26 +0000 (11:23 +0530)
committerAlexander Graf <agraf@suse.de>
Mon, 28 Jul 2014 13:23:14 +0000 (15:23 +0200)
SPRN_SPRG is used by debug interrupt handler, so this is required for
debug support.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/bookehv_interrupts.S

index 855ba4d9539d54277ecca43aea86add6f9dd681f..562f685d1678dc400fec10a355c1e46f215a328d 100644 (file)
@@ -587,6 +587,7 @@ struct kvm_vcpu_arch {
        u32 mmucfg;
        u32 eptcfg;
        u32 epr;
+       u64 sprg9;
        u32 pwrmgtcr0;
        u32 crit_save;
        /* guest debug registers*/
index 17ffcb4f27f9fd49a45cdaa492ae5ecf19a5f657..ab9ae0411e8f927887a05379ca9acc681a09bc17 100644 (file)
@@ -668,6 +668,7 @@ int main(void)
        DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr));
        DEFINE(VCPU_CTR, offsetof(struct kvm_vcpu, arch.ctr));
        DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.pc));
+       DEFINE(VCPU_SPRG9, offsetof(struct kvm_vcpu, arch.sprg9));
        DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, arch.last_inst));
        DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear));
        DEFINE(VCPU_FAULT_ESR, offsetof(struct kvm_vcpu, arch.fault_esr));
index e000b397ece3f9bd5d57fda5cac62298ec878de7..b4f8fbafee7a3fa185d5cfdae6862678d90de706 100644 (file)
@@ -398,6 +398,7 @@ _GLOBAL(kvmppc_resume_host)
 #ifdef CONFIG_64BIT
        PPC_LL  r3, PACA_SPRG_VDSO(r13)
 #endif
+       mfspr   r5, SPRN_SPRG9
        PPC_STD(r6, VCPU_SHARED_SPRG4, r11)
        mfspr   r8, SPRN_SPRG6
        PPC_STD(r7, VCPU_SHARED_SPRG5, r11)
@@ -405,6 +406,7 @@ _GLOBAL(kvmppc_resume_host)
 #ifdef CONFIG_64BIT
        mtspr   SPRN_SPRG_VDSO_WRITE, r3
 #endif
+       PPC_STD(r5, VCPU_SPRG9, r4)
        PPC_STD(r8, VCPU_SHARED_SPRG6, r11)
        mfxer   r3
        PPC_STD(r9, VCPU_SHARED_SPRG7, r11)
@@ -639,7 +641,9 @@ lightweight_exit:
        mtspr   SPRN_SPRG5W, r6
        PPC_LD(r8, VCPU_SHARED_SPRG7, r11)
        mtspr   SPRN_SPRG6W, r7
+       PPC_LD(r5, VCPU_SPRG9, r4)
        mtspr   SPRN_SPRG7W, r8
+       mtspr   SPRN_SPRG9, r5
 
        /* Load some guest volatiles. */
        PPC_LL  r3, VCPU_LR(r4)