From: "Dai WeiBin \(David Dai\)" <david.dai@montage-tech.com>
To: "'Dengcheng Zhu'" <dengcheng.zhu@gmail.com>,
<ben.widawsky@intel.com>, <dan.j.williams@intel.com>
Cc: <linux-cxl@vger.kernel.org>
Subject: RE: Access to CXL memory
Date: Tue, 18 May 2021 09:57:31 +0800 [thread overview]
Message-ID: <00b301d74b89$29f67760$7de36620$@montage-tech.com> (raw)
In-Reply-To: <CAOfQC9_aEmNKO2AmmX7JKwpZcj-HtMdoJBv+bH8qvbw0siTGOA@mail.gmail.com>
I understand BIOS will allocate system physical region for your CXL device when system enumeration.
Afterward BIOS writes the SPA to CXL base address register, meanwhile it also creates SRAT to Linux OS.
After OS handoff, OS sees a SRAT and a PCIe device, the PCIe device has CXL function.
So Linux kernel can parse SRAT table to get memory information and put it into Linux mem block as system RAM.
if the SRAT set the memory reserved, that means Linux buddy system doesn't manage it, so CXL device driver may read cxl base address register to get HPA and size, then map it as private managed memory.
Anyway, you must ensure only one master manages the memory, as well as only CXL type2/type3 has volatile memory which can be managed by host system or driver.
Thanks,
David
-----Original Message-----
From: Dengcheng Zhu (dengcheng.zhu@gmail.com) [mailto:dengcheng.zhu@gmail.com]
Sent: 2021年5月18日 2:51
To: ben.widawsky@intel.com; dan.j.williams@intel.com
Cc: linux-cxl@vger.kernel.org
Subject: Access to CXL memory
Hi,
I learned that CXL memory could be exposed to the system as a NUMA
node as well as an mmap()able device.
Two questions are:
- Can these 2 forms coexist at the same time?
- If yes, how does memory management work between these 2 interfaces?
Please shed some light upon this issue.
Thanks,
Dengcheng
prev parent reply other threads:[~2021-05-18 2:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 18:51 Access to CXL memory Dengcheng Zhu
2021-05-18 1:57 ` Dai WeiBin (David Dai) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00b301d74b89$29f67760$7de36620$@montage-tech.com' \
--to=david.dai@montage-tech.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dengcheng.zhu@gmail.com \
--cc=linux-cxl@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox