Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 86

kvm-83-164.el5_5.9.src.rpm

From 6dbf5c157f4ea3807a752086b8cae154d909d0aa Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Thu, 2 Jul 2009 10:51:42 -0300
Subject: [PATCH 3/3] Change default CPU model to model=6 (skype fix #2)

This reverts commit 34716722bf33acd7adf01f9640456e73f4d30831,
and includes the following change, from Andrea Arcangeli:

--------------
enable sysenter on 32bit guests (skype fix) #2

Update, see comment on model=3... such subtle details there seem to be
in windows, and then somebody on qemu-devel thought they could use a
brand not-existing qemu new vendor_id != intel/amd with the potential
for bigger screwup of all the guest OS... (not just windows) to fix
this ;).

NOTE: you should check the patch applied with no offset-warnings
because this risks to go to modify some other cpu definition and not
qemu64 if there are offsets (if applied on current source it changes
athlon because qemu64 is 6,3,3 in rhel5/master). This is not against
rhel5/master but against rhel5/master minus the previous version of
this patch and it obsoletes the previous patch. I guess it also
invalidates all my testing (however intel/windows32 + skype has
already been tested, and linux32/64 is sure fine as well on intel). I
think I only need to re-test windows32+skype on svm and linux32 on
svm, and linux64 with compatibility mode again on svm.

------------
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.

model=3 would fix sysenter troubles but it prevents windows XP from using
all cpus, so model=6 matches "Athlon (PM core)" on AMD and "P2 with
on-die L2 cache" on Intel and it allows windows to use all CPUs as well
as fixing sysenter.

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

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 6 so windows 32bit (and linux32bit) gets a boost with
sysenter too.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Message-ID: <20090702135142.GN9711@blackpad>
Message-ID: <20090702124933.GW14272@random.random>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: 508623
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Avi Kivity <avi@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Glauber Costa <glommer@redhat.com>
---
 qemu/target-i386/helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu/target-i386/helper.c b/qemu/target-i386/helper.c
index a2be8d7..c8321c4 100644
--- a/qemu/target-i386/helper.c
+++ b/qemu/target-i386/helper.c
@@ -125,8 +125,8 @@ static x86_def_t x86_defs[] = {
         .vendor2 = CPUID_VENDOR_AMD_2,
         .vendor3 = CPUID_VENDOR_AMD_3,
         .family = 6,
-	/* AMD Duron || PII Intel with sep capbility - P6 has no sep */
-        .model = 3,
+        /* Athlon (PM core) || P2 with on-die L2 cache - P6 has no sep */
+        .model = 6,
         .stepping = 3,
         .features = PPRO_FEATURES | 
         /* these features are needed for Win64 and aren't fully implemented */
-- 
1.6.3.rc4.29.g8146