From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabiano Rosas Date: Mon, 27 Dec 2021 17:28:28 +0000 Subject: Re: [PATCH 2/3] KVM: PPC: Fix vmx/vsx mixup in mmio emulation Message-Id: <87zgomq7nn.fsf@linux.ibm.com> List-Id: References: <20211223211528.3560711-1-farosas@linux.ibm.com> <20211223211528.3560711-3-farosas@linux.ibm.com> <1640427087.r4g49fcnps.astroid@bobo.none> In-Reply-To: <1640427087.r4g49fcnps.astroid@bobo.none> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Nicholas Piggin , kvm-ppc@vger.kernel.org Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org Nicholas Piggin writes: > 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 Half the bug now, half the bug next year... haha I'll send a v2. aside: All this duplication is kind of annoying. I'm looking into what it would take to have quadword instruction emulation here as well (Alexey caught a bug with syskaller) and the code would be really similar. I see that x86 has a more generic implementation that maybe we could take advantage of. See "f78146b0f923 (KVM: Fix page-crossing MMIO)"