[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/PoD: defer nested P2M flushes
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 19 Oct 2021 14:59:54 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s3X1oRj1GZ0yX3GnlWRb/uo3ksPXk7NCfOQI2i8YbCU=; b=dSioBWjvPyNZ8wnfGWVNt5SJy55D2CaFXvWvDhfsgEwFOzUcRhX6UsN2M7GetbbyDo0Z8G7NKRMkqX9AzGrHkjOnOVMuOutHO7qK8XXX6vEsNTLGB3EwahurYLvOZtn3ZiTXTIxPlorfN4lM+ixYMaT8PsyMJVfHe0uvs//jBKmz0QopOXRXnvRYcDIal76ZEgAkQFZuqHtrI24m+ZTcl9n38MHduzNxwJPpJIOtJvqHhqYQnpnq2TDrnp2kdSf3empSOJVx4hMkPCitAyJHJRnxburGYuSqoz0dbF7qLi42xrvmuTc4DDJfTru1oYEw5HMiL14vYIMfLY1XNTTbjQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CExH5B6C5JQIyT3IWVJRiP1JaFERt2YODdHXcu+L3a8trlMLRkZp/i0Zffw7/2eyI+vReEQuAnfw39q+NaC4dWBJr17i/Y3D1ScB/Oel7ZUx+GVgnGgj/NJsgBR0vGbwLbOReqy5lAHrEG9v7me+46Ffw1C3jo/dAPasXFwI/HCP4gFnqDD7STS0mCq2UHXIHCEBC/bGjEEWpIxL46hw7Ms8r04AtZBBli+lScTaH7884ICPgqxQFDwxEPc4+q6CDUh7RWScXnA1FLcakOdz3qpNhfHkexd59WWMUvCWv+6XkAHH/r+8zuiKguu16PwXvOugeW0OizQNSAIJtN0wlw==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
- Delivery-date: Tue, 19 Oct 2021 13:00:34 +0000
- Ironport-data: A9a23:1x+jSKyDvmXoWvsF7HN6t+fgwSrEfRIJ4+MujC+fZmUNrF6WrkUDy WVLXGuOb/aNN2D1fI0gPYy1oBxUuZ7Vn4UxSABl+yAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnvopW1TYhSEUOZugH9IQM8aZfHAuLeNYYH1500s6w7do2tUAbeWRWGthh /uj+6UzB3f9s9JEGjp8B3Wr8U4HUFza4Vv0j3RmDRx5lAa2e0o9VfrzEZqZPXrgKrS4K8bhL wr1IBNVyUuCl/slIovNfr8W6STmSJaKVeSFoiI+t6RPHnGuD8H9u0o2HKN0VKtZt9mGt9Nty dROpJi3cxx3L/P0s/UcaQVdHRgraMWq+JefSZS+mcmazkmAeHrw2fR+SkoxOOX0+M4uXzsIr 6ZBbmlQMFbT3Ipaw5riIgVort4kI8TxepsWp1lrzC3DDOZgSpfGK0nPzYIFgWxr2JoRdRrYT 8cpMjpDdEyHWjZKZFo8Irtg2+SIqkCqJlW0r3rK/PFqsgA/1jdZwLXrddbYZNGObcFUhVqD4 HLL+XzjBRMXP8DZziCKmlqujOLSmSLwWKoJCaa1sPVthTWuKnc7UUNMEwHh+L/g1xD4C4k3x 1EoFjQGrrQz9U+6St7HREOp/kavrx8mR99eKrhvgO2S8Zb87wGcD2kCazdObt06qcM7LQAXO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Y+ds31x1WPGVXgzkL1XYANu6ceHcGIzWvVfICZf yhDtMsnUvYRUgq
- Ironport-sdr: 3Uyc+53rYmFPmdg9srWRkJxaUv1r3ZPPbHlZzqdOoDCOD+wIwxXHfi/jxpIX1o+RxIVXigMDiT Kv6VvHc4Tdt27ofIAE6Mq77ouuVY1nu0jsFtMJDS6sVSDdtbuCXS9rcPuZnxyogLBE19YG4NuC YF6d1z/ujxm9INBXeOVtqy1gYjzt1BGQKOZQ3QMCkdCNILmAT+qs0yMBFiWVNW7JjUPV99M/QN yMfl2KDHA+X0ikvRdD/ZMA3m8VJ/Xy/IdtrUESA0oZFqbkcgVjPysK/qi1cs7oPD/xfuVAYB3k QjseJnvfOv5kb5NcB70fdZUQ
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Oct 19, 2021 at 01:58:38PM +0200, Jan Beulich wrote:
> On 19.10.2021 12:41, Roger Pau Monné wrote:
> > On Mon, Oct 11, 2021 at 10:17:08AM +0200, Jan Beulich wrote:
> >> With NPT or shadow in use, the p2m_set_entry() -> p2m_pt_set_entry() ->
> >> write_p2m_entry() -> p2m_flush_nestedp2m() call sequence triggers a lock
> >> order violation when the PoD lock is held around it. Hence such flushing
> >> needs to be deferred. Steal the approach from p2m_change_type_range().
> >>
> >> Similarly for EPT I think ept_set_entry() -> ept_sync_domain() ->
> >> ept_sync_domain_prepare() -> p2m_flush_nestedp2m() is affected.
> >
> > I'm slightly worried by this path because it doesn't seem to
> > acknowledge defer_nested_flush.
>
> Oh, yes. Iirc I did look at that logic, write down the remark, and
> then forgot to add the conditional to ept_sync_domain_prepare().
> The interactions with the real (host) flush are kind of ugly there,
> though - we then further depend on the ->defer_flush / ->need_flush
> logic, which is EPT-only. But I think I've convinced myself that
> this ought to work out.
>
> > Maybe the flag should be checked by
> > p2m_flush_nestedp2m instead of leaving it to the callers?
>
> I'm not sure this would be a good idea, as there are more callers.
We should maybe add an ASSERT to p2m_flush_nestedp2m to make sure it's
not called with defer_nested_flush being set then, or else it's
possible for new callers of p2m_flush_nestedp2m to forget checking
defer_nested_flush.
Thanks, Roger.
|