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
This commit is contained in:
Evgeny Yakovlev 2018-02-26 04:59:08 -05:00 committed by Lioncash
parent b7f434373b
commit fa9d708fbd
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1668,7 +1668,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
"Opteron_G3", "Opteron_G3",
5, 0x80000008, 5, 0x80000008,
CPUID_VENDOR_AMD, CPUID_VENDOR_AMD,
15, 6, 1, 16, 2, 3,
{ {
// FEAT_1_EDX // FEAT_1_EDX
CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_VME | CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |