Linux CXL
 help / color / mirror / Atom feed
* Assistance Needed with CXL Memory Region Creation
@ 2025-01-07  2:21 Yasunori Gotou (Fujitsu)
  2025-01-16 11:13 ` Yasunori Gotou (Fujitsu)
  0 siblings, 1 reply; 6+ messages in thread
From: Yasunori Gotou (Fujitsu) @ 2025-01-07  2:21 UTC (permalink / raw)
  To: 'Dan Williams', 'linux-cxl@vger.kernel.org'
  Cc: Yasunori Gotou (Fujitsu)

Hello,

I hope this message finds you well. I have a question regarding the use of CXL memory based
on the v2.0 specification, and I would appreciate any assistance you can provide.

I recently acquired a real machine equipped with actual CXL memory, and I'm attempting to
create a region using the "cxl create-region" command.
However, I encountered an issue where the command returns an ERANGE error.
Upon investigation, I discovered that the get_free_mem_region() function in kernel/resource.c
is returning this error.

It seems that the function is unable to allocate an area from CXL Window 0 due to it being "Soft Reserved."
Below is the relevant section from /proc/iomem:
====
89d500000-89fffffff : Reserved
8a0000000-189fffffff : CXL Window 0
  8a0000000-189fffffff : Soft Reserved  ------!!!!
fd00000000-fd03ffffff : Reserved
=====

In contrast, when using a QEMU CXL emulation environment, there are no resources under CXL Window 0, 
allowing get_free_mem_region() to succeed and enabling region creation:
=====
100000000-47fffffff : System RAM
a90000000-e8fffffff : CXL Window 0 <--- there is no resource.
ec0000000-bfffffffff : PCI Bus 0000:00
c000000000-c00000ffff : PCI Bus 0000:0c
=====

From my understanding, the Soft Reserved area originates from EFI_MEMORY_SP. 
Additionally, the CXL Memory Device SW Guide Rev1.1(*) says the followings
---
The only cases where it is recommended to omit the EFI_MEMORY_SP attribute are those
where the system contains exclusively CXL memory, or where CXL memory is interleaved
with DDR memory or where the CXL memory is required to boot.
----
Therefore I think this /proc/iomem map is natural for the real machine.
And, I expected a region to be created from the Soft Reserved area, but the actual behavior differs.

I'm confused why the kernel/driver rejects creating a region in the Soft Reserved area, and I have
many questions.

1. Is this behavior is intended?
2. If so, what steps are necessary to create a region in the Soft Reserved area?
3. Alternatively, is the Soft Reserved area not meant for region creation?

(*)https://cdrdv2-public.intel.com/643805/643805_CXL_Memory_Device_SW_Guide_Rev1_1.pdf

Thanks,
---
Yasunori Goto


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-03 10:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07  2:21 Assistance Needed with CXL Memory Region Creation Yasunori Gotou (Fujitsu)
2025-01-16 11:13 ` Yasunori Gotou (Fujitsu)
2025-01-16 18:26   ` Dan Williams
2025-01-17  7:00     ` Yasunori Gotou (Fujitsu)
2025-02-03 10:08       ` Yasunori Gotou (Fujitsu)
2025-01-23  9:56     ` Zhijian Li (Fujitsu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox