[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/18] IOMMU/x86: support freeing of pagetables
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 2 Dec 2021 17:10:38 +0100
- 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=CBbOQsBJIUhlgJqrZ8zkLK4TCyNi7tLVk7+u/4X6KrM=; b=VLEPphuAOIrp+otMxTmQw1DGO2ZYYDIpstyXJ/s/negFEJQL1aOZ2F6MfzZe+XRWJOJkCu21vYPFFE1UuQXRhsC/jBDngL1mhc312DK9c5Npp1IYUkrkTpQNUYrJhQ4+QB2EvhSuigjFeurS+C/M6D4ytE4GToq9xpud85GMLCE8iwmUkvs00mjrU3zZJxXmmp+QuQkGxzvm2lICD876ChfnmbI6c/CbvfNQnqF4sQ/ALHYuqfSfAI3fmmtb/6rRrk1c8b08mn8xqOc2VYpGfyVJWvqB6xxiWJ3mKlfV2Fi2UNQuByhO6iaZjVraRKKqRdMTeHs5u8qn44sIzGMm9w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cugkEtFzLIsS2xlQ3u2mxuQbBa1SVkO3tk9nIfEC1kHvFRGr5AwwfAMS1Nb2sZRBzuW0wyVuaNrwOaLM4DuJkvcQ/VOsEMf0+vuDETft2tiHxglaxdAsrjTCLUM9FqsdYYUiljCGxq+wfzyqQGB1HYWBO6caRffYQsV81+v+J8YljMdZDienTsuGbsWeNYAa9o6BfVP8K2fuDHUO83NCn8mTq+4vGK990n168Dy5m13KC8Mk1QmAWg9Mh/NAXfU7XzZYhQLWRH0Tt5OEutQIvN342bFr5MMcZIk7+gzgt0L0dZYVOvfczeoIYMIbE1TawE1MmSvRYKnM42m2QCIv8Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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:11:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 02.12.2021 17:03, Roger Pau Monné wrote:
> 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.
This was my initial plan, but I couldn't convince myself that the first
flush to happen would be _the_ one associated with the to-be-freed
page tables. ISTR (vaguely though) actually having found an example to
the contrary.
Jan
|