From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCH] Fix sysenter migration issue on AMD CPUs Date: Mon, 24 Aug 2009 15:03:51 +0200 Message-ID: <4A928FB7.1030501@amd.com> References: <1250855924-13762-1-git-send-email-andre.przywara@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020504040303020703000904" Cc: kvm@vger.kernel.org To: Thomas Besser Return-path: 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 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: --------------020504040303020703000904 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit 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. -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448 3567 12 ----to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy; Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------020504040303020703000904 Content-Type: text/x-patch; name="fix_sysenter_migration.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_sysenter_migration.patch" 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)) { --------------020504040303020703000904--