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

Re: [PATCH v4 13/21] IOMMU/x86: prefill newly allocate page tables


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 20 May 2022 13:13:28 +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=AKSeaHlzp1uOtHYT1aSDSk3o8Q4IC8Sv6L0kCrRoKHY=; b=UkRl4nLBVKek9cNeGAEoeFlwJBMnZoXObudOK5YJ28hqUbx40hZm53XKfAztVP5MpznTMlSLtQAaOAQ97tR3JXcjAv4H+XsBvGgZqOB8wEfFsGtwaRoVE7Mbj7b9Aa2v12c9CNvDgP/HJOBtOEuK93mV/7sTvjwUccFZOfxuzj3csIgtGevuK5cYvMOhyM3gF4N7KqP6K1lDJxK1i3nm4Pzh40oGNUYypnrn23r9O1aHfcUcaAQkajrco251EFd5Oe/8zPLJAV7xIaiIfEv5fO8CDz50GQV0BCzfTE5uuUCNYfFapeKxYVN87Rf0epUB5jRHqoYbDr4LP1eZRcoB3A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VlOLsP0sRKUdswaYY36+5zOxIqkPMN5BECiYoa0iY9gtNqCzdhGDbdyTFAGZcQWL+WdjkEAd5wa3XeAlVvUrbXYvdX2zu2UI8Cxy0BMFwhVvD6Ad6SYuepyZ7uyh7WW2KsyCIW0iqrTKJxkSlh6XgdY0vRGQnRmEU8Q7C0E7eNdD+Fb3CPbIkaJypKMIAqFLgW2zbRjo+pYiaAhWmwE0ICWqALIbN3nE56GKYwg0uOH3AOWWUyHBCqC1nBrEmwbUg40gWob2uukskcmFDM/Aaj1MscV9VSlascrXnOxwaVJNN+V37cXDkSAcJh53Q+l8JyQhz2PJXbiMfBNhuD/4Pg==
  • 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: Fri, 20 May 2022 11:13:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.05.2022 13:11, Jan Beulich wrote:
> On 20.05.2022 12:47, Roger Pau Monné wrote:
>> On Thu, May 19, 2022 at 02:12:04PM +0200, Jan Beulich wrote:
>>> On 06.05.2022 13:16, Roger Pau Monné wrote:
>>>> On Mon, Apr 25, 2022 at 10:40:55AM +0200, Jan Beulich wrote:
>>>>> --- a/xen/drivers/passthrough/amd/iommu_map.c
>>>>> +++ b/xen/drivers/passthrough/amd/iommu_map.c
>>>>> @@ -115,7 +115,19 @@ static void set_iommu_ptes_present(unsig
>>>>>  
>>>>>      while ( nr_ptes-- )
>>>>>      {
>>>>> -        set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
>>>>> +        ASSERT(!pde->next_level);
>>>>> +        ASSERT(!pde->u);
>>>>> +
>>>>> +        if ( pde > table )
>>>>> +            ASSERT(pde->ign0 == find_first_set_bit(pde - table));
>>>>> +        else
>>>>> +            ASSERT(pde->ign0 == PAGE_SHIFT - 3);
>>>>
>>>> I think PAGETABLE_ORDER would be clearer here.
>>>
>>> I disagree - PAGETABLE_ORDER is a CPU-side concept. It's not used anywhere
>>> in IOMMU code afaics.
>>
>> Isn't PAGE_SHIFT also a CPU-side concept in the same way?  I'm not
>> sure what's the rule for declaring that PAGE_SHIFT is fine to use in
>> IOMMU code  but not PAGETABLE_ORDER.
> 
> Hmm, yes and no. But for consistency with other IOMMU code I may want
> to switch to PAGE_SHIFT_4K.

Except that, with the plan to re-use pt_update_contig_markers() for CPU-
side re-coalescing, there I'd prefer to stick to PAGE_SHIFT.

Jan




 


Rackspace

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