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

Re: [PATCH v2 08/18] IOMMU/x86: support freeing of pagetables


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 2 Dec 2021 17:03:56 +0100
  • 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=huTq0B8c+9emGBJtc4hecPo/BN72dZ43ec+/AEbYe2A=; b=A1dl3jh3oexz2u02kUBql3fUccVdtqOzCsWDVHejK09JHbflRWIbmVfT4rQrjJKwdLlIlsu3BM+NsxgttwWpJhCKP9jrZcANWsjOLNqe/pIkOIO5pKrJoJ6N4hHsZx99VbrjjqTDDhh2dvsiI7lQyuqEnedbhaIP+vUJ1HpsF01BuVyLIbY6ejrnOhf4PrO6tDeZagk7UyHIixPBp/QQt4YXZFEV+vZcSV2iXk3JeyWLGeZuR0LGmncW/hlzf7tI1Q19l7TxD4yyyLQfIjA2QiIuxNLW4R5ZCR/WG/toaCueKSBGt/Z3ynCnzzM2/b3fD8SjIrQPYaSfbDMDa3FyIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i3RxzlBFY/e8fvTVxyVf2mFJwSr6sReynhDmOe1wS7Jj5lbxHHHXDsWmkB5aCQydng79BIlWmrHzPiyhG6newSby0DCJAwB71EDY9bjP++h0QCsyJE6+3XOSF7SA+4AEwiyaDv/ZJRllDzANhrZOHwMvGq/KZnMJhpfA+w0x/SofObWke42GNvvQEsjuNGvdxsVNBpk9Vsn/4l9ykK4Vk1mJbV7Z3IdkqBVlOh8H+U7/LSWLAu/Elbi656Snz+JRmYKAwRfD55bePA+iMrUj8LttYgJe20934B4Z2O0ZUgaSpRFbyO22JctGU/NZWJOQWmNmz3AmkmdZeiVh7fiBXg==
  • Authentication-results: esa1.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>, Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 02 Dec 2021 16:04:24 +0000
  • Ironport-data: A9a23:9RWAPKhl/p0PlWL668a9lz4SX161jRcKZh0ujC45NGQN5FlHY01je htvWG7XPP7cYWT0KNAkYYy19B8O7J/Uzt8xTgJs+yoxEC4b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0F0/NtTo5w7Rg29Qw24Dja++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1/i66bTz8xb5Tcv98DThZdAhlsEpZJreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHxO4wSoDd4xCzxBvc6W5HTBa7N4Le02R9t150XTK+EN 6L1bxI/QE/wQRtCIW0sCaljrdyHtCageBxH/Qf9Sa0fvDGIkV0ZPKLWGMLcZ9iiVchT2EGCq Qru4GDREhwcctuFxlKt8Hihm+vOliPTQ58JGfuz8fsCqE2ewCkfBQMbUXO/oOKlkQiuVtRHM UsW9yEy668o+ySWosLVBkPi5iTe51hFBoQWQ7ZSBByxJrT80TirLW48Vm94ePsdq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1b pxN4hSYeeAaWSSVPyKgjWFLw==
  • Ironport-sdr: 3746URqyojUjmfs7YxvaEaobORD0RJSrMHFN5nViKj67OT+E3Ld0ldCYNPNWaFLQiZ1FdDqoet j0v6WjVZvrljGNWEmGDJ2+scoeZ7aXLdnT0JUrhhTfshcAj72WYCsxbTPoDzCZ+xtP7bm6rexN z2mep8qH2cou5pY7ebDDbvdkXBXTUnvEva0mKFE87njQxYFjnYvIDn6K1gaeFSM9oq20lVtln0 oRUmSwWPME78B7+W1JKlSTc+Amw8L0DqDxmP2IYB95JKpnjkoPCExTF4W/wGkhpY7e59zzd93/ pRp4j1M5Qz/Y13/8hGpsfRA3
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Sep 24, 2021 at 11:48:21AM +0200, Jan Beulich wrote:
> For vendor specific code to support superpages we need to be able to
> deal with a superpage mapping replacing an intermediate page table (or
> hierarchy thereof). Consequently an iommu_alloc_pgtable() counterpart is
> needed to free individual page tables while a domain is still alive.
> Since the freeing needs to be deferred until after a suitable IOTLB
> flush was performed, released page tables get queued for processing by a
> tasklet.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> I was considering whether to use a softirq-taklet instead. This would
> have the benefit of avoiding extra scheduling operations, but come with
> the risk of the freeing happening prematurely because of a
> process_pending_softirqs() somewhere.

Another approach that comes to mind (maybe you already thought of it
and discarded) would be to perform the freeing after the flush in
iommu_iotlb_flush{_all} while keeping the per pPCU lists.

That would IMO seem better from a safety PoV, as we know that the
flush has been performed when the pages are freed, and would avoid the
switch to the idle domain in order to do the freeing.

Thanks, Roger.



 


Rackspace

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