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

Baptiste Le Duc <[email protected]>
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <1788180504.8631fc262581453bbf619ec5b2062170.1a057dd2094000c4f3@vates.tech>
> 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 <[email protected]>
>

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?

-- 
Baptiste Le Duc <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.