teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0012-virt-enable-detecting-QEMU-TCG-via-CPUID-6399.patch

Zbigniew Jędrzejewski-Szmek 27bd1b
From e48936b0be085f15a2e2ac88b2e50a91a66782ac Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 27bd1b
From: Daniel Berrange <berrange@redhat.com>
Zbigniew Jędrzejewski-Szmek 27bd1b
Date: Wed, 19 Jul 2017 10:06:07 +0100
Zbigniew Jędrzejewski-Szmek 27bd1b
Subject: [PATCH] virt: enable detecting QEMU (TCG) via CPUID (#6399)
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
QEMU >= 2.10 will include a CPUID leaf with value "TCGTCGTCGTCG"
Zbigniew Jędrzejewski-Szmek 27bd1b
on x86 when running with the TCG CPU emulator:
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
  https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg05231.html
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
Existing methods of detecting QEMU are left unchanged for sake of
Zbigniew Jędrzejewski-Szmek 27bd1b
backcompatibility.
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Zbigniew Jędrzejewski-Szmek 27bd1b
(cherry picked from commit 5588612e9e8828691f13141e3fcebe08a59201fe)
Zbigniew Jędrzejewski-Szmek 27bd1b
---
Zbigniew Jędrzejewski-Szmek 27bd1b
 src/basic/virt.c | 1 +
Zbigniew Jędrzejewski-Szmek 27bd1b
 1 file changed, 1 insertion(+)
Zbigniew Jędrzejewski-Szmek 27bd1b
Zbigniew Jędrzejewski-Szmek 27bd1b
diff --git a/src/basic/virt.c b/src/basic/virt.c
Zbigniew Jędrzejewski-Szmek 27bd1b
index 6011744523..5143ac6656 100644
Zbigniew Jędrzejewski-Szmek 27bd1b
--- a/src/basic/virt.c
Zbigniew Jędrzejewski-Szmek 27bd1b
+++ b/src/basic/virt.c
Zbigniew Jędrzejewski-Szmek 27bd1b
@@ -46,6 +46,7 @@ static int detect_vm_cpuid(void) {
Zbigniew Jędrzejewski-Szmek 27bd1b
         } cpuid_vendor_table[] = {
Zbigniew Jędrzejewski-Szmek 27bd1b
                 { "XenVMMXenVMM", VIRTUALIZATION_XEN       },
Zbigniew Jędrzejewski-Szmek 27bd1b
                 { "KVMKVMKVM",    VIRTUALIZATION_KVM       },
Zbigniew Jędrzejewski-Szmek 27bd1b
+                { "TCGTCGTCGTCG", VIRTUALIZATION_QEMU      },
Zbigniew Jędrzejewski-Szmek 27bd1b
                 /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
Zbigniew Jędrzejewski-Szmek 27bd1b
                 { "VMwareVMware", VIRTUALIZATION_VMWARE    },
Zbigniew Jędrzejewski-Szmek 27bd1b
                 /* https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs */