i386: Enable NPT and NRIPSAVE for AMD CPUs

Modern AMD CPUs support NPT and NRIPSAVE features and KVM exposes these
when present. NRIPSAVE apeared somewhere in Opteron_G3 lifetime (e.g.
QuadCore AMD Opteron 2378 has is but QuadCore AMD Opteron HE 2344 doesn't),
NPT was introduced a bit earlier.

Add the FEAT_SVM leaf to Opteron_G4/G5 and EPYC/EPYC-IBPB cpu models.

Backports commit 9fe8b7be17eaac4cfde4083000cc96747d7cf4f8 from qemu
This commit is contained in:
Vitaly Kuznetsov 2019-02-03 17:14:28 -05:00 committed by Lioncash
parent 72afbf6d48
commit d13b35769d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -3400,6 +3400,24 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_EXT3_3DNOWPREFETCH | CPUID_EXT3_MISALIGNSSE |
CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | CPUID_EXT3_SVM |
CPUID_EXT3_LAHF_LM,
// FEAT_8000_0007_EDX
0,
// FEAT_8000_0008_EBX
0,
// FEAT_C000_0001_EDX
0,
// FEAT_KVM
0,
// FEAT_KVM_HINTS
0,
// FEAT_HYPERV_EAX
0,
// FEAT_HYPERV_EBX
0,
// FEAT_HYPERV_EDX
0,
// FEAT_SVM
CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE,
},
"AMD Opteron 62xx class CPU",
},
@ -3434,6 +3452,24 @@ static X86CPUDefinition builtin_x86_defs[] = {
CPUID_EXT3_3DNOWPREFETCH | CPUID_EXT3_MISALIGNSSE |
CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | CPUID_EXT3_SVM |
CPUID_EXT3_LAHF_LM,
// FEAT_8000_0007_EDX
0,
// FEAT_8000_0008_EBX
0,
// FEAT_C000_0001_EDX
0,
// FEAT_KVM
0,
// FEAT_KVM_HINTS
0,
// FEAT_HYPERV_EAX
0,
// FEAT_HYPERV_EBX
0,
// FEAT_HYPERV_EDX
0,
// FEAT_SVM
CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE,
},
"AMD Opteron 63xx class CPU",
},
@ -3490,7 +3526,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
// FEAT_HYPERV_EDX
0,
// FEAT_SVM
0,
CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE,
/* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
* KVM doesn't yet expose any XSAVES state save component.
@ -3558,7 +3594,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
// FEAT_HYPERV_EDX
0,
// FEAT_SVM
0,
CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE,
/* Missing: XSAVES (not supported by some Linux versions,
* including v4.1 to v4.12).
* KVM doesn't yet expose any XSAVES state save component.