On 18.04.2025 16:18, Teddy Astie wrote:
> In current HVM mode, when a hypercall references a structure in guest memory,
> it is passed to the hypervisor as its "linear address" (e.g virtual address 
> for
> the x86 long mode).
> One of the caveats is that this linear address (GVA) is generally not directly
> usable by the Xen and needs to be translated from GVA to GPA then HPA. This
> implies a complex and potentially expensive lookup of the pagetables inside 
> the
> guest. This can be significant, especially if the P2M cannot use efficiently
> superpages (or with e.g XSA-304).
> 
> This proposal introduce a new mode where all addresses used for hypercalls are
> GPADDR instead of GVADDR, therefore, looking up the HPA related to this GPA
> only needs a P2M lookup and not looking through the inside-guest pagetables.
> 
> This mode is opt-in and must be enabled explicitely by the toolstack.

Which I view as a severe downside (leaving aside the PVH Dom0 aspect): This way
a guest needs to be converted all in one go. While doable, it'll be increasingly
risky with the size of the guest kernel code base.

A prior proposal of mine was to add an indicator to hypercall numbers (e.g. to
set the top bit there), to indicate which of the two models a particular
hypercall invocation uses.

Aiui Andrew had yet different (albeit also never spelled out) plans.

Jan


Reply via email to