From patchwork Mon Aug 24 13:03:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 43611 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 n7OD4itg002748 for ; Mon, 24 Aug 2009 13:04:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752441AbZHXNEk (ORCPT ); Mon, 24 Aug 2009 09:04:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752419AbZHXNEj (ORCPT ); Mon, 24 Aug 2009 09:04:39 -0400 Received: from tx2ehsobe004.messaging.microsoft.com ([65.55.88.14]:40046 "EHLO TX2EHSOBE008.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbZHXNEj (ORCPT ); Mon, 24 Aug 2009 09:04:39 -0400 Received: from mail59-tx2-R.bigfish.com (10.9.14.245) by TX2EHSOBE008.bigfish.com (10.9.40.28) with Microsoft SMTP Server id 8.1.340.0; Mon, 24 Aug 2009 13:04:40 +0000 Received: from mail59-tx2 (localhost.localdomain [127.0.0.1]) by mail59-tx2-R.bigfish.com (Postfix) with ESMTP id 682A37C820F; Mon, 24 Aug 2009 13:04:40 +0000 (UTC) X-SpamScore: -29 X-BigFish: VPS-29(zz1432R98dNaf6Wa594izz1202hzzz32i6bh203h61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, Received: by mail59-tx2 (MessageSwitch) id 1251119077468406_3192; Mon, 24 Aug 2009 13:04:37 +0000 (UCT) Received: from ausb3extmailp02.amd.com (ausb3extmailp02.amd.com [163.181.251.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail59-tx2.bigfish.com (Postfix) with ESMTP id 3A872147804E; Mon, 24 Aug 2009 13:04:37 +0000 (UTC) Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n7OD4Who018570; Mon, 24 Aug 2009 08:04:35 -0500 X-WSS-ID: 0KOVTNG-01-BAI-02 X-M-MSG: Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 27EE01028490; Mon, 24 Aug 2009 08:04:28 -0500 (CDT) Received: from sausexmb1.amd.com ([163.181.3.156]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2009 08:04:30 -0500 Received: from SDRSEXMB1.amd.com ([172.20.3.116]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2009 08:04:30 -0500 Received: from seurexmb1.amd.com ([165.204.9.130]) by SDRSEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2009 15:04:07 +0200 Received: from [165.204.15.38] ([165.204.15.38]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Aug 2009 15:04:06 +0200 Message-ID: <4A928FB7.1030501@amd.com> Date: Mon, 24 Aug 2009 15:03:51 +0200 From: Andre Przywara User-Agent: Thunderbird 2.0.0.21 (X11/20090329) MIME-Version: 1.0 To: Thomas Besser CC: kvm@vger.kernel.org Subject: Re: [PATCH] Fix sysenter migration issue on AMD CPUs References: <1250855924-13762-1-git-send-email-andre.przywara@amd.com> In-Reply-To: X-OriginalArrivalTime: 24 Aug 2009 13:04:06.0914 (UTC) FILETIME=[5CDFDE20:01CA24BB] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Thomas Besser wrote: > Andre Przywara wrote: >> Stephane, Thomas: Can you verify this? > > I'm not very familiar with compiling kvm-mod from git sources. And your > patch does not apply to svm.c shipped with kernel 2.6.30.5 You shouldn't have seen any problems with 2.6.30.5, since the code in question (sysenter/syscall emulation) is not in here. > > So at the moment I have no clue, how to verify. Is there any short howto out > there, how to get kvm module from git source? You can use the attached patch, which applies against kvm-kmod-devel-88.tar.gz If that does not help, tell me with what tree or tarball you are usually generating the KVM kernel modules. I use Avi's latest git tree, which is regularly synced with 2.6.31.rc. The patch from Friday should apply against this one. $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git You will have to build your whole kernel with this tree, if you build only the modules from here they will certainly mismatch your running kernel. Regards, Andre. diff --git a/x86/svm.c b/x86/svm.c index fb29061..75d18bf 100644 --- a/x86/svm.c +++ b/x86/svm.c @@ -117,7 +117,6 @@ struct vcpu_svm { unsigned long vmcb_pa; struct svm_cpu_data *svm_data; uint64_t asid_generation; - uint64_t sysenter_cs; uint64_t sysenter_esp; uint64_t sysenter_eip; @@ -436,8 +435,6 @@ static void svm_vcpu_init_msrpm(u32 *msrpm) #endif set_msr_interception(msrpm, MSR_K6_STAR, 1, 1); set_msr_interception(msrpm, MSR_IA32_SYSENTER_CS, 1, 1); - set_msr_interception(msrpm, MSR_IA32_SYSENTER_ESP, 1, 1); - set_msr_interception(msrpm, MSR_IA32_SYSENTER_EIP, 1, 1); } static void svm_enable_lbrv(struct vcpu_svm *svm) @@ -2062,7 +2059,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) break; #endif case MSR_IA32_SYSENTER_CS: - *data = svm->sysenter_cs; + *data = svm->vmcb->save.sysenter_cs; break; case MSR_IA32_SYSENTER_EIP: *data = svm->sysenter_eip; @@ -2151,13 +2148,15 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) break; #endif case MSR_IA32_SYSENTER_CS: - svm->sysenter_cs = data; + svm->vmcb->save.sysenter_cs = data; break; case MSR_IA32_SYSENTER_EIP: svm->sysenter_eip = data; + svm->vmcb->save.sysenter_eip = data; break; case MSR_IA32_SYSENTER_ESP: svm->sysenter_esp = data; + svm->vmcb->save.sysenter_esp = data; break; case MSR_IA32_DEBUGCTLMSR: if (!svm_has(SVM_FEATURE_LBRV)) {