From: Fan Ni <nifan.cxl@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
mst@redhat.com, linux-cxl@vger.kernel.org, linuxarm@huawei.com,
qemu-arm@nongnu.org,
"Yuquan Wang" <wangyuquan1236@phytium.com.cn>,
"Itaru Kitayama" <itaru.kitayama@linux.dev>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v13 1/5] hw/cxl-host: Add an index field to CXLFixedMemoryWindow
Date: Wed, 21 May 2025 16:59:31 +0000 [thread overview]
Message-ID: <aC4Gc7TMHHwuNGwl@smc-140338-bm01> (raw)
In-Reply-To: <20250513111455.128266-2-Jonathan.Cameron@huawei.com>
On Tue, May 13, 2025 at 12:14:51PM +0100, Jonathan Cameron wrote:
> To enable these to be found in a fixed order, that order needs
> to be known. This will later be used to sort a list of these
> structures that address map and ACPI table entries are predictable.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
Reviewed-by: Fan Ni <fan.ni@samsung.com>
> include/hw/cxl/cxl.h | 1 +
> hw/cxl/cxl-host.c | 9 ++++++---
> 2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h
> index 75e47b6864..b2bcce7ed6 100644
> --- a/include/hw/cxl/cxl.h
> +++ b/include/hw/cxl/cxl.h
> @@ -27,6 +27,7 @@
> typedef struct PXBCXLDev PXBCXLDev;
>
> typedef struct CXLFixedWindow {
> + int index;
> uint64_t size;
> char **targets;
> PXBCXLDev *target_hbs[16];
> diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c
> index e010163174..b7aa429ddf 100644
> --- a/hw/cxl/cxl-host.c
> +++ b/hw/cxl/cxl-host.c
> @@ -24,13 +24,15 @@
>
> static void cxl_fixed_memory_window_config(CXLState *cxl_state,
> CXLFixedMemoryWindowOptions *object,
> - Error **errp)
> + int index, Error **errp)
> {
> ERRP_GUARD();
> g_autofree CXLFixedWindow *fw = g_malloc0(sizeof(*fw));
> strList *target;
> int i;
>
> + fw->index = index;
> +
> for (target = object->targets; target; target = target->next) {
> fw->num_targets++;
> }
> @@ -325,14 +327,15 @@ static void machine_set_cfmw(Object *obj, Visitor *v, const char *name,
> CXLState *state = opaque;
> CXLFixedMemoryWindowOptionsList *cfmw_list = NULL;
> CXLFixedMemoryWindowOptionsList *it;
> + int index;
>
> visit_type_CXLFixedMemoryWindowOptionsList(v, name, &cfmw_list, errp);
> if (!cfmw_list) {
> return;
> }
>
> - for (it = cfmw_list; it; it = it->next) {
> - cxl_fixed_memory_window_config(state, it->value, errp);
> + for (it = cfmw_list, index = 0; it; it = it->next, index++) {
> + cxl_fixed_memory_window_config(state, it->value, index, errp);
> }
> state->cfmw_list = cfmw_list;
> }
> --
> 2.43.0
>
--
Fan Ni (From gmail)
next prev parent reply other threads:[~2025-05-21 17:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 11:14 [PATCH v13 0/5] arm/virt: CXL support via pxb_cxl Jonathan Cameron via
2025-05-13 11:14 ` [PATCH v13 1/5] hw/cxl-host: Add an index field to CXLFixedMemoryWindow Jonathan Cameron via
2025-05-16 5:44 ` Zhijian Li (Fujitsu) via
2025-05-21 16:59 ` Fan Ni [this message]
2025-08-08 8:29 ` wangyuquan
2025-08-08 8:44 ` Yuquan Wang
2025-05-13 11:14 ` [PATCH v13 2/5] hw/cxl: Make the CXL fixed memory windows devices Jonathan Cameron via
2025-05-16 5:44 ` Zhijian Li (Fujitsu) via
2025-05-21 17:54 ` Fan Ni
2025-05-27 16:04 ` Jonathan Cameron via
2025-05-13 11:14 ` [PATCH v13 3/5] hw/cxl-host: Allow split of establishing memory address and mmio setup Jonathan Cameron via
2025-05-16 5:50 ` Zhijian Li (Fujitsu) via
2025-05-27 16:28 ` Jonathan Cameron via
2025-05-13 11:14 ` [PATCH v13 4/5] hw/arm/virt: Basic CXL enablement on pci_expander_bridge instances pxb-cxl Jonathan Cameron via
2025-05-13 11:14 ` [PATCH v13 5/5] qtest/cxl: Add aarch64 virt test for CXL Jonathan Cameron via
2025-05-15 9:04 ` Itaru Kitayama
2025-05-19 12:54 ` Jonathan Cameron via
2025-05-20 20:38 ` Itaru Kitayama
2025-05-21 7:38 ` Itaru Kitayama
2025-05-21 17:52 ` Jonathan Cameron via
2025-05-21 22:07 ` Itaru Kitayama
2025-05-16 2:30 ` [PATCH v13 0/5] arm/virt: CXL support via pxb_cxl Itaru Kitayama
2025-05-16 6:34 ` Itaru Kitayama
2025-05-20 17:31 ` 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=aC4Gc7TMHHwuNGwl@smc-140338-bm01 \
--to=nifan.cxl@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=itaru.kitayama@linux.dev \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.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 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).