Skip to content

Commit b99234b

Browse files
farosasmpe
authored andcommitted
KVM: PPC: Fix vmx/vsx mixup in mmio emulation
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: acc9eb9 ("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
1 parent 36d014d commit b99234b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/powerpc/kvm/powerpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ int kvmppc_handle_vmx_load(struct kvm_vcpu *vcpu,
14991499
{
15001500
enum emulation_result emulated = EMULATE_DONE;
15011501

1502-
if (vcpu->arch.mmio_vsx_copy_nums > 2)
1502+
if (vcpu->arch.mmio_vmx_copy_nums > 2)
15031503
return EMULATE_FAIL;
15041504

15051505
while (vcpu->arch.mmio_vmx_copy_nums) {
@@ -1596,7 +1596,7 @@ int kvmppc_handle_vmx_store(struct kvm_vcpu *vcpu,
15961596
unsigned int index = rs & KVM_MMIO_REG_MASK;
15971597
enum emulation_result emulated = EMULATE_DONE;
15981598

1599-
if (vcpu->arch.mmio_vsx_copy_nums > 2)
1599+
if (vcpu->arch.mmio_vmx_copy_nums > 2)
16001600
return EMULATE_FAIL;
16011601

16021602
vcpu->arch.io_gpr = rs;

0 commit comments

Comments
 (0)