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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Soham Dandapat <Soham.Dandapat@xxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 8 Sep 2025 09:39:41 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=temperror 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=u03ZaRyk2iNmWtEBJ5W6eTxBCizcl+7Kw5AqzdepHzA=; b=eaxU99lyiedyFlutxm014HnoqSHglqD2xaeW7fI5R1hZX/Fz1Qv9qHyMFcoBx7bSNQVlILzaTb4Mh4q6A8mgERTBX7YDwXtgdwJIw3VeXTwp72qVoGXBxEWby0s9wu9WrvgzH0zOhgTowNoBcjv3Y1uHlmhSFzRLn+WFLPzvOFbkDf6wEQ9MtHgwDAiEKlEYKfYB7oDNujlSdPOF5R2OXbexPnrn015FUapm9/4iA825CPlGoU89d0yAEuaM+npJX5in5LZ0XE1CSTau4GWQH8bNBVaGwoRjsXCulrsw0ygBwhi6nQBHN+mXh+xb3aZ7vfZQSK7tiRglyCuyahktaA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wc0/sOH8Mqt7iBi8p3JGK521OAWo/21FS0rMkrIkJ6ohdcIFC12ck379bOAi/EgcYT7QjmC+2ByZpIsyrk8MXzdYvFcqAaSlqEwIhdR4DbEUmO5cDQmH7xQHYSyr+nVV2sPI74PX2n1f08gwyHo1yrPxdMECbFTaEVMZpVTe8+vRBgVuXQmC9SyiUJxdj6jDyvtiGGJPgCgzoih+JBrMCTHWJ+UZ5B1h9iSBGBy866fPAQegCYWl9/2cJrELOn8TpRuvwGSQ+U9NjI7mH6BvzRQ8YPRGGTdyHsTI6kASq2r0rVxODfH0jqcYsxpdUNPOb/TTUdduN9McvaP0JqfT6w==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 08 Sep 2025 13:40:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-09-08 05:08, Jan Beulich wrote:
On 05.09.2025 19:02, Jason Andryuk wrote:


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?

That's still more generic than wanted. How about "x86/mcheck: fix
mca_allbanks updating"? With a more concise title (which can be
adjusted while committing, so long as there's agreement):
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Your suggestion sounds good to me.

Thanks,
Jason



 


Rackspace

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