On 06/02/2019 10:56, Jan Beulich wrote:
> @@ -1373,9 +1377,15 @@ static unsigned int sh_min_allocation(co
>  {
>      /*
>       * Don't allocate less than the minimum acceptable, plus one page per
> -     * megabyte of RAM (for the p2m table).
> +     * megabyte of RAM (for the p2m table, minimally enough for HVM's setting
> +     * up of slot zero and VMX's setting up of the LAPIC page), plus one for
> +     * HVM's 1-to-1 pagetable.

What is in slot 0?  Nothing comes to mind.

>       */
> -    return shadow_min_acceptable_pages(d) + (d->tot_pages / 256);
> +    return shadow_min_acceptable_pages(d) +
> +           max(d->tot_pages / 256,
> +               is_hvm_domain(d) ? CONFIG_PAGING_LEVELS + !!cpu_has_vmx * 2
> +                                : 0U) +

I'm not sure cpu_has_vmx is the right check here.  For one, there is a
series posted adding similar support for AMD, so this is going to be
stale shortly.

I'd err on the side of making it unconditional, but if you do want to be
as tight as possible, then cpu_has_vmx_apic_reg_virt is the correct
check for now.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to