From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Christian Hesse <mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [ANNOUNCE] kvm-20 release
Date: Tue, 24 Apr 2007 13:18:12 +0300 [thread overview]
Message-ID: <462DD964.8060204@qumranet.com> (raw)
In-Reply-To: <200704241149.39214.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
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.
[-- Attachment #2: kvm-avoid-k6-star-msr.patch --]
[-- Type: text/x-patch, Size: 1184 bytes --]
commit 5c828f83928f186320d74627089122ebc9ea98ce
Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
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 <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
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,
[-- Attachment #3: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
next prev parent reply other threads:[~2007-04-24 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-22 10:21 [ANNOUNCE] kvm-20 release Avi Kivity
[not found] ` <462B372C.4050207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-23 13:52 ` Jeff Chua
[not found] ` <b6a2187b0704230652q27bf8178q2c8b0b55807085ad-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-04-24 8:48 ` Avi Kivity
[not found] ` <462DC453.7000608-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-24 9:14 ` Christian Hesse
[not found] ` <200704241114.11921.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2007-04-24 9:22 ` Avi Kivity
[not found] ` <462DCC66.3000902-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-24 9:49 ` Christian Hesse
[not found] ` <200704241149.39214.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2007-04-24 10:18 ` Avi Kivity [this message]
[not found] ` <462DD964.8060204-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-24 10:44 ` Christian Hesse
[not found] ` <200704241244.13115.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2007-04-24 14:46 ` Jeff Chua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=462DD964.8060204@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox