]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/extra/0028-target-i386-Define-CPUID_MODEL_ID_SZ-macro.patch
f46cb61c7f1c5eabec6fee36566b0ad37a195fdd
[pve-qemu.git] / debian / patches / extra / 0028-target-i386-Define-CPUID_MODEL_ID_SZ-macro.patch
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:57 -0300
4 Subject: [PATCH] target/i386: Define CPUID_MODEL_ID_SZ macro
5
6 Document cpu_x86_fill_model_id() and define CPUID_MODEL_ID_SZ to
7 help callers use the right buffer size.
8
9 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
10 Message-Id: <20170712162058.10538-4-ehabkost@redhat.com>
11 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
12 ---
13 target/i386/cpu.c | 11 +++++++++++
14 1 file changed, 11 insertions(+)
15
16 diff --git a/target/i386/cpu.c b/target/i386/cpu.c
17 index 1affd3bb5b..54832dd591 100644
18 --- a/target/i386/cpu.c
19 +++ b/target/i386/cpu.c
20 @@ -1541,6 +1541,17 @@ static bool lmce_supported(void)
21 return !!(mce_cap & MCG_LMCE_P);
22 }
23
24 +#define CPUID_MODEL_ID_SZ 48
25 +
26 +/**
27 + * cpu_x86_fill_model_id:
28 + * Get CPUID model ID string from host CPU.
29 + *
30 + * @str should have at least CPUID_MODEL_ID_SZ bytes
31 + *
32 + * The function does NOT add a null terminator to the string
33 + * automatically.
34 + */
35 static int cpu_x86_fill_model_id(char *str)
36 {
37 uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
38 --
39 2.11.0
40