All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Tamas K Lengyel <tamas.lengyel@intel.com>
Cc: "Tamas K Lengyel" <tamas@tklengyel.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] x86/mem_sharing: Resolve mm-lock order violations when forking VMs with nested p2m
Date: Thu, 7 Jan 2021 14:55:35 +0100	[thread overview]
Message-ID: <355cf640-6027-816d-70c5-9a4ed445eb9c@suse.com> (raw)
In-Reply-To: <253be1190a5cdc452611b3741d852d1c7d2bc8d4.1610025394.git.tamas.lengyel@intel.com>

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@intel.com>

Acked-by: Jan Beulich <jbeulich@suse.com>


  reply	other threads:[~2021-01-07 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 13:23 [PATCH v2] x86/mem_sharing: Resolve mm-lock order violations when forking VMs with nested p2m Tamas K Lengyel
2021-01-07 13:55 ` Jan Beulich [this message]
2021-01-07 13:57   ` Tamas K Lengyel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=355cf640-6027-816d-70c5-9a4ed445eb9c@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=tamas.lengyel@intel.com \
    --cc=tamas@tklengyel.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.