Patchwork [1/3] KVM: x86: fix typo in KVM_GET_XCRS

login
register
mail settings
Submitter Gleb Natapov
Date Nov. 21, 2013, 1:28 p.m.
Message ID <0fd53fec92c5b636ef4774fe130f6029fde9fc3c.1385040432.git.gleb@redhat.com>
Download mbox | patch
Permalink /patch/293136/
State New
Headers show

Comments

Gleb Natapov - Nov. 21, 2013, 1:28 p.m.
From: Paolo Bonzini <pbonzini@redhat.com>

Only the first item of the array was ever looked at.  No
practical effect, but still worth fixing.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 target-i386/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 749aa09..27071e3 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1314,8 +1314,8 @@  static int kvm_get_xcrs(X86CPU *cpu)
 
     for (i = 0; i < xcrs.nr_xcrs; i++) {
         /* Only support xcr0 now */
-        if (xcrs.xcrs[0].xcr == 0) {
-            env->xcr0 = xcrs.xcrs[0].value;
+        if (xcrs.xcrs[i].xcr == 0) {
+            env->xcr0 = xcrs.xcrs[i].value;
             break;
         }
     }