Sorry for disturbing! I tried to test send more than 10 emails on my smtp server!
> -----原始邮件----- > 发件人: wangyuquan <wangyuquan1...@phytium.com.cn> > 发送时间:2025-08-08 16:29:57 (星期五) > 收件人: tangtao1...@phytium.com.cn, qemu-devel@nongnu.org, "Fan Ni" > <fan...@samsung.com>, "Peter Maydell" <peter.mayd...@linaro.org>, > m...@redhat.com > 抄送: "Jonathan Cameron" <jonathan.came...@huawei.com>, > linux-...@vger.kernel.org, linux...@huawei.com, qemu-...@nongnu.org, "Yuquan > Wang" <wangyuquan1...@phytium.com.cn>, "Itaru Kitayama" > <itaru.kitay...@linux.dev>, "Philippe Mathieu-Daudé" <phi...@linaro.org> > 主题: [PATCH v13 1/5] hw/cxl-host: Add an index field to CXLFixedMemoryWindow > > From: Jonathan Cameron <jonathan.came...@huawei.com> > > 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.came...@huawei.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; > } 信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息。 Information Security Notice: The information contained in this mail is solely property of the sender's organization.This mail communication is confidential.Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.