On Thu, May 21, 2026 at 08:46:07AM -0700, Shameer Kolothum Thodi wrote:
> QEMU advertises 2 VCMDQs (CMDQV_NUM_CMDQ_LOG2=1).
> Guest allocates vcmdq0 only, leaves vcmdq1 unallocated, then on the
> direct aperture for vcmdq1:
> 
>   write 0x10 ->  A_VCMDQ1_PROD_INDX
>   read     A_VCMDQ1_PROD_INDX
> 
> If we aliased the direct aperture to the VINTF mmap, the write
> would physically hit VINTF Page 0 in HW at an unmapped logical
> slot. And the spec says(p.172):
> 
> " If no Virtual CMDQ is mapped to the Guest, or if the logical CMDQ index in 
> the Virtual Interface being accessed by the software does not map to any 
> Virtual
> CMDQ, the access is dropped with no Fault/Interrupt."
> 
> So even though guest is using the direct aperture, in turn it ends up
> accessing the corresponding vinf page0 and won't see whatever it wrote.
> 
> I think this contradicts spec p.176 where it says:
> 
> "While the software can program the Virtual CMDQ(s) directly using the
> direct VCMDQ aperture (and not through the Virtual Interface), it is
> required that the VCMDQ be allocated to a Virtual  Interface before it
> is used to send commands to the SMMU."
> 
> So the spec allows register programming through the direct aperture
> without requiring the VCMDQ to be allocated first.
> 
> @Nicolin: did I understand your earlier reasoning correctly here?

Yes.

Nicolin

Reply via email to