aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorJohn Allen <john.allen@amd.com>2024-06-03 19:36:22 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2024-06-08 10:33:39 +0200
commit1ea1432199cdddbb4e7f98cee71cabf50a9516f2 (patch)
tree888a0dd955464148f87da8766f7768eea84220b7 /target
parent2ba8b7ee63589d4063c3b8dff3b70dbf9e224fc6 (diff)
downloadqemu-1ea1432199cdddbb4e7f98cee71cabf50a9516f2.zip
qemu-1ea1432199cdddbb4e7f98cee71cabf50a9516f2.tar.gz
qemu-1ea1432199cdddbb4e7f98cee71cabf50a9516f2.tar.bz2
i386: Add support for overflow recovery
Add cpuid bit definition for overflow recovery. This is needed in the case where a deferred error has been sent to the guest, a guest process accesses the poisoned memory, but the machine_check_poll function has not yet handled the original deferred error. If overflow recovery is not set in this case, when we handle the uncorrected error from the poisoned memory access, the overflow bit will be set and will result in the guest being shut down. By the time the MCE reaches the guest, the overflow has been handled by the host and has not caused a shutdown, so include the bit unconditionally. Signed-off-by: John Allen <john.allen@amd.com> Message-ID: <20240603193622.47156-4-john.allen@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/i386/cpu.c2
-rw-r--r--target/i386/cpu.h1
-rw-r--r--target/i386/kvm/kvm.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index c5a532a..7466217 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1183,7 +1183,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
[FEAT_8000_0007_EBX] = {
.type = CPUID_FEATURE_WORD,
.feat_names = {
- NULL, "succor", NULL, NULL,
+ "overflow-recov", "succor", NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 6786055..8fe28b6 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -984,6 +984,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
#define CPUID_14_0_ECX_LIP (1U << 31)
/* RAS Features */
+#define CPUID_8000_0007_EBX_OVERFLOW_RECOV (1U << 0)
#define CPUID_8000_0007_EBX_SUCCOR (1U << 1)
/* CLZERO instruction */
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 56d8e2a..912f5d5 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -533,7 +533,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
cpuid_1_edx = kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX);
ret |= cpuid_1_edx & CPUID_EXT2_AMD_ALIASES;
} else if (function == 0x80000007 && reg == R_EBX) {
- ret |= CPUID_8000_0007_EBX_SUCCOR;
+ ret |= CPUID_8000_0007_EBX_OVERFLOW_RECOV | CPUID_8000_0007_EBX_SUCCOR;
} else if (function == KVM_CPUID_FEATURES && reg == R_EAX) {
/* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't
* be enabled without the in-kernel irqchip