From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [ANNOUNCE] kvm-20 release Date: Tue, 24 Apr 2007 13:18:12 +0300 Message-ID: <462DD964.8060204@qumranet.com> References: <462B372C.4050207@qumranet.com> <200704241114.11921.mail@earthworm.de> <462DCC66.3000902@qumranet.com> <200704241149.39214.mail@earthworm.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg)" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Christian Hesse Return-path: In-reply-to: <200704241149.39214.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT Christian Hesse wrote: >> It may be the cpuid strangeness that Rusty saw. Can you try the >> attached patch? >> > > No, that does not help. > Ah, I see it. The Core processor does not have the STAR msr. Can you try backing out the attached patch? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. --Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg) Content-type: text/x-patch; name=kvm-avoid-k6-star-msr.patch Content-transfer-encoding: 7BIT Content-disposition: inline; filename=kvm-avoid-k6-star-msr.patch commit 5c828f83928f186320d74627089122ebc9ea98ce Author: Avi Kivity Date: Thu Apr 19 14:28:44 2007 +0300 KVM: VMX: Only save/restore MSR_K6_STAR if necessary Intel hosts only support syscall/sysret in long more (and only if efer.sce is enabled), so only reload the related MSR_K6_STAR if the guest will actually be able to use it. This reduces vmexit cost by about 500 cycles (6400 -> 5870) on my setup. Signed-off-by: Avi Kivity diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index b61d4dd..3f43f50 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -323,6 +323,16 @@ static void setup_msrs(struct kvm_vcpu *vcpu) nr_skip = NR_64BIT_MSRS; nr_good_msrs = vcpu->nmsrs - nr_skip; + /* + * MSR_K6_STAR is only needed on long mode guests, and only + * if efer.sce is enabled. + */ + --nr_good_msrs; +#if CONFIG_X86_64 + if (is_long_mode(vcpu) && (vcpu->shadow_efer & EFER_SCE)) + ++nr_good_msrs; +#endif + vmcs_writel(VM_ENTRY_MSR_LOAD_ADDR, virt_to_phys(vcpu->guest_msrs + nr_skip)); vmcs_writel(VM_EXIT_MSR_STORE_ADDR, --Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ --Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --Boundary_(ID_cjsF2tpsUBHMmzJT/8NVIg)--