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

Re: [PATCH v2 15/18] IOMMU/x86: prefill newly allocate page tables


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Dec 2021 16:24:20 +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=5j6m3dLNLPywJrdFr4gfP8MYpoFpIDzg+zstgRxf52A=; b=XW2x8KbHQl6gasW+bB8gxt7+FVfkGqjtcOqo9ab2plmeE+i6tPVdzX3eNaJzHFYsny7XWh7B4WwNzEuURD3DcENYISWgBvyuOCTzi5jKSn3Zo/Wa5Vy8tGn9TXXKnEzvGMzK52R6CE0+ONjLkHu8n4Y/pXhqN3WLvKfbprUUFBq3s2bGYqbPkKKh8Vn3p3kiRKEPSwp7IrJYJOenS6su8qBjeUjxaibs2iTmIlCIIzx0jxGirXc6b/sfs+Wlj060q++Rq5S9i8c1o3gG4zlIduDsfRlu2+sa4ShKtu2fi4aCs8xYhkehfDnnV7ucN8SWyg+7tCh20/JHTHYmGLOAMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=atse2+mdvbLOEpvr47T5MGbdlK45H1j+klyO9FlKzsDRj/7BG6nSQB1OXYhRmIdtJ9D7MX3PITN2403Ut56dsaHG4tS0AlpUiLvZdL8Sb2GbiA+ib0GTbnJmTckP7VNIgHNl0+wAGhZmFEARMVgqhmafi2uX3UMU+za7LcLcrZoeUQNAzsekbixTqY84fKmu9FTnLpTSZjLrclprlQR7c+pmkI4fEN51WLbQ5d3z/G+wpEpdnSq61nIjHa2fy1j5szF8rbSFg41ZD4DDpz3ptBdVo/JJ2Z5Xl0zNUGgZuvw41saJLNkfap21SPWfg5I56msVJKlq800se8WW1UPMtQ==
  • 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>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 14 Dec 2021 15:24:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.12.2021 16:17, Roger Pau Monné wrote:
> On Tue, Dec 14, 2021 at 04:10:28PM +0100, Jan Beulich wrote:
>> On 14.12.2021 16:06, Roger Pau Monné wrote:
>>> Forgot to comment.
>>>
>>> On Fri, Sep 24, 2021 at 11:54:58AM +0200, Jan Beulich wrote:
>>>> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
>>>> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
>>>> @@ -238,7 +238,7 @@ int amd_iommu_alloc_root(struct domain *
>>>>  
>>>>      if ( unlikely(!hd->arch.amd.root_table) )
>>>>      {
>>>> -        hd->arch.amd.root_table = iommu_alloc_pgtable(d);
>>>> +        hd->arch.amd.root_table = iommu_alloc_pgtable(d, 0);
>>>
>>> So root tables don't get markers setup...
>>>
>>>
>>>>          if ( !hd->arch.amd.root_table )
>>>>              return -ENOMEM;
>>>>      }
>>>> --- a/xen/drivers/passthrough/vtd/iommu.c
>>>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>>>> @@ -297,7 +297,7 @@ static uint64_t addr_to_dma_page_maddr(s
>>>>              goto out;
>>>>  
>>>>          pte_maddr = level;
>>>> -        if ( !(pg = iommu_alloc_pgtable(domain)) )
>>>> +        if ( !(pg = iommu_alloc_pgtable(domain, 0)) )
>>>
>>> ...likewise here.
>>
>> Yes. Plus quarantine domain's page tables also don't. Neither root
>> tables nor quarantine domain's are ever eligible for re-coalescing,
>> so there's no point having markers there.
> 
> Quarantine won't be coalesced anyway as the same mfn is repeated over
> all the entries, so it will never be a suitable candidate for
> coalescing?

Correct.

Jan




 


Rackspace

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