From: Peter Maydell <peter.maydell@linaro.org>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: qemu-devel@nongnu.org, "Fan Ni" <fan.ni@samsung.com>,
mst@redhat.com, "Zhijian Li" <lizhijian@fujitsu.com>,
"Itaru Kitayama" <itaru.kitayama@linux.dev>,
linuxarm@huawei.com, linux-cxl@vger.kernel.org,
qemu-arm@nongnu.org,
"Yuquan Wang" <wangyuquan1236@phytium.com.cn>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alireza Sanaee" <alireza.sanaee@huawei.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v15 3/4] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl
Date: Fri, 13 Jun 2025 17:07:24 +0100 [thread overview]
Message-ID: <CAFEAcA9dHc8werChGk_HzXWsxqv1E4==iDPxRtCmPe9Ndr7nmA@mail.gmail.com> (raw)
In-Reply-To: <20250613162054.000003cf@huawei.com>
On Fri, 13 Jun 2025 at 16:20, Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> On Fri, 13 Jun 2025 13:57:39 +0100
> Peter Maydell <peter.maydell@linaro.org> wrote:
>
> > On Thu, 12 Jun 2025 at 14:45, Jonathan Cameron
> > <Jonathan.Cameron@huawei.com> wrote:
> > >
> > > Code based on i386/pc enablement. The memory layout places space for 16
> > > host bridge register regions after the GIC_REDIST2 in the extended memmap.
> > > The CFMWs are placed above the extended memmap.
> > >
> > > Only create the CEDT table if cxl=on set for the machine.
> > >
> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > >
> > > ---
> > > v15: No changes.
> > > ---
> > > include/hw/arm/virt.h | 4 ++++
> > > hw/arm/virt-acpi-build.c | 34 ++++++++++++++++++++++++++++++++++
> > > hw/arm/virt.c | 29 +++++++++++++++++++++++++++++
> > > 3 files changed, 67 insertions(+)
> >
> Hi Peter,
>
> Thanks for reviewing.
>
> > Can we have some user-facing documentation, please?
> > (docs/system/arm/virt.rst -- can just be a brief mention
> > and link to docs/system/devices/cxl.rst if you want to put the
> > examples of aarch64 use in there.)
>
> Given the examples should look exactly like those for x86/pc, do we need
> extra examples in cxl.rst? I guess I can add one simple arm/virt example
> in a follow up patch without bloating that file too badly..
That's fine too -- if the answer is "all these command lines work
for aarch64 too", then you can just say that in cxl.rst.
> Is the following sufficient for the board specific docs?
>
> diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
> index 6a719b9586..10cbffc8a7 100644
> --- a/docs/system/arm/virt.rst
> +++ b/docs/system/arm/virt.rst
> @@ -31,6 +31,7 @@ Supported devices
> The virt board supports:
>
> - PCI/PCIe devices
> +- CXL Fixed memory windows, root bridges and devices.
> - Flash memory
> - Either one or two PL011 UARTs for the NonSecure World
> - An RTC
> @@ -189,6 +190,14 @@ ras
> acpi
> Set ``on``/``off``/``auto`` to enable/disable ACPI.
>
> +cxl
> + Set ``on``/``off`` to enable/disable CXL. More details in
> + :doc:`../devices/cxl`. The default is off.
> +
> +cxl-fmw
> + Array of CXL fixed memory windows describing fixed address routing to
> + target CXL host bridges. See :doc:`../devices/cxl`.
> +
> dtb-randomness
> Set ``on``/``off`` to pass random seeds via the guest DTB
> rng-seed and kaslr-seed nodes (in both "/chosen" and
Looks OK.
> >
> > > @@ -220,6 +223,7 @@ static const MemMapEntry base_memmap[] = {
> > > static MemMapEntry extended_memmap[] = {
> > > /* Additional 64 MB redist region (can contain up to 512 redistributors) */
> > > [VIRT_HIGH_GIC_REDIST2] = { 0x0, 64 * MiB },
> > > + [VIRT_CXL_HOST] = { 0x0, 64 * KiB * 16 }, /* 16 UID */
> >
> > This is going to shuffle the memory map around, even if CXL
> > isn't enabled, which will break migration compatibility.
> > You need to do something to ensure that the CXL region isn't
> > included in the calculations of the base addresses for these
> > regions if CXL isn't enabled.
> >
>
> It doesn't move any existing stuff because these are naturally aligned
> regions so this is in a gap before the PCIE ECAM region.
Is that true even when we have the maximum number of CPUs and
so the max number of redistributors in that VIRT_HIGH_GIC_REDIST2
region ?
> > > [VIRT_HIGH_PCIE_ECAM] = { 0x0, 256 * MiB },
> > > /* Second PCIe window */
> > > [VIRT_HIGH_PCIE_MMIO] = { 0x0, DEFAULT_HIGH_PCIE_MMIO_SIZE },
> >
> > If you're OK with having the CXL host region at the end of the
> > list then that's a simpler way to avoid its presence disturbing
> > the layout of the existing regions, but you might not like it
> > being at such a high physaddr.
>
> From what I recall a higher address isn't a problem I just wanted to not waste any
> PA space at all so used the gap.
>
> Chunk of /proc/iomem with a random test case (in first case with the cxl bits
> removed as obvious that doesn't start until this patch is in place).
> Need more than 123 cpus to make the second gicv3 redist appear
> (I've no idea why that number I just printed the threshold where
> it was calculated to find out what I needed to wait for boot on).
It's 123 because that's the most redistributors we can fit into
the lower redistributor region. (We didn't really allow enough
space in the lower memory map, which is why we need this awkward
split setup.
(I have to run now, will look at the rest of the email next week.)
-- PMM
next prev parent reply other threads:[~2025-06-13 16:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 13:43 [PATCH v15 0/4] arm/virt: CXL support via pxb_cxl Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 1/4] hw/cxl-host: Add an index field to CXLFixedMemoryWindow Jonathan Cameron via
2025-06-13 2:09 ` Zhijian Li (Fujitsu) via
2025-06-12 13:43 ` [PATCH v15 2/4] hw/cxl: Make the CXL fixed memory windows devices Jonathan Cameron via
2025-06-13 2:09 ` Zhijian Li (Fujitsu) via
2025-06-13 12:33 ` Peter Maydell
2025-06-13 13:09 ` Jonathan Cameron via
2025-06-13 16:08 ` Peter Maydell
2025-06-13 17:17 ` Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 3/4] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl Jonathan Cameron via
2025-06-13 12:57 ` Peter Maydell
2025-06-13 15:20 ` Jonathan Cameron via
2025-06-13 16:07 ` Peter Maydell [this message]
2025-06-13 17:21 ` Jonathan Cameron via
2025-06-25 16:08 ` Jonathan Cameron via
2025-06-12 13:43 ` [PATCH v15 4/4] qtest/cxl: Add aarch64 virt test for CXL Jonathan Cameron via
2025-06-12 22:02 ` Itaru Kitayama
2025-06-13 12:32 ` Peter Maydell
2025-06-13 17:16 ` Jonathan Cameron via
2025-06-12 16:04 ` [PATCH v15 0/4] arm/virt: CXL support via pxb_cxl Peter Maydell
2025-06-12 16:33 ` Jonathan Cameron via
2025-06-13 5:07 ` Itaru Kitayama
2025-06-13 15:47 ` Jonathan Cameron via
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='CAFEAcA9dHc8werChGk_HzXWsxqv1E4==iDPxRtCmPe9Ndr7nmA@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=alex.bennee@linaro.org \
--cc=alireza.sanaee@huawei.com \
--cc=fan.ni@samsung.com \
--cc=itaru.kitayama@linux.dev \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lizhijian@fujitsu.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyuquan1236@phytium.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).