On 09.12.2025 19:26, Andrew Cooper wrote:
> The hv_compat_vstart variable is hidden behind CONFIG_PV32 but lives in
> arch_domain. Moving it into pv_domain is an obvious improvement.
>
> The value however is less obvious, and a mess.
>
> In !PV32 builds, it's uniformly 0, but in PV32 builds it's ~0U (HVM guests),
> __HYPERVISOR_COMPAT_VIRT_START (PV guests), or custom (PV32 dom0). This seems
> to work because uses are guarded behind is_pv32_{domain,vcpu}().
>
> Simplify things by leaving it as 0 in PV32 builds for most domains,
> initialising it in only in switch_compat() when a domain becomes 32bit PV.
> dom0_construct() adjusts the value after calling switch_compat().
>
> Suggested-by: Grygorii Strashko <[email protected]>
> Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>