Re: [PATCH v2] cxl/mce: Avoid alias page retirement for corrected errors

[email protected]
Newsgroups org.kernel.vger.linux-cxl
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Bypassing CXL MCE handling for poison consumption errors on AMD architectures.
--

--- Patch [1]: [PATCH v2] cxl/mce: Avoid alias page retirement for corrected errors ---
commit efcb1cbc0f2e51e970d17decc010e02b84097870
Author: Shaikh Kamaluddin <[email protected]>

cxl/mce: Avoid alias page retirement for corrected errors

This commit restricts Extended Linear Cache (ELC) MCE handling to uncorrected
memory errors. It aims to prevent needlessly reducing usable memory on
corrected or non-memory errors.

> diff --git a/drivers/cxl/core/mce.c b/drivers/cxl/core/mce.c
> index 65fed913b2217..e3c561489a003 100644
> --- a/drivers/cxl/core/mce.c
> +++ b/drivers/cxl/core/mce.c
> @@ -18,7 +18,13 @@ static int cxl_handle_mce(struct notifier_block *nb, unsigned long val,
>  	u64 spa, spa_alias;
>  	unsigned long pfn;
>  
> -	if (!mce || !mce_usable_address(mce))
> +	if (!mce)
> +		return NOTIFY_DONE;
> +
> +	if (!mce_is_memory_error(mce) || mce_is_correctable(mce))
> +		return NOTIFY_DONE;

[Severity: High]
Does this new check bypass CXL MCE handling for poison consumption errors
on AMD architectures?

On AMD, mce_is_memory_error() maps to amd_mce_is_memory_error(), which
evaluates to true strictly for SMCA Unified Memory Controller (UMC) banks or
legacy northbridge banks.

When a CXL poison consumption error occurs, it is logged in the consuming core
unit (e.g., Load/Store or Data Fabric) with the MCI_STATUS_POISON bit set,
which is not a UMC bank. This means mce_is_memory_error() will evaluate to
false, causing this handler to return NOTIFY_DONE and silently skip offlining
the aliased page.

Previously, relying on mce_usable_address() correctly identified these errors
since amd_mce_usable_address() checks for the MCI_STATUS_POISON bit on all
non-northbridge banks. Could this lead to data corruption or repeated machine
checks when the corrupted memory is re-accessed?

> +
> +	if (!mce_usable_address(mce))
>  		return NOTIFY_DONE;
>  
>  	spa = mce->addr & MCI_ADDR_PHYSADDR;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.