From patchwork Thu Apr 22 10:33:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 94084 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3MAZpAE021617 for ; Thu, 22 Apr 2010 10:40:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754156Ab0DVKfj (ORCPT ); Thu, 22 Apr 2010 06:35:39 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:25223 "EHLO TX2EHSOBE006.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753485Ab0DVKdb (ORCPT ); Thu, 22 Apr 2010 06:33:31 -0400 Received: from mail190-tx2-R.bigfish.com (10.9.14.243) by TX2EHSOBE006.bigfish.com (10.9.40.26) with Microsoft SMTP Server id 8.1.340.0; Thu, 22 Apr 2010 10:33:30 +0000 Received: from mail190-tx2 (localhost.localdomain [127.0.0.1]) by mail190-tx2-R.bigfish.com (Postfix) with ESMTP id 9B02A1710922; Thu, 22 Apr 2010 10:33:30 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzab9bhzz1202hzzz32i2a8h87h43h61h) X-Spam-TCS-SCL: 0:0 X-FB-DOMAIN-IP-MATCH: fail Received: from mail190-tx2 (localhost.localdomain [127.0.0.1]) by mail190-tx2 (MessageSwitch) id 1271932410329306_8495; Thu, 22 Apr 2010 10:33:30 +0000 (UTC) Received: from TX2EHSMHS036.bigfish.com (unknown [10.9.14.244]) by mail190-tx2.bigfish.com (Postfix) with ESMTP id 4D2A0C3004C; Thu, 22 Apr 2010 10:33:30 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by TX2EHSMHS036.bigfish.com (10.9.99.136) with Microsoft SMTP Server (TLS) id 14.0.482.44; Thu, 22 Apr 2010 10:33:28 +0000 Received: from ausb3twp01.amd.com ([163.181.250.37]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o3MARMHe009613; Thu, 22 Apr 2010 05:27:25 -0500 X-WSS-ID: 0L19XBL-01-034-02 X-M-MSG: Received: from sausexhtp01.amd.com (sausexhtp01.amd.com [163.181.3.165]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 23EDE1028A4E; Thu, 22 Apr 2010 05:33:21 -0500 (CDT) Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.2.234.1; Thu, 22 Apr 2010 03:33:23 -0700 Received: from storexbh1.amd.com (10.1.1.17) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.2.234.1; Thu, 22 Apr 2010 05:33:22 -0500 Received: from sausexmb1.amd.com ([163.181.3.156]) by storexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Apr 2010 06:33:22 -0400 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 22 Apr 2010 05:33:21 -0500 Received: from lemmy.osrc.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Apr 2010 12:33:18 +0200 Received: by lemmy.osrc.amd.com (Postfix, from userid 41430) id D13D4C9B7D; Thu, 22 Apr 2010 12:33:18 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 2/8] KVM: SVM: Make sure rip is synced to vmcb before nested vmexit Date: Thu, 22 Apr 2010 12:33:08 +0200 Message-ID: <1271932394-13968-3-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1271932394-13968-1-git-send-email-joerg.roedel@amd.com> References: <1271932394-13968-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 22 Apr 2010 10:33:18.0981 (UTC) FILETIME=[39709B50:01CAE207] MIME-Version: 1.0 X-Reverse-DNS: unknown Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Apr 2010 10:40:39 +0000 (UTC) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ec20584..c480d7f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2960,6 +2960,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) u16 gs_selector; u16 ldt_selector; + svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; + svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; + svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; + /* * A vmexit emulation is required before the vcpu can be executed * again. @@ -2967,10 +2971,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) if (unlikely(svm->nested.exit_required)) return; - svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; - svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; - svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; - pre_svm_run(svm); sync_lapic_to_cr8(vcpu);