[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 05/39] xen/riscv: request a G-stage flush on vmenter when VMIDs are disabled





On 8/31/26 2:48 PM, Baptiste Le Duc wrote:
vmid_handle_vmenter() reports that no flush is needed when VMIDs are
unavailable (vmid=off, or hardware with no more than one VMID bit). Every
domain then runs under VMID 0 with nothing flushed in between, so as soon
as a hart runs more than one domain, a domain entered there can use the
G-stage translations left behind by the domain which ran before it.

Adjust the comment in p2m_handle_vmenter() accordingly: skipping the
VS-stage flush no longer relies on an old VMID not being reused, which
doesn't hold when there are no VMIDs to begin with.

While at it, spell the other early return as a bool literal.

Fixes: bff3b9ea4696 ("xen/riscv: introduce VMID allocation and manegement")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>


FWIW this comment and p2m_handle_vmenter() itself get dropped a few
patches later in "implement vCPU context switching", which folds the
VMID claim into p2m_ctxt_switch_to(). The fix survives there via the
need_flush check. Is this patch really needed?


I think yes as it is fixing current implementation of what we have in staging.

We could back to this topic after the discussion of "implement vCPU context switching" in the case someone will suggest better way to handle p2m context switch (probably without dropping of p2m_handle_vmenter().

~ Oleksii






 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.