[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2] x86/mcheck: keep the banks past the end of the CMCI map polled
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
- Date: Tue, 27 Oct 2026 12:19:24 -0700
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xgLw99O5rK3mJ3/D1pRGmjU8Ajn00l6hs94fnBFb4cY=; b=AXrQK8ZNP9BheFIxWzfZaFlcD7qrVKyxw0zJNXtzehkPG6O6UON1ogBiLHc40JlPUpSeZkjnnUqEWS+cK4ffrEPnD5j5vA5yThc7JAVIlMtSMq8syCN0WrRateMlqjIMZpN8DBqylcS378wzW6HpB9V6hEk+Ik5DSV1M915sHlyhE3DmQcew7yY5BnPh+c6W4dJcweBJtSlCPbCAB6AeIONmoCadnPPK+cldc1/7xKkL6ELlFG2dBwYiW3ztoyUJh9LFMwqD4XqS8EAFvbcqeo6ZqXadSZ8kYZfYjI2eb1N+eROSO9XX36A70i9vrQJ047zkMAuVt3deJ39+JB7R1w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EVfF/vXqg1FUTwiaHYL6nYQXsL4vFljioTQ5XHYK1J1c1ibKoKCu7AZGhhFlyf0WPfrhtM1ODn0P8myeEcxv/eHQhUVSrHRxns4Gu0rm2Lmz+fdsOW8bt9AqrXqZkTJDxsW8SxjMRjEmSEzYANbt6p9ZeR/Ox3QxYUBYig1W2oIyIx2ltklrXIq3M2B8Z5pqqQ9pAcB8vlpyoRgU77faTMIpQrNdRcpDT5CQ1WOsco4uC/vbyjbmbS6l16gJDXTswygzhWaj6epFu45gpTMzcZrGWE04T3SHnDiqfu01uMGBKMKtM2FQbpiYdt63jFzJWKBchv6yHKItLpmqoIsD7w==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <roger@xxxxxxxxxxxxxx>, <teddy.astie@xxxxxxxxxx>, <jason.andryuk@xxxxxxx>, <roger.pau@xxxxxxx>
- Delivery-date: Tue, 27 Oct 2026 19:19:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
bitmap_copy() copies whole words, so in set_poll_bankmask() it may clear
banks past the end of the CMCI map that bitmap_fill() may just have set,
leaving them neither polled nor reported by CMCI. Set those bits after
the copy instead.
Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxx>
---
v2:
- reword the commit message as suggested by Jan
---
xen/arch/x86/cpu/mcheck/mce.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1888f22d15..f9a1389516 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -621,9 +621,14 @@ static void set_poll_bankmask(struct cpuinfo_x86 *c)
{
const struct mca_banks *cmci = per_cpu(no_cmci_banks, cpu);
- if ( unlikely(cmci->num < mb->num) )
- bitmap_fill(mb->bank_map, mb->num);
bitmap_copy(mb->bank_map, cmci->bank_map, min(mb->num, cmci->num));
+ /*
+ * Banks past the end of the CMCI map are not reported by CMCI
+ * either, so they need polling. Set them after the copy, which
+ * works in whole words and would otherwise clear them again.
+ */
+ if ( unlikely(cmci->num < mb->num) )
+ bitmap_set(mb->bank_map, cmci->num, mb->num - cmci->num);
}
else
{
--
2.47.3
|