]>
Commit | Line | Data |
---|---|---|
e3bc6a2b WB |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> | |
3 | Date: Wed, 12 Jul 2017 13:20:56 -0300 | |
4 | Subject: [PATCH] target/i386: Use host_vendor_fms() in max_x86_cpu_initfn() | |
5 | ||
6 | The existing code duplicated the logic in host_vendor_fms(), so | |
7 | reuse the helper function instead. | |
8 | ||
9 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> | |
10 | Message-Id: <20170712162058.10538-3-ehabkost@redhat.com> | |
11 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | |
12 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> | |
13 | --- | |
14 | target/i386/cpu.c | 9 ++------- | |
15 | 1 file changed, 2 insertions(+), 7 deletions(-) | |
16 | ||
17 | diff --git a/target/i386/cpu.c b/target/i386/cpu.c | |
18 | index 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 | -- | |
38 | 2.11.0 | |
39 |