9ae3a8
From d56b59537e7039d62f4ae68610eb0763d88f9289 Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Wed, 15 Jan 2014 19:37:36 -0500
9ae3a8
Subject: [PATCH 07/14] pc: Fix rhel6.* 3dnow & 3dnowext compat bits
9ae3a8
9ae3a8
Message-id: <1389814656-20101-1-git-send-email-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 56728
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH] pc: Fix rhel6.* 3dnow & 3dnowext compat bits
9ae3a8
Bugzilla: 918907
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Bandan Das <bsd@redhat.com>
9ae3a8
9ae3a8
Bugzilla: 918907
9ae3a8
Upstream status: not applicable
9ae3a8
Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6879262
9ae3a8
9ae3a8
RHEL-6 qemu-kvm has a hack that unconditionally disables 3dnow and
9ae3a8
3dnowext on the CPUID handling code. To keep compatibility we need to do
9ae3a8
the same on the rhel6.* machine-types.
9ae3a8
9ae3a8
The hack on RHEL-6 is at target-i386/cpuid.c:cpu_x86_cpuid():
9ae3a8
9ae3a8
    switch(index) {
9ae3a8
    [...]
9ae3a8
    case 0x80000001:
9ae3a8
        [...]
9ae3a8
        if (kvm_enabled()) {
9ae3a8
            [...]
9ae3a8
            /* 3dnow */
9ae3a8
            *edx &= ~0xc0000000;
9ae3a8
        } [...]
9ae3a8
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c | 4 ++++
9ae3a8
 1 file changed, 4 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c | 4 ++++
9ae3a8
 1 file changed, 4 insertions(+)
9ae3a8
9ae3a8
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
9ae3a8
index 2961bc8..29c013a 100644
9ae3a8
--- a/hw/i386/pc_piix.c
9ae3a8
+++ b/hw/i386/pc_piix.c
9ae3a8
@@ -902,6 +902,10 @@ static void pc_init_rhel650(QEMUMachineInitArgs *args)
9ae3a8
     x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX,
9ae3a8
                                 0, CPUID_EXT2_RDTSCP);
9ae3a8
 
9ae3a8
+    /* RHEL-6 had 3dnow & 3dnowext unconditionally disabled on all models */
9ae3a8
+    x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0,
9ae3a8
+                                CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT);
9ae3a8
+
9ae3a8
     disable_kvm_pv_unhalt();
9ae3a8
 
9ae3a8
     rom_file_in_ram = false; 
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8