mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
KVM: PPC: Fix vmx/vsx mixup in mmio emulation
[ Upstream commitb99234b918] 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:acc9eb9305("KVM: PPC: Reimplement LOAD_VMX/STORE_VMX instruction ...") Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220125215655.1026224-3-farosas@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
11cb9eba06
commit
e8fe653fa7
@@ -1500,7 +1500,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) {
|
||||
@@ -1597,7 +1597,7 @@ int kvmppc_handle_vmx_store(struct kvm_vcpu *vcpu,
|
||||
unsigned int index = rs & KVM_MMIO_REG_MASK;
|
||||
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;
|
||||
|
||||
vcpu->arch.io_gpr = rs;
|
||||
|
||||
Reference in New Issue
Block a user