From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Alexander Graf <agraf@suse.de>,
"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 13/38] KVM: PPC: booke: category E.HV (GS-mode) support
Date: Mon, 5 Mar 2012 17:57:45 +0800 [thread overview]
Message-ID: <4F548E19.6050507@windriver.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D154397@039-SN2MPN1-023.039d.mgd.msft.net>
>> + /*
>> + * Host interrupt handlers may have clobbered these guest-readable
>> + * SPRGs, so we need to reload them here with the guest's values.
>> + */
>> + lwz r3, VCPU_VRSAVE(r4)
>> + lwz r5, VCPU_SHARED_SPRG4(r11)
>> + mtspr SPRN_VRSAVE, r3
>> + lwz r6, VCPU_SHARED_SPRG5(r11)
>> + mtspr SPRN_SPRG4W, r5
>> + lwz r7, VCPU_SHARED_SPRG6(r11)
>> + mtspr SPRN_SPRG5W, r6
>> + lwz r8, VCPU_SHARED_SPRG7(r11)
>> + mtspr SPRN_SPRG6W, r7
>> + mtspr SPRN_SPRG7W, r8
>> +
That should be here.
>> + /* Load some guest volatiles. */
>> + PPC_LL r3, VCPU_LR(r4)
>> + PPC_LL r5, VCPU_XER(r4)
>> + PPC_LL r6, VCPU_CTR(r4)
>> + PPC_LL r7, VCPU_CR(r4)
>> + PPC_LL r8, VCPU_PC(r4)
>> +#ifndef CONFIG_64BIT
>> + lwz r9, (VCPU_SHARED_MSR + 4)(r11)
>> +#else
>> + ld r9, (VCPU_SHARED_MSR)(r11)
>> +#endif
>> + PPC_LL r0, VCPU_GPR(r0)(r4)
>> + PPC_LL r1, VCPU_GPR(r1)(r4)
>> + PPC_LL r2, VCPU_GPR(r2)(r4)
>> + PPC_LL r10, VCPU_GPR(r10)(r4)
>> + PPC_LL r11, VCPU_GPR(r11)(r4)
>> + PPC_LL r12, VCPU_GPR(r12)(r4)
>> + PPC_LL r13, VCPU_GPR(r13)(r4)
>> + mtlr r3
>> + mtxer r5
>> + mtctr r6
>> + mtcr r7
>> + mtsrr0 r8
>> + mtsrr1 r9
>> +
>> +#ifdef CONFIG_KVM_EXIT_TIMING
>> + /* save enter time */
>> +1:
>> + mfspr r6, SPRN_TBRU
>> + mfspr r7, SPRN_TBRL
>> + mfspr r8, SPRN_TBRU
>> + cmpw r8, r6
>
> Is not we should save guest CR after this otherwise this can corrupt it?
I think this should be a typo since in our previous kvm implementation, we
always did collect kvm exit timing at the above location :)
Tiejun
>
> Thanks
> -Bharat
>
>> + PPC_STL r7, VCPU_TIMING_LAST_ENTER_TBL(r4)
>> + bne 1b
>> + PPC_STL r8, VCPU_TIMING_LAST_ENTER_TBU(r4)
>> +#endif
>> +
>> + /* Finish loading guest volatiles and jump to guest. */
>> + PPC_LL r5, VCPU_GPR(r5)(r4)
>> + PPC_LL r6, VCPU_GPR(r6)(r4)
>> + PPC_LL r7, VCPU_GPR(r7)(r4)
>> + PPC_LL r8, VCPU_GPR(r8)(r4)
>> + PPC_LL r9, VCPU_GPR(r9)(r4)
>> +
>> + PPC_LL r3, VCPU_GPR(r3)(r4)
>> + PPC_LL r4, VCPU_GPR(r4)(r4)
>> + rfi
next prev parent reply other threads:[~2012-03-05 12:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 0:09 [PATCH 00/38] KVM: PPC: e500mc support v3 Alexander Graf
2012-02-29 0:09 ` [PATCH 01/38] powerpc/booke: Set CPU_FTR_DEBUG_LVL_EXC on 32-bit Alexander Graf
2012-02-29 0:09 ` [PATCH 02/38] powerpc/e500: split CPU_FTRS_ALWAYS/CPU_FTRS_POSSIBLE Alexander Graf
2012-02-29 0:09 ` [PATCH 03/38] KVM: PPC: factor out lpid allocator from book3s_64_mmu_hv Alexander Graf
2012-02-29 0:09 ` [PATCH 04/38] KVM: PPC: booke: add booke-level vcpu load/put Alexander Graf
2012-02-29 0:09 ` [PATCH 05/38] KVM: PPC: booke: Move vm core init/destroy out of booke.c Alexander Graf
2012-02-29 0:09 ` [PATCH 06/38] KVM: PPC: e500: rename e500_tlb.h to e500.h Alexander Graf
2012-02-29 0:09 ` [PATCH 07/38] KVM: PPC: e500: merge <asm/kvm_e500.h> into arch/powerpc/kvm/e500.h Alexander Graf
2012-02-29 0:09 ` [PATCH 08/38] KVM: PPC: e500: clean up arch/powerpc/kvm/e500.h Alexander Graf
2012-02-29 0:09 ` [PATCH 09/38] KVM: PPC: e500: refactor core-specific TLB code Alexander Graf
2012-02-29 0:09 ` [PATCH 10/38] KVM: PPC: e500: Track TLB1 entries with a bitmap Alexander Graf
2012-02-29 0:09 ` [PATCH 11/38] KVM: PPC: e500: emulate tlbilx Alexander Graf
2012-02-29 0:09 ` [PATCH 12/38] powerpc/booke: Provide exception macros with interrupt name Alexander Graf
2012-03-21 18:04 ` Kumar Gala
2012-03-21 18:19 ` Scott Wood
2012-03-21 20:20 ` Kumar Gala
2012-02-29 0:09 ` [PATCH 13/38] KVM: PPC: booke: category E.HV (GS-mode) support Alexander Graf
2012-03-05 9:04 ` Bhushan Bharat-R65777
2012-03-05 9:57 ` tiejun.chen [this message]
2012-02-29 0:09 ` [PATCH 14/38] KVM: PPC: booke: standard PPC floating point support Alexander Graf
2012-02-29 0:09 ` [PATCH 15/38] KVM: PPC: e500mc support Alexander Graf
2012-02-29 0:09 ` [PATCH 16/38] KVM: PPC: e500mc: Add doorbell emulation support Alexander Graf
2012-02-29 0:09 ` [PATCH 17/38] KVM: PPC: e500mc: implicitly set MSR_GS Alexander Graf
2012-02-29 0:09 ` [PATCH 18/38] KVM: PPC: e500mc: Move r1/r2 restoration very early Alexander Graf
2012-02-29 0:09 ` [PATCH 19/38] KVM: PPC: e500mc: add load inst fixup Alexander Graf
2012-03-08 22:36 ` Marcelo Tosatti
2012-03-12 19:39 ` Alexander Graf
2012-02-29 0:09 ` [PATCH 20/38] KVM: PPC: rename CONFIG_KVM_E500 -> CONFIG_KVM_E500V2 Alexander Graf
2012-02-29 0:09 ` [PATCH 21/38] KVM: PPC: make e500v2 kvm and e500mc cpu mutually exclusive Alexander Graf
2012-02-29 0:09 ` [PATCH 22/38] KVM: PPC: booke: remove leftover debugging Alexander Graf
2012-02-29 0:09 ` [PATCH 23/38] KVM: PPC: booke: deliver program int on emulation failure Alexander Graf
2012-02-29 0:09 ` [PATCH 24/38] KVM: PPC: booke: rework rescheduling checks Alexander Graf
2012-02-29 0:09 ` [PATCH 25/38] KVM: PPC: booke: BOOKE_IRQPRIO_MAX is n+1 Alexander Graf
2012-02-29 0:09 ` [PATCH 26/38] KVM: PPC: bookehv: fix exit timing Alexander Graf
2012-02-29 0:09 ` [PATCH 27/38] KVM: PPC: bookehv: remove negation for CONFIG_64BIT Alexander Graf
2012-02-29 0:09 ` [PATCH 28/38] KVM: PPC: bookehv: remove SET_VCPU Alexander Graf
2012-02-29 0:09 ` [PATCH 29/38] KVM: PPC: bookehv: disable MAS register updates early Alexander Graf
2012-02-29 0:09 ` [PATCH 30/38] KVM: PPC: bookehv: add comment about shadow_msr Alexander Graf
2012-02-29 0:09 ` [PATCH 31/38] KVM: PPC: booke: Readd debug abort code for machine check Alexander Graf
2012-02-29 0:10 ` [PATCH 32/38] KVM: PPC: booke: add GS documentation for program interrupt Alexander Graf
2012-02-29 0:10 ` [PATCH 33/38] KVM: PPC: bookehv: remove unused code Alexander Graf
2012-02-29 0:10 ` [PATCH 34/38] KVM: PPC: e500: fix typo in tlb code Alexander Graf
2012-02-29 0:10 ` [PATCH 35/38] KVM: PPC: booke: Support perfmon interrupts Alexander Graf
2012-02-29 0:10 ` [PATCH 36/38] KVM: PPC: booke: expose good state on irq reinject Alexander Graf
2012-02-29 0:10 ` [PATCH 37/38] KVM: PPC: booke: Reinject performance monitor interrupts Alexander Graf
2012-02-29 0:10 ` [PATCH 38/38] KVM: PPC: Booke: only prepare to enter when we enter Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F548E19.6050507@windriver.com \
--to=tiejun.chen@windriver.com \
--cc=B07421@freescale.com \
--cc=R65777@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).