kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error
@ 2022-01-20  8:46 luofei
  2022-02-28  9:17 ` 答复: " 罗飞
  2022-03-21 15:31 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: luofei @ 2022-01-20  8:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Marcelo Tosatti, kvm, luofei

In the physical machine environment, when a SRAR error occurs,
the IA32_MCG_STATUS RIPV bit is set, but qemu does not set this
bit. When qemu injects an SRAR error into virtual machine, the
virtual machine kernel just call do_machine_check() to kill the
current task, but not call memory_failure() to isolate the faulty
page, which will cause the faulty page to be allocated and used
repeatedly. If used by the virtual machine kernel, it will cause
the virtual machine to crash

Signed-off-by: luofei <luofei@unicloud.com>
---
 target/i386/kvm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 2c8feb4a6f..14655577f0 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -537,7 +537,7 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)
 
     if (code == BUS_MCEERR_AR) {
         status |= MCI_STATUS_AR | 0x134;
-        mcg_status |= MCG_STATUS_EIPV;
+        mcg_status |= MCG_STATUS_RIPV | MCG_STATUS_EIPV;
     } else {
         status |= 0xc0;
         mcg_status |= MCG_STATUS_RIPV;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* 答复: [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error
  2022-01-20  8:46 [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error luofei
@ 2022-02-28  9:17 ` 罗飞
  2022-03-21 15:31 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: 罗飞 @ 2022-02-28  9:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Marcelo Tosatti, kvm

ping
https://patchew.org/QEMU/20220120084634.131450-1-luofei@unicloud.com/
________________________________________
发件人: 罗飞
发送时间: 2022年1月20日 16:46
收件人: qemu-devel
抄送: Paolo Bonzini; Marcelo Tosatti; kvm@vger.kernel.org; 罗飞
主题: [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error

In the physical machine environment, when a SRAR error occurs,
the IA32_MCG_STATUS RIPV bit is set, but qemu does not set this
bit. When qemu injects an SRAR error into virtual machine, the
virtual machine kernel just call do_machine_check() to kill the
current task, but not call memory_failure() to isolate the faulty
page, which will cause the faulty page to be allocated and used
repeatedly. If used by the virtual machine kernel, it will cause
the virtual machine to crash

Signed-off-by: luofei <luofei@unicloud.com>
---
 target/i386/kvm/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 2c8feb4a6f..14655577f0 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -537,7 +537,7 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code)

     if (code == BUS_MCEERR_AR) {
         status |= MCI_STATUS_AR | 0x134;
-        mcg_status |= MCG_STATUS_EIPV;
+        mcg_status |= MCG_STATUS_RIPV | MCG_STATUS_EIPV;
     } else {
         status |= 0xc0;
         mcg_status |= MCG_STATUS_RIPV;
--
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error
  2022-01-20  8:46 [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error luofei
  2022-02-28  9:17 ` 答复: " 罗飞
@ 2022-03-21 15:31 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-03-21 15:31 UTC (permalink / raw)
  To: luofei; +Cc: qemu-devel, Marcelo Tosatti, kvm

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-21 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20  8:46 [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error luofei
2022-02-28  9:17 ` 答复: " 罗飞
2022-03-21 15:31 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).