]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0028-target-i386-Define-CPUID_MODEL_ID_SZ-macro.patch
bump version to 2.9.1-9
[pve-qemu.git] / debian / patches / extra / 0028-target-i386-Define-CPUID_MODEL_ID_SZ-macro.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:57 -0300
4Subject: [PATCH] target/i386: Define CPUID_MODEL_ID_SZ macro
5
6Document cpu_x86_fill_model_id() and define CPUID_MODEL_ID_SZ to
7help callers use the right buffer size.
8
9Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
10Message-Id: <20170712162058.10538-4-ehabkost@redhat.com>
11Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
12---
13 target/i386/cpu.c | 11 +++++++++++
14 1 file changed, 11 insertions(+)
15
16diff --git a/target/i386/cpu.c b/target/i386/cpu.c
17index 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--
392.11.0
40