> -----Original Message-----
> From: Junjie Cao <[email protected]>
> Sent: Sunday, September 20, 2026 2:44 PM
> To: Manish Honap <[email protected]>
> Cc: [email protected]; Ankit Agrawal <[email protected]>; [email protected];
> [email protected]; [email protected]; Srirangan
> Madhavan <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> Krishnakant Jaju <[email protected]>; Vikram Sethi <[email protected]>; Zhi
> Wang <[email protected]>; [email protected]; qemu-
> [email protected]; [email protected]
> Subject: Re: [PATCH v2 07/10] hw/vfio/pci: Map the CXL memory on the
> guest decoder commit
>
> External email: Use caution opening links or attachments
>
>
> On Thu, 17 Sep 2026 00:14:09 +0530, Manish Honap wrote:
> > + * Record the base the guest programs into a decoder so the commit
> handler
> > + * can reject a base other than the device's CFMWS window. The
> > + base low
> [...]
> > + vdev->cxl.guest_base_lo = (uint32_t)data &
> VFIO_CXL_HDM_BASE_LOW_MASK;
> > + vdev->cxl.guest_base_written = true;
>
> This answered my v1 question for the kernel v4 FSM model. With v5
> (20/27) the kernel gives a live read-only view and leaves any write
> virtualization to the VMM, and what QEMU shows the guest is a committed,
> locked decoder at the window base. A locked decoder ignores a base write,
> but here it is recorded, and if it differs from the window base the next
> rescan
> unmaps while reads still return Committed at the window base. That is the
> mismatch the check was meant to prevent. A current Linux guest never writes
> a locked decoder, so it won't trip this.
>
> Is the guest-written base still meant to matter in this model? If not,
> guest_base_{lo,hi,written} can go.
>
> > + * The kernel runs the lock-on-commit FSM in the write above, so the
> > + * committed state is settled by now; a control write on any
> > + decoder can
>
> Stale now that the kernel no longer acts on the write?
Yes, you are right on both parts. I will drop guest_base_lo, guest_base_hi,
and guest_base_written together with the mismatch check and, reword
the control write comment to correctly match the code.
>
> Junjie