[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/mcheck: allow varying bank counts per CPU


  • To: Soham Dandapat <Soham.Dandapat@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Fri, 5 Sep 2025 13:02:13 -0400
  • 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=49cIEEYcoroeeY4iXCoKC2U9YVC/+LfllgFiGaDkGBY=; b=iAnqUNe9pBytNoJqn7NdodrsgY86dy5NHM3FTGjDoiYIZK16SWdBw7eSVA7v85MGmOPbgcBk2uZozunBeTGoCtSdZXV4s//FHDbIZg0c3zHo6YPsu0YNMy9WfX+zvAU81Fpxzu4lmPrqClOS1Cwu4e0MnNpWe/7Onpqy5oSxqs6GJ09gbTib22mwSWleeAO21GXwkF+gV4IGTGTYSmafJGuinu+IT/1iAn/LUYDNryDD0CYgDjAMdT7hvTbEcdcT0FWKxPxX0ESwjLzDTL0JiTX80R7GILFly9BqMgGZduGVZBOCir9uK4oSu4nIUC5EziIJ9G08AQcuDHlge/Hg/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lgp0f5NTj/clHJ/iDK9xGIstouy1suiZl1L41kWcB9smXn7tlKPH+EBr0+a7ykcxrOjpkCU65sh/4+S3B+vDsCW/ZU61dBSS+C+sfEbAjlRA3UHN6WpagAsWHk0hDR/FNGvVPA43HQMWdR1LtqIJRAW35NKQeUmjLJ+7jwIeIEp3YyI1PPDCEbmYrd65YfXyJLAkk8ToyAZydF6N8UUU+YaEUSNfqx0LmutV8kqgYD97Asg81W0wH0hnLuRuLK2cjJdKSdTVREGWnrjFHbsqIPl5SlGAouzlOhWAwIXPRtxQ82jhUn760D00wXm2Ys7O0a5PcBWAL3vRdvxCV5vFAA==
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 05 Sep 2025 17:02:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 2025-09-05 12:52, Soham Dandapat wrote:
In mca_cap_init function,the mcabanks_alloc allocates and
initializes an mca_banks structure for managing MCA banks,
setting up a bank map and storing the specified or default number
of banks.

After this we will call mcabanks_set(i, mca_allbanks);
The mcabanks_set function sets a specific bit in the bank_map of
an mca_banks structure, provided the structure, its bank_map, and
the bit index are valid.

At the end, we will call
mcabanks_free(xchg(&mca_allbanks, all));
This function is thread safe and does below:
    1. Atomically exchanges the value of "mca_allbanks" with "all"
    2. Returns the old value that was previously in "mca_allbanks"
So, when we will call mcabanks_free , that will free the memory.

The problem is that mcabanks_set(i, mca_allbanks) function is updating
mca_allbanks which will be freed via mcabanks_free later. This means
new mca_allbanks instance("all") will never get chance to update
it's bank_map.

Due to this when we will collect log from mcheck_mca_logout function ,
the condition "if ( !mcabanks_test(i, bankmask) )" will always fails
and MCA logs will not be collected for any bank.

The fix is to solve this problem.

Fixes: 560cf418c845 ("x86/mcheck: allow varying bank counts per CPU")
Signed-off-by: Soham Dandapat <soham.dandapat@xxxxxxx>

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Maybe the patch subject should be "x86/mcheck: Fix mca bank initialization" to differentiate from the Fixes commit?

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.