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

Re: [PATCH] x86/PoD: defer nested P2M flushes


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 19 Oct 2021 13:58:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=wgyosl3QygnUlkHnRHQyRCmYyM6G4bogLBtPNqF/C+c=; b=GOsfBdvQNetY/1IMeGM67240mCYsatjuMpLqPCJDQKJufCi0treUlo4/2HqL/f67RtmpG3/feP0InRtkYX3riyG3McX9H3BRgQiYBilnqvWBIPSmbZ3inv7vdo4/gO9fQm5qAdRzqJdrytpk2fPWKsPIaLa8BLQQjB4Gu6acGC5HRBshMFjSnYOyG38gdO4YnLQUT9FQTr0g2zyMCt1OEtyzToylrrVdfjtuMlKkE3Qvf6KKLAxLFJ3W9Q3PIrXORubBCv3WjefocYWNB0YR/U6sW5uXFptELoYC9tvHuxYaL4jiPGTZzrRBSbfcnaDeF3ANoVqWEYUj/9KcoKHp7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j85tR9HGhBnQWOeBcNcMSMW2y3WSoWhl/pYtpu+J/2tYSMusjitli+zf0uI8hFmf5JE8t+Vitb5Mcs/A6/NHzTwqAs+hf91ty7IHu3Hthpc+F9Cxi7Lvvvc6awvbzR2QUrj1xqo5m9XSnC+VsQ0by0XjFnL/NOseeXKorXhVYN8Li7nS28ghm5xyE0MdNPsw5PPxSzHmppiVetTRHQ1QFslLTlbb4sWEPsqOw1kRsZu68ey7lLMenrpvHAHL5ndwsVyIZaC1Oci0m1xqr1OhcX5aatIsrDEVdccAqsAw1IzPFd0CDRybEBkyAThVIAOaGFIA3DfrSxCJQ8wpQBHKew==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Tue, 19 Oct 2021 11:58:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Jan




 


Rackspace

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