On Thu, Feb 7, 2019 at 11:42 AM Jan Beulich <[email protected]> wrote: > > A previously bad situation has become worse with the early setting of > ->max_vcpus: The value returned by shadow_min_acceptable_pages() has > further grown, and hence now holds back even more memory from use for > the p2m. > > Make sh_min_allocation() account for all p2m memory needed for > shadow_enable() to succeed during domain creation (at which point the > domain has no memory at all allocated to it yet, and hence use of > d->tot_pages is meaningless). > > Also make shadow_min_acceptable_pages() no longer needlessly add 1 to > the vCPU count. > > Finally make the debugging printk() in shadow_alloc_p2m_page() a little > more useful by logging some of the relevant domain settings. > > Reported-by: Roger Pau Monné <[email protected]> > Signed-off-by: Jan Beulich <[email protected]> > Reviewed-by: Roger Pau Monné <[email protected]> > --- > v2: Drop cpu_has_vmx dependency (to cover future SVM code as well). > --- > TBD: The question of course is whether such an "exact" calculation isn't > a little risky going forward, the more that the regression here > wasn't found by osstest, because domains with sufficiently few > vCPU-s weren't affected, due to the 4Mb minimum allocation enforced > by shadow_enable()'s call to shadow_set_allocation(). I would, > however, question this enforcement of a static minimum as well - > shadow_one_bit_enable() doesn't do so, for example.
This whole thing could use some rationalization; but this will do for now I think: Acked-by: George Dunlap <[email protected]. _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
