public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Anisa Su <anisa.su887@gmail.com>
To: Alireza Sanaee <alireza.sanaee@huawei.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com, berrange@redhat.com,
	eblake@redhat.com, jonathan.cameron@huawei.com,
	linux-cxl@vger.kernel.org, linuxarm@huawei.com,
	lizhijian@fujitsu.com, mst@redhat.com, pbonzini@redhat.com,
	gourry@gourry.net, nifan.cxl@gmail.com, me@linux.beauty
Subject: Re: [PATCH 5/9] hw/cxl: Map lazy memory backend after host acceptance
Date: Mon, 30 Mar 2026 01:24:54 -0700	[thread overview]
Message-ID: <acozVjvVT1THZP_S@4470NRD-ASU.ssi.samsung.com> (raw)
In-Reply-To: <20260325184259.366-6-alireza.sanaee@huawei.com>

On Wed, Mar 25, 2026 at 06:42:53PM +0000, Alireza Sanaee wrote:
> In the dc-regions-total-size flow, a requested extent is not backed when it
> is queued. It becomes usable only after the host accepts it with Add
> Dynamic Capacity Response.
> 
> Use that response path to look up the first pending group's metadata for
> each accepted extent, enable the selected host backend, and move the
> backend and fixed-window references onto the committed extent list. The
> accepted range is then marked backed just like the non-lazy path.
> 
> This wires host acceptance to the lazy backend lifecycle and leaves the
> fixed-window direct aliasing to the following patch.
> 
> Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
> ---
>  hw/cxl/cxl-mailbox-utils.c | 76 ++++++++++++++++++++++++++++++++++++--
>  1 file changed, 73 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
> index c5427adb3a..cc7be6e68c 100644
> --- a/hw/cxl/cxl-mailbox-utils.c
> +++ b/hw/cxl/cxl-mailbox-utils.c
[snip]
>  static CXLRetCode cxl_dcd_add_dyn_cap_rsp_dry_run(CXLType3Dev *ct3d,
>          const CXLUpdateDCExtentListInPl *in)
>  {
> @@ -3718,8 +3740,12 @@ static CXLRetCode cmd_dcd_add_dyn_cap_rsp(const struct cxl_cmd *cmd,
>      CXLUpdateDCExtentListInPl *in = (void *)payload_in;
>      CXLType3Dev *ct3d = CXL_TYPE3(cci->d);
>      CXLDCExtentList *extent_list = &ct3d->dc.extents;
> +    struct CXLFixedWindow *fw;
> +    HostMemoryBackend *hmb_dc;
> +    uint8_t tag[0x10];
>      uint32_t i, num;
>      uint64_t dpa, len;
> +    int rid;
>      CXLRetCode ret;
>  
>      if (len_in < sizeof(*in)) {
> @@ -3756,10 +3782,54 @@ static CXLRetCode cmd_dcd_add_dyn_cap_rsp(const struct cxl_cmd *cmd,
>      for (i = 0; i < in->num_entries_updated; i++) {
>          dpa = in->updated_entries[i].start_dpa;
>          len = in->updated_entries[i].len;
> +        if (ct3d->dc.total_capacity_cmd) {
               memcpy(tag, in->updated_entries[i], 0x10);
> +            bool found;
> +            MemoryRegion *mr;
> +
> +            found = cxl_extent_find_extent_detail(&ct3d->dc.extents_pending,
> +                                                  dpa, len, tag,
> +                                                  &hmb_dc, &fw, &rid);
> +
Btw, I'm using this patchset to test my current DCD RFC :) The main thing is I
want to test having multiple extents in the same add request for the new
requirements for tags on the host side. Since we can only add/remove tagged
capacity at once (no incremental add/partial release), would it be possible to
support that? Sorry I didn't have a look sooner

Thanks,
Anisa
 -- 
> 2.50.1 (Apple Git-155)
> 

  reply	other threads:[~2026-03-30  8:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 18:42 [QEMU PATCH 0/9] Application Specific Tagged Memory Support in CXL Type 3 Devices Alireza Sanaee
2026-03-25 18:42 ` [PATCH 1/9] hw/mem: Add tag support to generic host memory backends Alireza Sanaee
2026-03-26 10:42   ` Markus Armbruster
2026-03-26 11:29     ` Alireza Sanaee
2026-03-26 13:01       ` Markus Armbruster
2026-03-26 13:04         ` Alireza Sanaee
2026-03-25 18:42 ` [PATCH 2/9] hw/cxl: Allow initializing type3 device with no backing device Alireza Sanaee
2026-03-25 18:42 ` [PATCH 3/9] hw/cxl: Hook up tagged host memory backends at runtime for DC extents Alireza Sanaee
2026-03-25 18:42 ` [PATCH 4/9] hw/cxl: Carry backend metadata in DC extent records Alireza Sanaee
2026-03-25 18:42 ` [PATCH 5/9] hw/cxl: Map lazy memory backend after host acceptance Alireza Sanaee
2026-03-30  8:24   ` Anisa Su [this message]
2026-03-30 17:18     ` Anisa Su
2026-03-25 18:42 ` [PATCH 6/9] hw/cxl: Create direct fixed-window aliases for accepted extents Alireza Sanaee
2026-03-25 18:42 ` [PATCH 7/9] hw/cxl: Add release-time teardown for direct-mapped extents Alireza Sanaee
2026-03-25 18:42 ` [PATCH 8/9] hw/cxl: Add tag-based dynamic-capacity release support Alireza Sanaee
2026-03-30 18:03   ` Anisa Su
2026-03-31 14:53     ` Alireza Sanaee
2026-03-25 18:42 ` [PATCH 9/9] hw/cxl: Add QMP status query for dynamic-capacity extent release Alireza Sanaee
2026-03-26 15:15   ` Markus Armbruster
2026-03-27 15:18     ` Alireza Sanaee
2026-03-28  6:01       ` Markus Armbruster
2026-03-31 14:50         ` Alireza Sanaee
2026-04-01 11:39           ` Markus Armbruster

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=acozVjvVT1THZP_S@4470NRD-ASU.ssi.samsung.com \
    --to=anisa.su887@gmail.com \
    --cc=alireza.sanaee@huawei.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=gourry@gourry.net \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lizhijian@fujitsu.com \
    --cc=me@linux.beauty \
    --cc=mst@redhat.com \
    --cc=nifan.cxl@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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