From: Alexander Graf Date: Tue, 22 Nov 2011 11:13:39 +0000 Subject: Re: [PATCH] KVM: PPC: Apply paravirt to all vcpu Message-Id: <01DA71FD-8A69-44BA-A108-33005DBA3D88@suse.de> List-Id: References: <1321955703-1628-1-git-send-email-yu.liu@freescale.com> In-Reply-To: <1321955703-1628-1-git-send-email-yu.liu@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On 22.11.2011, at 10:55, Liu Yu wrote: > Previously, only primary vcpu get enabled paravirt. Please fix it the other way around. Thd hypercall is CPU local and should stay that way, so we have to call it on each vcpu inside the guest. Alex > > Signed-off-by: Liu Yu > --- > arch/powerpc/kvm/powerpc.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 73508e7..a727064 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -78,8 +78,13 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu) > switch (nr) { > case HC_VENDOR_KVM | KVM_HC_PPC_MAP_MAGIC_PAGE: > { > - vcpu->arch.magic_page_pa = param1; > - vcpu->arch.magic_page_ea = param2; > + struct kvm *kvm = vcpu->kvm; > + struct kvm_vcpu *v; > + > + kvm_for_each_vcpu(r, v, kvm) { > + v->arch.magic_page_pa = param1; > + v->arch.magic_page_ea = param2; > + } > > r2 = KVM_MAGIC_FEAT_SR | KVM_MAGIC_FEAT_MAS0_TO_SPRG7; > > -- > 1.6.4 > >