From nobody Mon Feb 9 07:23:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1605540221; cv=none; d=zohomail.com; s=zohoarc; b=IDJahcH65Is2F1qXSNDz1LBvwcbC033Paokoq0VTY+TJ0r4APvOqZyaKTEM6aCpbm17qgrEOFCwM1KM5RC4SkIOnhzTcfNDyrt37Xr6xqBmsURdV2sJGnQ/aP/DBRJSvzRNr2/jvnbu/TnWQr82yFFoulWvjXtckLgPoV08z/Tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605540221; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7TSXaJ46w8yEBaZXgTkkUKrJ11tcc5zJYr0/Dd0EWvw=; b=Xgfx4QOOkuRQ4amXkR/QFxYV3gJJeE6lst1J94qS4Y/k0N73haJfyn2UCeeR8oM3593z4Bw1rQwUbLzRLbA8KEBjSlBUTONzpHQl6bqyLozvOXOAuLS8Y64+U6glQVGhXwAjxVDpu69uvBVA5jKD92wgZI45sVCE1ynwsxvig5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1605540221326132.13007787068034; Mon, 16 Nov 2020 07:23:41 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.28408.57501 (Exim 4.92) (envelope-from ) id 1kegLa-00022E-Av; Mon, 16 Nov 2020 15:23:14 +0000 Received: by outflank-mailman (output) from mailman id 28408.57501; Mon, 16 Nov 2020 15:23:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kegLa-000227-7a; Mon, 16 Nov 2020 15:23:14 +0000 Received: by outflank-mailman (input) for mailman id 28408; Mon, 16 Nov 2020 15:23:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kegLZ-00021s-6E for xen-devel@lists.xenproject.org; Mon, 16 Nov 2020 15:23:13 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 878419fc-0a68-46c0-80a6-a0ba60545ba3; Mon, 16 Nov 2020 15:23:12 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 53E7DAF54; Mon, 16 Nov 2020 15:23:11 +0000 (UTC) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kegLZ-00021s-6E for xen-devel@lists.xenproject.org; Mon, 16 Nov 2020 15:23:13 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 878419fc-0a68-46c0-80a6-a0ba60545ba3; Mon, 16 Nov 2020 15:23:12 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 53E7DAF54; Mon, 16 Nov 2020 15:23:11 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 878419fc-0a68-46c0-80a6-a0ba60545ba3 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1605540191; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7TSXaJ46w8yEBaZXgTkkUKrJ11tcc5zJYr0/Dd0EWvw=; b=kbxwwbSbic75h8CbBEGa4RPjZcOZSiLsyUaLQmZI4NJChAXBnTOWl3cLQq3B049ptVRxCv HMo1ztEJTWDos++KwwHzOWAamJQ2ns0YYm5dfePqDQ7x7Chl1g27Hgux0rBmT+630o1hmv zqDzdWww0VhhzjsH4LxoLFUb0xWhT5U= From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH 1/4] x86/xen: use specific Xen pv interrupt entry for MCE Date: Mon, 16 Nov 2020 16:22:58 +0100 Message-Id: <20201116152301.24558-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201116152301.24558-1-jgross@suse.com> References: <20201116152301.24558-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Xen PV guests don't use IST. For machine check interrupts switch to the same model as debug interrupts. Signed-off-by: Juergen Gross --- arch/x86/include/asm/idtentry.h | 3 +++ arch/x86/xen/enlighten_pv.c | 16 +++++++++++++++- arch/x86/xen/xen-asm.S | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentr= y.h index b2442eb0ac2f..3505c0396fa5 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -588,6 +588,9 @@ DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check); #else DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check); #endif +#ifdef CONFIG_XEN_PV +DECLARE_IDTENTRY_RAW(X86_TRAP_MC, xenpv_exc_machine_check); +#endif #endif =20 /* NMI */ diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 4409306364dc..9f5e44c1f70a 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -583,6 +583,20 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug) exc_debug(regs); } =20 +#ifdef CONFIG_X86_MCE +DEFINE_IDTENTRY_RAW(xenpv_exc_machine_check) +{ + /* + * There's no IST on Xen PV, but we still need to dispatch + * to the correct handler. + */ + if (user_mode(regs)) + noist_exc_machine_check(regs); + else + exc_machine_check(regs); +} +#endif + struct trap_array_entry { void (*orig)(void); void (*xen)(void); @@ -603,7 +617,7 @@ static struct trap_array_entry trap_array[] =3D { TRAP_ENTRY_REDIR(exc_debug, true ), TRAP_ENTRY(exc_double_fault, true ), #ifdef CONFIG_X86_MCE - TRAP_ENTRY(exc_machine_check, true ), + TRAP_ENTRY_REDIR(exc_machine_check, true ), #endif TRAP_ENTRY_REDIR(exc_nmi, true ), TRAP_ENTRY(exc_int3, false ), diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S index 1cb0e84b9161..bc2586730a5b 100644 --- a/arch/x86/xen/xen-asm.S +++ b/arch/x86/xen/xen-asm.S @@ -172,7 +172,7 @@ xen_pv_trap asm_exc_spurious_interrupt_bug xen_pv_trap asm_exc_coprocessor_error xen_pv_trap asm_exc_alignment_check #ifdef CONFIG_X86_MCE -xen_pv_trap asm_exc_machine_check +xen_pv_trap asm_xenpv_exc_machine_check #endif /* CONFIG_X86_MCE */ xen_pv_trap asm_exc_simd_coprocessor_error #ifdef CONFIG_IA32_EMULATION --=20 2.26.2