From fa9d708fbd8664e2d55eb5126d7077a4d0f366f5 Mon Sep 17 00:00:00 2001 From: Evgeny Yakovlev Date: Mon, 26 Feb 2018 04:59:08 -0500 Subject: [PATCH] target-i386: Correct family/model/stepping for Opteron_G3 Current CPU definition for AMD Opteron third generation includes features like SSE4a and LAHF_LM support in emulated CPUID. These features are present in K8 rev.E or K10 CPUs and later. However, current G3 family and model describe 2nd generation K8 cores instead. This is incorrect but was considered harmless until our tests found a problem with linux kernels >= 3.10 (and maybe earlier) which specifically check for Opteron K8 model when parsing CPUID leaf 0x80000001: http://lxr.free-electrons.com/source/arch/x86/kernel/cpu/amd.c?v=3.16#L552 This code will disable LAHF_LM feature in /proc/cpuinfo if model number is inconsistent. This change sets Opteron_G3 family/model/stepping to 16/2/3 which is a proper Opteron 3rd generation 2350 CPU. Backports commit 339892d758efb2d0954160d41736a0eac9875d67 from qemu --- qemu/target-i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/target-i386/cpu.c b/qemu/target-i386/cpu.c index 6f06caf2..dc380c1e 100644 --- a/qemu/target-i386/cpu.c +++ b/qemu/target-i386/cpu.c @@ -1668,7 +1668,7 @@ static X86CPUDefinition builtin_x86_defs[] = { "Opteron_G3", 5, 0x80000008, CPUID_VENDOR_AMD, - 15, 6, 1, + 16, 2, 3, { // FEAT_1_EDX CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |