From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 290B7C2BB85 for ; Fri, 21 Jun 2024 17:52:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKiPw-0001OQ-9D; Fri, 21 Jun 2024 13:51:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKiPu-0001OC-Hh for qemu-devel@nongnu.org; Fri, 21 Jun 2024 13:51:18 -0400 Received: from mgamail.intel.com ([198.175.65.9]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKiPr-0002yI-HT for qemu-devel@nongnu.org; Fri, 21 Jun 2024 13:51:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718992275; x=1750528275; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=SLeii5j5k5vGYEw4iDrnweH4Ox0CgUP8QDAOEhrkh9U=; b=ceKYrmfiHDE2zRr/ueYLEHb+3dFi0BMJrXze7mvGiBf4bnP/rLmT/9VP ssJYn9Ua6vja1hgLzsS1QsoGI1KJJF/82UAPdppTBxxSVGiyYNZpvfQj1 Vb6COIIcFYCVCScRJfB9YDC2KrZ8vx6ben4j9JoCBTg6HStKDdBgwrGxw yX3FYKLZPOe8Sy/XGzxSap1ysBA/IN1G6TL7wxlIoIKhuYl5l+EDr8n2+ vvNTwBQOqe8mCVtVR0aTmrLZIEYGn6i4sA4U9JN4vFXqTgioCrr4131Lp AUO8Rhg08txLNqtt5xptEaIZqFJXTNsQ936Z6AjWALHlsdde9GRv7yb2Q A==; X-CSE-ConnectionGUID: 9/BvhWZCT3CBIGMsInybkQ== X-CSE-MsgGUID: GKOGvkPpRd+DIDZBKs45tQ== X-IronPort-AV: E=McAfee;i="6700,10204,11110"; a="38557252" X-IronPort-AV: E=Sophos;i="6.08,255,1712646000"; d="scan'208";a="38557252" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2024 10:51:10 -0700 X-CSE-ConnectionGUID: uv8bsZJwRdCXkS2BYLf1Ew== X-CSE-MsgGUID: pShUpPRYR/arHZWo8JNNNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,255,1712646000"; d="scan'208";a="47838398" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Jun 2024 10:51:10 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 21 Jun 2024 10:51:10 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 21 Jun 2024 10:51:10 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.47) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 21 Jun 2024 10:51:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lYApV3Aa+yIcLoR/tYQ7GM24iVEGdgMaFttHZMaWrKSm/9xeZ104dWoC5Q+t3LsdTo8qUEHUr1Wkf8WnyoPUNM8wqIK2VKPG1rEqr6XD581hJrcHAJEAoICEpJzr/k6orSVudHUCeEtdHZYzB0XjhGxwMITWvAde4cBUjCr7arLE7tnj2B/U7Y0O7dRa8rDp74o05YmALhQ6yu+UEomA3Zgvml4cr7JB5aKJlO+en1tm7FgRe1KUKS4MKJ9jI6X3dZ/BHKVebzf96mRI9kSpLj37uDJc1TiLLMAsXdP64YNfMOKJIEgLexLYwl3UQ22RU65f57enK7astJHIyGE5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qqsrz5xEx5q/Cn3pzsYEV8OkOpHNIhZ+4o13XXfkuwE=; b=l6YJKOREVMb55tFbqafvZkVGT3GX2MVkxNtTF3UiTlYWa+7923hkfpw3Lb3/2Yrzzmgc3fPlU05nVr44jt7EWOkPlzJ0kjXWDVDOLfrRvPFZTuo/Cld30rov/P97kRNRd+zvw+GtqC5Lxvn2w+h1qd27KcVBO9h5SJrs6rpA781tl72+H/5Wz/+ZaDwr+VJr0Z4dRGc9rJkDSQ1P09FVWSd7HgkuMU0wXpHlkOWrPqNNLJH/jCARusA80KuKvm5B7GFtfac4d6ffPn+2Cqbfi7fD+Gd3rmsz9f9LHUkZLaEetH0W7BUmlNWlxWYMUybuy8JQqoKp0G9LIFefnJkMTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) by MN2PR11MB4535.namprd11.prod.outlook.com (2603:10b6:208:24e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.20; Fri, 21 Jun 2024 17:51:07 +0000 Received: from PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8]) by PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8%6]) with mapi id 15.20.7633.021; Fri, 21 Jun 2024 17:51:05 +0000 Date: Fri, 21 Jun 2024 10:51:02 -0700 From: Dan Williams To: Shiyang Ruan , , CC: , , , , , , Subject: Re: [RFC PATCH] cxl: avoid duplicating report from MCE & device Message-ID: <6675bd86ea005_57ac29411@dwillia2-xfh.jf.intel.com.notmuch> References: <20240618165310.877974-1-ruansy.fnst@fujitsu.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240618165310.877974-1-ruansy.fnst@fujitsu.com> X-ClientProxiedBy: MW4PR04CA0260.namprd04.prod.outlook.com (2603:10b6:303:88::25) To PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR11MB8107:EE_|MN2PR11MB4535:EE_ X-MS-Office365-Filtering-Correlation-Id: 729ca789-495d-48b0-823a-08dc921ab92a X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|366013|1800799021; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?NkQJqCVLHPrJHIKnD65qDWDD/kAxESNDGEJMjJvwExHOeUx4w0iixlrYlRlp?= =?us-asc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ykpnx5/Sj0fUw/mEU?= =?us-ascii?Q?1E6sC8Im5MCZuhbXIhW7C6rmmpTpqmhvQbIa25D5aqGvZ62OEi9wJQTfYIXS?= =?us-ascii?Q?+HBSRzLazGr7Qc7WCE1DrTpNDOSjBK7YIHbZq/VBbm3ypDb6BUFZdfuDtYKe?= =?us-ascii?Q?+k8LCMLOul75WtqlXWX1KW8/g5WTljrzi9kPtvE2/rA7zg5gIwTAGAYb41L+?= =?us-ascii?Q?VSI9Qo8nqbw/V05eELnile2z/sejaNGrSHtlGT2dq/X8tkxfBD5HKyER3xvP?= =?us-ascii?Q?GxDEakKNjDXG6oPVKo+6KUzyzFlhTox7fKF8pF+6766C6F7JLkqQ8AOaXbof?= =?us-ascii?Q?wEPsOBSvbDoj1CwV4dR6?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH8PR11MB8107.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(376011)(366013)(1800799021); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HxbKeavvIaa7QgACgLcqE0bVidB4iC7fVZfSbaDzqbHi+FnZtgGPKMsvJz6n?= =?us-ascii?Q?ZiA3+xV+GVQ/aZ0acHHVzWnfsMUU45LkRtkBHfcCd6jPu9KkAvmr/jqqu9bV?= =?us-ascii?Q?XYoNsCFdXD+BZv4nJiA7WUPofQqmb+u8N9ncAUT3I5EsoBtNkwUVDa5k9G1Y?= =?us-ascii?Q?YXZuw+UYpIpaNWWlWz+NSClf6dwukNuVLAKpLYOJZ5uQTSSu1eAxwBZGqn6n?= =?us-ascii?Q?COVY6yJne8gPAwDEqhlBC72PEYxb468smwjo0NVv20FvJG+sekv4QmmqfIix?= =?us-ascii?Q?eJDB5TarId3S3VNAA2kROQREHE1H0Mc7uHz+eDvFcPWgP1ZUg1mLGqwAnO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/QtCNP7PxRqBB0U0lykQhs57va?= =?us-ascii?Q?CgNZgMfOl79AAU4D0Kk0caZ7zxf5sScPs00cxyQ9sp+lQbL1/hy8iP8/qxNq?= =?us-ascii?Q?VhjE+p+XjV5UElabyZxkccmF0HAtmN7luECy68OZ9f2T/VTWxedwfkFrEEPB?= =?us-ascii?Q?2/2gDL5li4vJXcrxpqmi6e2sVWMo/2g/F+Ul7hSGLvtRxHQ7BHEWJXj/ed+m?= =?us-ascii?Q?jSYjBS8Gtl4Y/RoHaWXWsLT8Az6KtsidzQjNGb7tJnXY9D61rMI+K/E776iR?= =?us-ascii?Q?TVX4vlKH+VtlL2Jzs3GlaAUdHnXVI/Sr0VRZvwD+ITj8z+U2S/CApcfNIpOR?= =?us-ascii?Q?66SIeKjpfcX5tOQxzc8XobGrJ6SgehPl5bJ2S9wvsfevGzHMj+evP6Z5QAgm?= =?us-ascii?Q?lw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 729ca789-495d-48b0-823a-08dc921ab92a X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB8107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2024 17:51:05.4714 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2E3BBSfNjYXtaJWwjcSBYCg3r3f7cgs6H0yrrpJ/gu28BWEPMcM1R5CPPjTkiKJtqxPrcw0vJk2Yb3qdz+qkJ72fnM3/MUmWFh5JQnAKsNs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4535 X-OriginatorOrg: intel.com Received-SPF: pass client-ip=198.175.65.9; envelope-from=dan.j.williams@intel.com; helo=mgamail.intel.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Shiyang Ruan wrote: > Background: > Since CXL device is a memory device, while CPU consumes a poison page of > CXL device, it always triggers a MCE by interrupt (INT18), no matter > which-First path is configured. This is the first report. Then > currently, in FW-First path, the poison event is transferred according > to the following process: CXL device -> firmware -> OS:ACPI->APEI->GHES > -> CPER -> trace report. This is the second one. These two reports > are indicating the same poisoning page, which is the so-called "duplicate > report"[1]. And the memory_failure() handling I'm trying to add in > OS-First path could also be another duplicate report. > > Hope the flow below could make it easier to understand: > CPU accesses bad memory on CXL device, then > -> MCE (INT18), *always* report (1) > -> * FW-First (implemented now) > -> CXL device -> FW > -> OS:ACPI->APEI->GHES->CPER -> trace report (2.a) > * OS-First (not implemented yet, I'm working on it) > -> CXL device -> MSI > -> OS:CXL driver -> memory_failure() (2.b) > so, the (1) and (2.a/b) are duplicated. > > (I didn't get response in my reply for [1] while I have to make patch to > solve this problem, so please correct me if my understanding is wrong.) The CPU MCE may not be in the loop. Consider the case of patrol scrub, or device-DMA accessing poison. In that case the device will signal a component event and the CPU may never issue the MCE. What is missing for me from this description is *why* does the duplicate report matter in practice? If all that happens is that the kernel repeats the lookup to offline the page and set the HWPoison bit, is that duplicated work worth adding more tracking? > This patch adds a new notifier_block and MCE_PRIO_CXL, for CXL memdev > to check whether the current poison page has been reported (if yes, > stop the notifier chain, won't call the following memory_failure() > to report), into `x86_mce_decoder_chain`. In this way, if the poison > page already handled(recorded and reported) in (1) or (2), the other one > won't duplicate the report. The record could be clear when > cxl_clear_poison() is called. > > [1] https://lore.kernel.org/linux-cxl/664d948fb86f0_e8be294f8@dwillia2-mobl3.amr.corp.intel.com.notmuch/ > > Signed-off-by: Shiyang Ruan > --- > arch/x86/include/asm/mce.h | 1 + > drivers/cxl/core/mbox.c | 130 +++++++++++++++++++++++++++++++++++++ > drivers/cxl/core/memdev.c | 6 +- > drivers/cxl/cxlmem.h | 3 + > 4 files changed, 139 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h > index dfd2e9699bd7..d8109c48e7d9 100644 > --- a/arch/x86/include/asm/mce.h > +++ b/arch/x86/include/asm/mce.h > @@ -182,6 +182,7 @@ enum mce_notifier_prios { > MCE_PRIO_NFIT, > MCE_PRIO_EXTLOG, > MCE_PRIO_UC, > + MCE_PRIO_CXL, > MCE_PRIO_EARLY, > MCE_PRIO_CEC, > MCE_PRIO_HIGHEST = MCE_PRIO_CEC > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > index 2626f3fff201..0eb3c5401e81 100644 > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c > @@ -4,6 +4,8 @@ > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -880,6 +882,9 @@ void cxl_event_trace_record(const struct cxl_memdev *cxlmd, > if (cxlr) > hpa = cxl_trace_hpa(cxlr, cxlmd, dpa); > > + if (hpa != ULLONG_MAX && cxl_mce_recorded(hpa)) > + return; > + > if (event_type == CXL_CPER_EVENT_GEN_MEDIA) > trace_cxl_general_media(cxlmd, type, cxlr, hpa, > &evt->gen_media); > @@ -1408,6 +1413,127 @@ int cxl_poison_state_init(struct cxl_memdev_state *mds) > } > EXPORT_SYMBOL_NS_GPL(cxl_poison_state_init, CXL); > > +struct cxl_mce_record { > + struct list_head node; > + u64 hpa; > +}; > +LIST_HEAD(cxl_mce_records); > +DEFINE_MUTEX(cxl_mce_mutex); I would recommend an xarray for this use case as that already has its own internal locking and efficient memory allocation for new nodes. However, the "why" question needs to be answered first.