[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1507430107-4338-2-git-send-email-wanpeng.li@hotmail.com>
Date: Sat, 7 Oct 2017 19:35:07 -0700
From: Wanpeng Li <kernellwp@...il.com>
To: linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: [PATCH 2/2] KVM: X86: XCR0 should be set to the fixed value on vCPU reset
From: Wanpeng Li <wanpeng.li@...mail.com>
SDM section 2.6 mentioned:
After reset, all bits (except bit 0) in XCR0 are cleared to zero; XCR0[0] is set to 1.
This patch sets XCRO to the 0x1 after vCPU reset.
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Radim Krčmář <rkrcmar@...hat.com>
Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
---
arch/x86/kvm/x86.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b0d2915..c784cd6 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7816,6 +7816,8 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
vcpu->arch.regs_avail = ~0;
vcpu->arch.regs_dirty = ~0;
+ vcpu->arch.xcr0 = XFEATURE_MASK_FP;
+
kvm_x86_ops->vcpu_reset(vcpu, init_event);
}
--
2.7.4
Powered by blists - more mailing lists