]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0027-target-i386-Use-host_vendor_fms-in-max_x86_cpu_initf.patch
bump version to 2.9.1-9
[pve-qemu.git] / debian / patches / extra / 0027-target-i386-Use-host_vendor_fms-in-max_x86_cpu_initf.patch
CommitLineData
3dcc8d3b
WB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Eduardo Habkost <ehabkost@redhat.com>
3Date: Wed, 12 Jul 2017 13:20:56 -0300
4Subject: [PATCH] target/i386: Use host_vendor_fms() in max_x86_cpu_initfn()
5
6The existing code duplicated the logic in host_vendor_fms(), so
7reuse the helper function instead.
8
9Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
10Message-Id: <20170712162058.10538-3-ehabkost@redhat.com>
11Reviewed-by: Igor Mammedov <imammedo@redhat.com>
12Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
13---
14 target/i386/cpu.c | 9 ++-------
15 1 file changed, 2 insertions(+), 7 deletions(-)
16
17diff --git a/target/i386/cpu.c b/target/i386/cpu.c
18index 4b3bfb3802..1affd3bb5b 100644
19--- a/target/i386/cpu.c
20+++ b/target/i386/cpu.c
21@@ -1592,13 +1592,8 @@ static void max_x86_cpu_initfn(Object *obj)
22 X86CPUDefinition host_cpudef = { };
23 uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
24
25- host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx);
26- x86_cpu_vendor_words2str(host_cpudef.vendor, ebx, edx, ecx);
27-
28- host_cpuid(0x1, 0, &eax, &ebx, &ecx, &edx);
29- host_cpudef.family = ((eax >> 8) & 0x0F) + ((eax >> 20) & 0xFF);
30- host_cpudef.model = ((eax >> 4) & 0x0F) | ((eax & 0xF0000) >> 12);
31- host_cpudef.stepping = eax & 0x0F;
32+ host_vendor_fms(host_cpudef.vendor, &host_cpudef.family,
33+ &host_cpudef.model, &host_cpudef.stepping);
34
35 cpu_x86_fill_model_id(host_cpudef.model_id);
36
37--
382.11.0
39