cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From d56b59537e7039d62f4ae68610eb0763d88f9289 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Wed, 15 Jan 2014 19:37:36 -0500
Subject: [PATCH 07/14] pc: Fix rhel6.* 3dnow & 3dnowext compat bits

Message-id: <1389814656-20101-1-git-send-email-ehabkost@redhat.com>
Patchwork-id: 56728
O-Subject: [RHEL-7 qemu-kvm PATCH] pc: Fix rhel6.* 3dnow & 3dnowext compat bits
Bugzilla: 918907
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Bandan Das <bsd@redhat.com>

Bugzilla: 918907
Upstream status: not applicable
Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6879262

RHEL-6 qemu-kvm has a hack that unconditionally disables 3dnow and
3dnowext on the CPUID handling code. To keep compatibility we need to do
the same on the rhel6.* machine-types.

The hack on RHEL-6 is at target-i386/cpuid.c:cpu_x86_cpuid():

    switch(index) {
    [...]
    case 0x80000001:
        [...]
        if (kvm_enabled()) {
            [...]
            /* 3dnow */
            *edx &= ~0xc0000000;
        } [...]

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 4 ++++
 1 file changed, 4 insertions(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/i386/pc_piix.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2961bc8..29c013a 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -902,6 +902,10 @@ static void pc_init_rhel650(QEMUMachineInitArgs *args)
     x86_cpu_compat_set_features("Opteron_G3", FEAT_8000_0001_EDX,
                                 0, CPUID_EXT2_RDTSCP);
 
+    /* RHEL-6 had 3dnow & 3dnowext unconditionally disabled on all models */
+    x86_cpu_compat_set_features(NULL, FEAT_8000_0001_EDX, 0,
+                                CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT);
+
     disable_kvm_pv_unhalt();
 
     rom_file_in_ram = false; 
-- 
1.8.3.1