public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* enable sysenter on 32bit guests
@ 2009-06-18 17:38 Andrea Arcangeli
  2009-06-21 10:04 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Arcangeli @ 2009-06-18 17:38 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

From: Andrea Arcangeli <aarcange@redhat.com>

model=2 is not existent when vendor is intel and an errata of P6 says
that any model <= 2 when family is 6 lack sap feature, so windows and
linux 32bit guests disable sap in software and slowdown for no good
reason when running inside kvm on intel CPU.

Fix is to set model = 3 so it'll be the duron cpu when kvm runs on amd bare
metal (not anymore athlon but userland doesn't see the difference) and it'll be
PII that has sysenter functional like all cpus that run KVM have too when on
intel bare metal.

Patch will follow, workaround without this fix is -cpu qemu64,model=3.

There is a bug in skype that it checks if the sep feature is set to
run sysenter on intel chip inside its binary without passing through
ntdll, without verifying the model was <= 2 like windows does, so
windows forbids sysenter but skype calls it anyway. This is skype bug
and it would trigger on real P6 hardware too (but nobody tests skype
on P6). qemu64,-sep fixed skype. But because every time we have an
intel cpu running kvm, we also have sysenter functioning, we boots the
model to 3 so windows 32bit (and linux32bit) gets a boost with
sysenter too.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---

diff --git a/target-i386/helper.c b/target-i386/helper.c
index 6dc0111..82aef93 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -126,7 +126,8 @@ static x86_def_t x86_defs[] = {
         .vendor2 = CPUID_VENDOR_AMD_2,
         .vendor3 = CPUID_VENDOR_AMD_3,
         .family = 6,
-        .model = 2,
+	/* AMD Duron || PII Intel with sep capbility - P6 has no sep */
+        .model = 3,
         .stepping = 3,
         .features = PPRO_FEATURES | 
         /* these features are needed for Win64 and aren't fully implemented */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: enable sysenter on 32bit guests
  2009-06-18 17:38 enable sysenter on 32bit guests Andrea Arcangeli
@ 2009-06-21 10:04 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-06-21 10:04 UTC (permalink / raw)
  To: Andrea Arcangeli; +Cc: kvm

On 06/18/2009 08:38 PM, Andrea Arcangeli wrote:
> From: Andrea Arcangeli<aarcange@redhat.com>
>
> model=2 is not existent when vendor is intel and an errata of P6 says
> that any model<= 2 when family is 6 lack sap feature, so windows and
> linux 32bit guests disable sap in software and slowdown for no good
> reason when running inside kvm on intel CPU.
>
> Fix is to set model = 3 so it'll be the duron cpu when kvm runs on amd bare
> metal (not anymore athlon but userland doesn't see the difference) and it'll be
> PII that has sysenter functional like all cpus that run KVM have too when on
> intel bare metal.
>
> Patch will follow, workaround without this fix is -cpu qemu64,model=3.
>
> There is a bug in skype that it checks if the sep feature is set to
> run sysenter on intel chip inside its binary without passing through
> ntdll, without verifying the model was<= 2 like windows does, so
> windows forbids sysenter but skype calls it anyway. This is skype bug
> and it would trigger on real P6 hardware too (but nobody tests skype
> on P6). qemu64,-sep fixed skype. But because every time we have an
> intel cpu running kvm, we also have sysenter functioning, we boots the
> model to 3 so windows 32bit (and linux32bit) gets a boost with
> sysenter too.
>
>    

Please post to qemu-devel since it affects upstream too.

> -        .model = 2,
> +	/* AMD Duron || PII Intel with sep capbility - P6 has no sep */
> +        .model = 3,
>    


But detab it first...

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-21 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18 17:38 enable sysenter on 32bit guests Andrea Arcangeli
2009-06-21 10:04 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox