Re: [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offset

2011-03-30 Thread Kumar Gala
On Mar 30, 2011, at 5:00 PM, Scott Wood wrote: > This allows reuse for saving/restoring KVM SPE state. Can you update commit comment to include a little about how we accomplish that. (something about the macro change is all I'm looking for) [otherwise ACK] > > Signed-off-by: Scott Wood > -

RE: [PATCH v5 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Liu Yu-B13201
> -Original Message- > From: kvm-ppc-ow...@vger.kernel.org > [mailto:kvm-ppc-ow...@vger.kernel.org] On Behalf Of Scott Wood > Sent: Thursday, March 31, 2011 7:35 AM > To: ag...@suse.de > Cc: kvm-ppc@vger.kernel.org > Subject: [PATCH v5 4/4] KVM: PPC: e500: Save/restore SPE state > > Th

Re: [PATCH v5 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Alexander Graf
On 31.03.2011, at 01:34, Scott Wood wrote: > This is done lazily. The SPE save will be done only if the guest has > used SPE since the last preemption or heavyweight exit. Restore will be > done only on demand, when enabling MSR_SPE in the shadow MSR, in response > to an SPE fault or mtmsr emul

[PATCH v5 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Scott Wood
This is done lazily. The SPE save will be done only if the guest has used SPE since the last preemption or heavyweight exit. Restore will be done only on demand, when enabling MSR_SPE in the shadow MSR, in response to an SPE fault or mtmsr emulation. For SPEFSCR, Linux already switches it on con

Re: [PATCH v4 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Alexander Graf
On 31.03.2011, at 00:56, Scott Wood wrote: > On Thu, 31 Mar 2011 00:43:27 +0200 > Alexander Graf wrote: > >>> @@ -78,6 +79,43 @@ void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu) >>> } >>> } >>> >>> +#ifdef CONFIG_SPE >>> +static void kvmppc_vcpu_enable_spe(struct kvm_vcpu *vcpu) >>> +{ >>> +

Re: [PATCH v4 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Scott Wood
On Thu, 31 Mar 2011 00:43:27 +0200 Alexander Graf wrote: > > @@ -78,6 +79,43 @@ void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu) > > } > > } > > > > +#ifdef CONFIG_SPE > > +static void kvmppc_vcpu_enable_spe(struct kvm_vcpu *vcpu) > > +{ > > + enable_kernel_spe(); > > + kvmppc_load_guest_spe

Re: [PATCH v4 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Alexander Graf
On 31.03.2011, at 00:00, Scott Wood wrote: > This is done lazily. The SPE save will be done only if the guest has > used SPE since the last preemption or heavyweight exit. Restore will be > done only on demand, when enabling MSR_SPE in the shadow MSR, in response > to an SPE fault or mtmsr emul

[PATCH v4 1/4] powerpc/e500: Save SPEFCSR in flush_spe_to_thread()

2011-03-30 Thread yu liu
giveup_spe() saves the SPE state which is protected by MSR[SPE]. However, modifying SPEFSCR does not trap when MSR[SPE]=0. And since SPEFSCR is already saved/restored in _switch(), not all the callers want to save SPEFSCR again. Thus, saving SPEFSCR should not belong to giveup_spe(). This patch mo

[PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offset

2011-03-30 Thread Scott Wood
This allows reuse for saving/restoring KVM SPE state. Signed-off-by: Scott Wood --- v4 of patchset, first version of this patch Kumar, please ack (or comment). arch/powerpc/include/asm/ppc_asm.h | 28 arch/powerpc/kernel/head_fsl_booke.S |6 +++--- 2 files

[PATCH v4 3/4] KVM: PPC: booke: use shadow_msr

2011-03-30 Thread Scott Wood
Keep the guest MSR and the guest-mode true MSR separate, rather than modifying the guest MSR on each guest entry to produce a true MSR. Any bits which should be modified based on guest MSR must be explicitly propagated from vcpu->arch.shared->msr to vcpu->arch.shadow_msr in kvmppc_set_msr(). Whil

[PATCH v4 4/4] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Scott Wood
This is done lazily. The SPE save will be done only if the guest has used SPE since the last preemption or heavyweight exit. Restore will be done only on demand, when enabling MSR_SPE in the shadow MSR, in response to an SPE fault or mtmsr emulation. For SPEFSCR, Linux already switches it on con

Re: [PATCH v3 2/2] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Scott Wood
On Wed, 30 Mar 2011 10:17:55 +0200 Alexander Graf wrote: > On 30.03.2011, at 01:43, Scott Wood wrote: > > > + case BOOKE_INTERRUPT_SPE_UNAVAIL: { > > + extern void kvmppc_vcpu_spe_load(struct kvm_vcpu *vcpu); > > + > > + /* reload the SPE env if guest first use SPE since la

Re: [PATCH v2] KVM: PPC: e500: emulate SVR

2011-03-30 Thread Alexander Graf
On 30.03.2011, at 09:56, Avi Kivity wrote: > On 03/30/2011 09:28 AM, Alexander Graf wrote: >> On 29.03.2011, at 23:49, Scott Wood wrote: >> >> > Return the actual host SVR for now, as we already do for PVR. Eventually >> > we may support Qemu overriding PVR/SVR if the situation is appropriate

Re: [PATCH v3 2/2] KVM: PPC: e500: Save/restore SPE state

2011-03-30 Thread Alexander Graf
On 30.03.2011, at 01:43, Scott Wood wrote: > This is done lazily; the SPE save will be done only if the guest has used > SPE since the last preemption or heavyweight exit, and restore will be > done only on demand. > > For SPEFSCR, Linux already switches it on context switch (non-lazily), so > t

Re: [PATCH v2] KVM: PPC: e500: emulate SVR

2011-03-30 Thread Avi Kivity
On 03/30/2011 09:28 AM, Alexander Graf wrote: On 29.03.2011, at 23:49, Scott Wood wrote: > Return the actual host SVR for now, as we already do for PVR. Eventually > we may support Qemu overriding PVR/SVR if the situation is appropriate, > once we implement KVM_SET_SREGS on e500. Haha - may

Re: [PATCH 1/2] KVM: PPC: fix exit accounting for SPRs, tlbwe, tlbsx

2011-03-30 Thread Alexander Graf
On 28.03.2011, at 22:01, Scott Wood wrote: > The exit type setting for mfspr/mtspr is moved from 44x to toplevel SPR > emulation. This enables it on e500, and makes sure that all SPRs > are covered. > > Exit accounting for tlbwe and tlbsx is added to e500. > > Signed-off-by: Stuart Yoder > Si

Re: [PATCH v2] KVM: PPC: e500: emulate SVR

2011-03-30 Thread Alexander Graf
On 29.03.2011, at 23:49, Scott Wood wrote: > Return the actual host SVR for now, as we already do for PVR. Eventually > we may support Qemu overriding PVR/SVR if the situation is appropriate, > once we implement KVM_SET_SREGS on e500. Haha - maybe I should have read your v2 before replying to t

Re: [PATCH] KVM: PPC: emulate SVR

2011-03-30 Thread Alexander Graf
On 29.03.2011, at 18:46, Scott Wood wrote: > On Tue, 29 Mar 2011 08:09:09 -0500 > Jimi Xenidis wrote: > >> >> On Mar 29, 2011, at 4:18 AM, Alexander Graf wrote: >> >>> >>> On 28.03.2011, at 21:15, Scott Wood wrote: >>> Return the actual host SVR. On e500, qemu currently pretends in th