From patchwork Fri Aug 7 09:49:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 39849 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n779tthI031466 for ; Fri, 7 Aug 2009 09:56:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755895AbZHGJx7 (ORCPT ); Fri, 7 Aug 2009 05:53:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757056AbZHGJu2 (ORCPT ); Fri, 7 Aug 2009 05:50:28 -0400 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:17605 "EHLO TX2EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755895AbZHGJuI (ORCPT ); Fri, 7 Aug 2009 05:50:08 -0400 Received: from mail75-tx2-R.bigfish.com (10.9.14.237) by TX2EHSOBE001.bigfish.com (10.9.40.21) with Microsoft SMTP Server id 8.1.340.0; Fri, 7 Aug 2009 09:50:07 +0000 Received: from mail75-tx2 (localhost.localdomain [127.0.0.1]) by mail75-tx2-R.bigfish.com (Postfix) with ESMTP id 35C9E17080A5; Fri, 7 Aug 2009 09:50:07 +0000 (UTC) X-SpamScore: 3 X-BigFish: VPS3(zzzz1202hzzz32i203h43j62h) X-Spam-TCS-SCL: 1:0 Received: by mail75-tx2 (MessageSwitch) id 1249638605811795_30278; Fri, 7 Aug 2009 09:50:05 +0000 (UCT) Received: from svlb1extmailp02.amd.com (unknown [139.95.251.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail75-tx2.bigfish.com (Postfix) with ESMTP id 8E6D5898050; Fri, 7 Aug 2009 09:50:05 +0000 (UTC) Received: from svlb1twp02.amd.com ([139.95.250.35]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n779nvVU012628; Fri, 7 Aug 2009 02:50:01 -0700 X-WSS-ID: 0KO03BC-04-L8J-01 Received: from SSVLEXBH2.amd.com (ssvlexbh2.amd.com [139.95.53.183]) by svlb1twp02.amd.com (Tumbleweed MailGate 3.5.1) with ESMTP id 2F5B31103BE; Fri, 7 Aug 2009 02:49:59 -0700 (PDT) Received: from SSVLEXMB1.amd.com ([139.95.53.181]) by SSVLEXBH2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:50:02 -0700 Received: from SF30EXMB1.amd.com ([172.20.6.49]) by SSVLEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:50:01 -0700 Received: from seurexmb1.amd.com ([165.204.9.130]) by SF30EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:53 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:51 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id E28BCC9F89; Fri, 7 Aug 2009 11:49:50 +0200 (CEST) From: Joerg Roedel To: Avi Kivity CC: Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 18/21] kvm/svm: remove unnecessary is_nested check from svm_cpu_run Date: Fri, 7 Aug 2009 11:49:45 +0200 Message-ID: <1249638588-10982-19-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> References: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 07 Aug 2009 09:49:51.0233 (UTC) FILETIME=[68865710:01CA1744] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This check is not necessary. We have to sync the vcpu->arch.cr2 always back to the VMCB. This patch remove the is_nested check. Signed-off-by: Joerg Roedel --- arch/x86/kvm/svm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1839c19..9a2354d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2606,8 +2606,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) fs_selector = kvm_read_fs(); gs_selector = kvm_read_gs(); ldt_selector = kvm_read_ldt(); - if (!is_nested(svm)) - svm->vmcb->save.cr2 = vcpu->arch.cr2; + svm->vmcb->save.cr2 = vcpu->arch.cr2; /* required for live migration with NPT */ if (npt_enabled) svm->vmcb->save.cr3 = vcpu->arch.cr3;