From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Eric Auger <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org, "Fan Ni" <fan.ni@samsung.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
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>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH qemu v16 3/5] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl
Date: Tue, 1 Jul 2025 16:52:22 +0100 [thread overview]
Message-ID: <20250701165222.0000068f@huawei.com> (raw)
In-Reply-To: <128e59be-4038-4a19-8cca-3be3d6446e0e@redhat.com>
On Tue, 1 Jul 2025 17:34:36 +0200
Eric Auger <eric.auger@redhat.com> wrote:
> Hi Jonathan,
>
> On 6/25/25 6:19 PM, Jonathan Cameron via 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. This is a hole in the current
> > map so adding them here has no impact on placement of other memory regions
> > (tested with enough CPUs for GIC_REDIST2 to be in use.)
> >
> > The CFMWs are placed above the extended memmap. Note the confusing
> > existing variable highest_gpa is the highest_gpa that has been allocated
> > at a particular point in setting up the memory map.
> >
> > The cxl_devices_state.host_mr is provides a small space in which to place
> s/is//
Fixed. Thanks.
> > the individual host bridge register regions for whatever host bridges are
> > allocated via -device pxb-cxl on the command line. The existing dynamic
> > sysbus infrastructure is not reused because pxb-cxl is a PCI device not
> > a sysbus one but these registers are directly in the main memory map,
> > not the PCI address space.
> >
> > Only create the CEDT table if cxl=on set for the machine. Default to off.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> > @@ -1895,6 +1917,9 @@ static void virt_set_memmap(VirtMachineState *vms, int pa_bits)
> > if (device_memory_size > 0) {
> > machine_memory_devices_init(ms, device_memory_base, device_memory_size);
> > }
> > + vms->highest_gpa = cxl_fmws_set_memmap(ROUND_UP(vms->highest_gpa + 1,
> > + 256 * MiB),
> > + BIT_ULL(pa_bits)) - 1;
> in hw/cxl/cxl-host.c, there seems to be a loop on fw windows? I guess
> those windows only exist if cxl option is set. In the positive,
> highest_gpa will be changed only if the option is set, which is fine.
> Indeed we have requested_ipa_size = 64 - clz64(vms->highest_gpa). So we
> shall not modify this if cxl is not set.
>
> What I am a bit concerned with is that it"consumes" some high memory
> without making it explicit in extended_memmap. Shouldn't we book some
> dedicated space there? Sorry I am jumping very late in the review, maybe
> turning things worse & noisy :-( Eric
No problem with late review - whilst it looks late we had a several year
gap at one point in updating this series!
How much to book? It's effectively infinite much like device memory.
Would be odd to book the minimum which is 256MiB given any useful system
is going to have a lot more than that (they are usually a few TiB but
may be much larger than that).
Would a comment after
[VIRT_HIGH_PCIE_MMIO] = { 0x0, DEFAULT_HIGH_PCIE_MMIO_SIZE },
such as
/* Any CXL Fixed memory windows come here */
be enough?
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Eric Auger <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org, "Fan Ni" <fan.ni@samsung.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
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>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH qemu v16 3/5] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl
Date: Tue, 1 Jul 2025 16:52:22 +0100 [thread overview]
Message-ID: <20250701165222.0000068f@huawei.com> (raw)
In-Reply-To: <128e59be-4038-4a19-8cca-3be3d6446e0e@redhat.com>
On Tue, 1 Jul 2025 17:34:36 +0200
Eric Auger <eric.auger@redhat.com> wrote:
> Hi Jonathan,
>
> On 6/25/25 6:19 PM, Jonathan Cameron via 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. This is a hole in the current
> > map so adding them here has no impact on placement of other memory regions
> > (tested with enough CPUs for GIC_REDIST2 to be in use.)
> >
> > The CFMWs are placed above the extended memmap. Note the confusing
> > existing variable highest_gpa is the highest_gpa that has been allocated
> > at a particular point in setting up the memory map.
> >
> > The cxl_devices_state.host_mr is provides a small space in which to place
> s/is//
Fixed. Thanks.
> > the individual host bridge register regions for whatever host bridges are
> > allocated via -device pxb-cxl on the command line. The existing dynamic
> > sysbus infrastructure is not reused because pxb-cxl is a PCI device not
> > a sysbus one but these registers are directly in the main memory map,
> > not the PCI address space.
> >
> > Only create the CEDT table if cxl=on set for the machine. Default to off.
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> > @@ -1895,6 +1917,9 @@ static void virt_set_memmap(VirtMachineState *vms, int pa_bits)
> > if (device_memory_size > 0) {
> > machine_memory_devices_init(ms, device_memory_base, device_memory_size);
> > }
> > + vms->highest_gpa = cxl_fmws_set_memmap(ROUND_UP(vms->highest_gpa + 1,
> > + 256 * MiB),
> > + BIT_ULL(pa_bits)) - 1;
> in hw/cxl/cxl-host.c, there seems to be a loop on fw windows? I guess
> those windows only exist if cxl option is set. In the positive,
> highest_gpa will be changed only if the option is set, which is fine.
> Indeed we have requested_ipa_size = 64 - clz64(vms->highest_gpa). So we
> shall not modify this if cxl is not set.
>
> What I am a bit concerned with is that it"consumes" some high memory
> without making it explicit in extended_memmap. Shouldn't we book some
> dedicated space there? Sorry I am jumping very late in the review, maybe
> turning things worse & noisy :-( Eric
No problem with late review - whilst it looks late we had a several year
gap at one point in updating this series!
How much to book? It's effectively infinite much like device memory.
Would be odd to book the minimum which is 256MiB given any useful system
is going to have a lot more than that (they are usually a few TiB but
may be much larger than that).
Would a comment after
[VIRT_HIGH_PCIE_MMIO] = { 0x0, DEFAULT_HIGH_PCIE_MMIO_SIZE },
such as
/* Any CXL Fixed memory windows come here */
be enough?
next prev parent reply other threads:[~2025-07-01 15:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 16:19 [PATCH qemu v16 0/5] arm/virt: CXL support via pxb_cxl Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-06-25 16:19 ` [PATCH qemu v16 1/5] hw/cxl-host: Add an index field to CXLFixedMemoryWindow Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-07-01 15:50 ` Eric Auger
2025-06-25 16:19 ` [PATCH qemu v16 2/5] hw/cxl: Make the CXL fixed memory windows devices Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-06-25 16:19 ` [PATCH qemu v16 3/5] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-07-01 13:26 ` Eric Auger
2025-07-01 14:41 ` Jonathan Cameron
2025-07-01 14:41 ` Jonathan Cameron via
2025-07-01 15:03 ` Eric Auger
2025-07-01 15:34 ` Eric Auger
2025-07-01 15:52 ` Jonathan Cameron [this message]
2025-07-01 15:52 ` Jonathan Cameron via
2025-07-01 16:12 ` Eric Auger
2025-07-01 16:26 ` Jonathan Cameron
2025-07-01 16:26 ` Jonathan Cameron via
2025-06-25 16:19 ` [PATCH qemu v16 4/5] docs/cxl: Add an arm/virt example Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-07-01 15:42 ` Eric Auger
2025-06-25 16:19 ` [PATCH qemu v16 5/5] qtest/cxl: Add aarch64 virt test for CXL Jonathan Cameron
2025-06-25 16:19 ` Jonathan Cameron via
2025-06-26 2:33 ` Itaru Kitayama
2025-07-01 15:47 ` Eric Auger
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=20250701165222.0000068f@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alex.bennee@linaro.org \
--cc=eric.auger@redhat.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=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.