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
6 Document cpu_x86_fill_model_id() and define CPUID_MODEL_ID_SZ to
7 help callers use the right buffer size.
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>
13 target/i386/cpu.c | 11 +++++++++++
14 1 file changed, 11 insertions(+)
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);
24 +#define CPUID_MODEL_ID_SZ 48
27 + * cpu_x86_fill_model_id:
28 + * Get CPUID model ID string from host CPU.
30 + * @str should have at least CPUID_MODEL_ID_SZ bytes
32 + * The function does NOT add a null terminator to the string
35 static int cpu_x86_fill_model_id(char *str)
37 uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;