KVM: nSVM: Fix IOIO size reported on emulation
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 30 Jun 2014 09:07:05 +0000 (11:07 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Jul 2014 16:09:56 +0000 (18:09 +0200)
The access size of an in/ins is reported in dst_bytes, and that of
out/outs in src_bytes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c

index 3483ac978c76e55681430bd817633d78c7914f34..1824949821f9be538ed886d1901378c22061bdd6 100644 (file)
@@ -4261,9 +4261,9 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu,
                if (info->intercept == x86_intercept_in ||
                    info->intercept == x86_intercept_ins) {
                        exit_info |= SVM_IOIO_TYPE_MASK;
-                       bytes = info->src_bytes;
-               } else {
                        bytes = info->dst_bytes;
+               } else {
+                       bytes = info->src_bytes;
                }
 
                if (info->intercept == x86_intercept_outs ||