kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julian Stecklina <jsteckli@os.inf.tu-dresden.de>
To: kvm@vger.kernel.org
Cc: Julian Stecklina <jsteckli@os.inf.tu-dresden.de>
Subject: [PATCH] KVM VMX: Make register state after reset conform to specification.
Date: Thu, 29 Nov 2012 15:38:51 +0100	[thread overview]
Message-ID: <1354199931-27026-1-git-send-email-jsteckli@os.inf.tu-dresden.de> (raw)
In-Reply-To: <87y5hkjydx.fsf@os.inf.tu-dresden.de>

Signed-off-by: Julian Stecklina <jsteckli@os.inf.tu-dresden.de>
---
 arch/x86/kvm/vmx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ff66a3b..ec5a3b3 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3948,7 +3948,6 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
 
 	vmx->soft_vnmi_blocked = 0;
 
-	vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
 	kvm_set_cr8(&vmx->vcpu, 0);
 	msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
 	if (kvm_vcpu_is_bsp(&vmx->vcpu))
@@ -3999,6 +3998,14 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
 		kvm_rip_write(vcpu, 0xfff0);
 	else
 		kvm_rip_write(vcpu, 0);
+
+	kvm_register_write(vcpu, VCPU_REGS_RAX, 0);
+	kvm_register_write(vcpu, VCPU_REGS_RBX, 0);
+	kvm_register_write(vcpu, VCPU_REGS_RCX, 0);
+	kvm_register_write(vcpu, VCPU_REGS_RDX, get_rdx_init_val());
+	kvm_register_write(vcpu, VCPU_REGS_RSI, 0);
+	kvm_register_write(vcpu, VCPU_REGS_RDI, 0);
+	kvm_register_write(vcpu, VCPU_REGS_RBP, 0);
 	kvm_register_write(vcpu, VCPU_REGS_RSP, 0);
 
 	vmcs_writel(GUEST_DR7, 0x400);
-- 
1.7.11.7


  reply	other threads:[~2012-11-29 15:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 14:07 KVM VMX: register state after reset violates spec Julian Stecklina
2012-11-29 14:38 ` Julian Stecklina [this message]
2012-11-29 14:55 ` [PATCH] KVM VMX: Make register state after reset conform to specification Julian Stecklina
2012-12-02 13:38 ` KVM VMX: register state after reset violates spec Gleb Natapov
2012-12-03 12:05   ` Julian Stecklina
2012-12-03 13:46   ` [PATCH v2] KVM: x86: Make register state after reset conform to specification Julian Stecklina
2012-12-04  9:48     ` Gleb Natapov
2012-12-04 12:13       ` [PATCH v3] " Julian Stecklina
2012-12-05 10:50         ` Gleb Natapov
2012-12-05 12:00           ` [PATCH v4] " Julian Stecklina
2012-12-05 13:27             ` Gleb Natapov
2012-12-05 14:26               ` [PATCH v5] " Julian Stecklina
2012-12-05 16:02                 ` Gleb Natapov
2012-12-05 14:27               ` [PATCH v4] " Julian Stecklina
2012-12-03 13:49   ` KVM VMX: register state after reset violates spec Julian Stecklina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354199931-27026-1-git-send-email-jsteckli@os.inf.tu-dresden.de \
    --to=jsteckli@os.inf.tu-dresden.de \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).