[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] x86/mem_sharing: Resolve mm-lock order violations when forking VMs with nested p2m

On 07.01.2021 14:23, Tamas K Lengyel wrote:
> Several lock-order violations have been encountered while attempting to fork
> VMs with nestedhvm=1 set. This patch resolves the issues.
> The order violations stems from a call to p2m_flush_nestedp2m being performed
> whenever the hostp2m changes. This functions always takes the p2m lock for the
> nested_p2m. However, with sharing the p2m locks always have to be taken before
> the sharing lock. To resolve this issue we avoid taking the sharing lock where
> possible (and was actually unecessary to begin with). But we also make
> p2m_flush_nestedp2m aware that the p2m lock may have already been taken and
> preemptively take all nested_p2m locks before unsharing a page where taking 
> the
> sharing lock is necessary.
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.