On Thu, Jul 31, 2025 at 5:28 AM Petr Beneš <w1be...@gmail.com> wrote:
>
> From: Petr Beneš <w1be...@gmail.com>
>
> This commit introduces the ability to configure the maximum number of altp2m
> views for the domain during its creation. Previously, the limits were 
> hardcoded
> to a maximum of 10. This change allows for greater flexibility in environments
> that require more or fewer altp2m views.
>
> The maximum configurable limit for nr_altp2m on x86 is now set to
> MAX_NR_ALTP2M (which currently holds the MAX_EPTP value - 512). This cap is
> linked to the architectural limit of the EPTP-switching VMFUNC, which supports
> up to 512 entries. Despite there being no inherent need for limiting nr_altp2m
> in scenarios not utilizing VMFUNC, decoupling these components would 
> necessitate
> substantial code changes.
>
> xen_domctl_createdomain::altp2m is extended for a new field `nr`, that will
> configure this limit for a domain. Additionally, previous altp2m.opts value
> has been reduced from uint32_t to uint16_t so that both of these fields occupy
> as little space as possible.
>
> Accesses to the altp2m_p2m array are modified to respect the new nr_altp2m
> value. Accesses to the altp2m_(visible_)eptp arrays are unmodified, since
> these arrays always have fixed size of MAX_EPTP.
>
> Additional sanitization is introduced in the x86/arch_sanitise_domain_config
> to fix the altp2m.nr value to 10 if it is previously set to 0. This behavior
> is only temporary and immediately removed in the upcoming commit (which will
> disallow creating a domain with enabled altp2m with zero nr_altp2m).
>
> The reason for this temporary workaround is to retain the legacy behavior
> until the feature is fully activated in libxl.
>
> Also, arm/arch_sanitise_domain_config is extended to not allow requesting
> non-zero altp2ms.
>
> Signed-off-by: Petr Beneš <w1be...@gmail.com>
> Acked-by: Jan Beulich <jbeul...@suse.com>

For mem_access/mem_sharing bits:
Acked-by: Tamas K Lengyel <ta...@tklengyel.com>

Reply via email to