From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Piggin Date: Sat, 25 Dec 2021 10:12:25 +0000 Subject: Re: [PATCH 2/3] KVM: PPC: Fix vmx/vsx mixup in mmio emulation Message-Id: <1640427087.r4g49fcnps.astroid@bobo.none> List-Id: References: <20211223211528.3560711-1-farosas@linux.ibm.com> <20211223211528.3560711-3-farosas@linux.ibm.com> In-Reply-To: <20211223211528.3560711-3-farosas@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Fabiano Rosas , kvm-ppc@vger.kernel.org Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org Excerpts from Fabiano Rosas's message of December 24, 2021 7:15 am: > The MMIO emulation code for vector instructions is duplicated between > VSX and VMX. When emulating VMX we should check the VMX copy size > instead of the VSX one. > > Fixes: acc9eb9305fe ("KVM: PPC: Reimplement LOAD_VMX/STORE_VMX instruction ...") > Signed-off-by: Fabiano Rosas Good catch. AFAIKS handle_vmx_store needs the same treatment? If you agree then Reviewed-by: Nicholas Piggin > --- > arch/powerpc/kvm/powerpc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > index 1e130bb087c4..793d42bd6c8f 100644 > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -1507,7 +1507,7 @@ int kvmppc_handle_vmx_load(struct kvm_vcpu *vcpu, > { > enum emulation_result emulated = EMULATE_DONE; > > - if (vcpu->arch.mmio_vsx_copy_nums > 2) > + if (vcpu->arch.mmio_vmx_copy_nums > 2) > return EMULATE_FAIL; > > while (vcpu->arch.mmio_vmx_copy_nums) { > -- > 2.33.1 > >