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

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


  • To: "Andryuk, Jason" <Jason.Andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Dandapat, Soham" <Soham.Dandapat@xxxxxxx>
  • Date: Mon, 8 Sep 2025 20:06:40 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=m98ee3vJ1r7l9MHJtQV/bgza4sKMbM4tmf/7OOM8wvI=; b=X5kjlXUYNLlpIj2BjN1c17fAv1FslerAxENx9KTF+LH+cqLqQWS14cQPEskKVL8QER68mwfoUa9B9j3OjCFP/2vAtvLfEXieX0Xo/pffEGFwiajiFXChkupZmLF0LsZdmUn1bl+kQ6L5be56Y2ClhfmwdteTmd++jAvrZSbuYMzQ8Rd1/MzHPad86IZnvF9bpulrQIYnKpEAibkZYB59WaNGQQKpr0TPytBsa8oK3Y1N2sPN9GNgHKgLA0RI3jvRrtO5gr8bwroyl5ojJem9uKix/yskuFowI5BJLacocoqRSvLCea0tBFXnaN+ck9h6OZhAFd1F/15lEW5c7KafDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GrurOpLctZ6fAFy9jnrkkiT0yPm9pS2ce5GZeyi/MAAVo1H+jxU9OeqVmm01iZzZh2lcUWLrpm7G4wVjmvtvZ2im2FLCzD2/fL4grAyfiyi7aEmUh+ZgmfIKyO3DJ8EbFAA96IIFyppAs1Ab5OEo2A0vaPnqRoge1lqVwpLPkTtyGtowGd0i8aEyUHH+vvC1vnRnZMuDcFgcPQT/CC/7CXtjca314koicYOxSe9pU3/o+dZVYpB96wgK7ny6Hj7Al0cMJGcr4WED+vIKlObr2lzWbCrcG+mz35kKG9e1HKgxq/0NJxJnSb0d1h4J6cRb/PqZoX0gom+QIze66KxCxg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 08 Sep 2025 20:07:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-09-08T20:04:27.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHcHoXdH9CZOm3Bdk+HDpewzgmH0bSE0JqAgAQyqwCAAEu9gIAAaWVg
  • Thread-topic: [PATCH] x86/mcheck: allow varying bank counts per CPU

[Public]

Hi Jan , Jason ,

Suggestion sounds good to me . I am ok with that .

Thanks,
Soham

-----Original Message-----
From: Jason Andryuk <jason.andryuk@xxxxxxx>
Sent: Monday, September 8, 2025 7:10 PM
To: Jan Beulich <jbeulich@xxxxxxxx>; Dandapat, Soham <Soham.Dandapat@xxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné 
<roger.pau@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
Subject: Re: [PATCH] x86/mcheck: allow varying bank counts per CPU

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®.