From nobody Sun Feb 8 04:35:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646039934925858.2818778823922; Mon, 28 Feb 2022 01:18:54 -0800 (PST) Received: from localhost ([::1]:46290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOcBA-0002Qh-Ej for importer@patchew.org; Mon, 28 Feb 2022 04:18:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOcA3-0001Uu-07 for qemu-devel@nongnu.org; Mon, 28 Feb 2022 04:17:45 -0500 Received: from gw.haihefund.cn ([220.194.70.58]:32352 helo=spam.unicloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOc9y-0001zJ-3H for qemu-devel@nongnu.org; Mon, 28 Feb 2022 04:17:41 -0500 Received: from eage.unicloud.com ([220.194.70.35]) by spam.unicloud.com with ESMTP id 21S9HI4t050430; Mon, 28 Feb 2022 17:17:18 +0800 (GMT-8) (envelope-from luofei@unicloud.com) Received: from zgys-ex-mb09.Unicloud.com (10.10.0.24) by zgys-ex-mb11.Unicloud.com (10.10.0.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.17; Mon, 28 Feb 2022 17:17:17 +0800 Received: from zgys-ex-mb09.Unicloud.com ([fe80::eda0:6815:ca71:5aa]) by zgys-ex-mb09.Unicloud.com ([fe80::eda0:6815:ca71:5aa%16]) with mapi id 15.01.2375.017; Mon, 28 Feb 2022 17:17:17 +0800 From: =?gb2312?B?wt63yQ==?= To: qemu-devel Subject: =?gb2312?B?tPC4tDogW1BBVENIXSBpMzg2OiBTZXQgTUNHX1NUQVRVU19SSVBWIGJpdCBm?= =?gb2312?Q?or_mce_SRAR_error?= Thread-Topic: [PATCH] i386: Set MCG_STATUS_RIPV bit for mce SRAR error Thread-Index: AQHYDdpiM0Sj+cD120OyD4W4YWbm6ayo7CVD Date: Mon, 28 Feb 2022 09:17:17 +0000 Message-ID: <4e86fc594ede4b029d0f82d9d1ca0142@unicloud.com> References: <20220120084634.131450-1-luofei@unicloud.com> In-Reply-To: <20220120084634.131450-1-luofei@unicloud.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.1.7] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DNSRBL: X-MAIL: spam.unicloud.com 21S9HI4t050430 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=220.194.70.58; envelope-from=luofei@unicloud.com; helo=spam.unicloud.com X-Spam_score_int: 37 X-Spam_score: 3.7 X-Spam_bar: +++ X-Spam_report: (3.7 / 5.0 requ) BAYES_00=-1.9, CHARSET_FARAWAY_HEADER=3.2, MIME_CHARSET_FARAWAY=2.45, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Marcelo Tosatti , "kvm@vger.kernel.org" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1646039937837100001 Content-Type: text/plain; charset="utf-8" ping https://patchew.org/QEMU/20220120084634.131450-1-luofei@unicloud.com/ ________________________________________ =E5=8F=91=E4=BB=B6=E4=BA=BA: =E7=BD=97=E9=A3=9E =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B41=E6=9C=8820=E6=97=A5 16= :46 =E6=94=B6=E4=BB=B6=E4=BA=BA: qemu-devel =E6=8A=84=E9=80=81: Paolo Bonzini; Marcelo Tosatti; kvm@vger.kernel.org; = =E7=BD=97=E9=A3=9E =E4=B8=BB=E9=A2=98: [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 --- 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, i= nt code) if (code =3D=3D BUS_MCEERR_AR) { status |=3D MCI_STATUS_AR | 0x134; - mcg_status |=3D MCG_STATUS_EIPV; + mcg_status |=3D MCG_STATUS_RIPV | MCG_STATUS_EIPV; } else { status |=3D 0xc0; mcg_status |=3D MCG_STATUS_RIPV; -- 2.27.0