Re: [PATCH 4/4 v4] cxl/test: Simulate an x86 Low Memory Hole for tests
From: Alison Schofield
Date: Wed Aug 20 2025 - 17:09:14 EST
On Thu, Jul 24, 2025 at 04:20:34PM +0200, Fabio M. De Francesco wrote:
> Simulate an x86 Low Memory Hole for the CXL tests by changing the first
> mock CFMWS range size to 768MB and the CXL Endpoint Decoder HPA range sizes
> to 1GB.
>
> The auto-created region of cxl-test uses mock_cfmws[0], therefore the LMH
> path in the CXL Driver will be exercised every time the cxl-test module is
> loaded. Executing unit test: cxl-topology.sh, confirms the region created
> successfully with a LMH.
>
> Since mock_cfmws[0] range base address is typically different from the one
> published by the BIOS on real hardware, the driver would fail to create and
> attach CXL Regions when it's run on the mock environment created by
> cxl-tests.
Can you add a unit test that in addition to confirming that the auto region
appears, (like cxl-topology.sh does) also verifies region and decoder
settings and address translations.
That is work I did in a prior review and I was remiss in not asking for
a unit test back then. I suspect it entails turning what you examine
during your testing into a unit test script. cxl-poison.sh shows how to send
clear-poison commands to validate address translations.
Related topic - if/when you get on real hardware with an LMH it would be
useful to collect address translation samples to add to the cxl-translate.sh
collection. (cxl-translate.sh is in review, not yet merged, see on the
mailing list)
snip