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

Re: [PATCH 15/17] IOMMU: page table dumping adjustments


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Aug 2021 16:28:59 +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-SenderADCheck; bh=at8tJY4rlFeuURUMYSjVxXq1mLFE6bL+0bJrTSnVcZE=; b=QVUyuUjD9YFouM90eS+rjGhZVSswpQ1ZRVdHco6Rkvk+xTr/kodnnEGYDmQAMXM769yPkxTKsIPSh/YVl3vI1/Cs/16eQ4gLRar3IaAqDxLCwZQv9l3mSLugQbZ/wQ2Exx0fUFkLlVOlrGc63ICM41o3j+56RvFKDAhpBJjeq+0WeQPXKbmIBeUFO+3mz81mMUvUv0L2j9tYPfFnzFi27fhnSGs4R8JjHyyGwtC+A4x3Q/+iC5VIJ8lEEPMPsU2nDkjX2YdayFRumYwjilt8D2FFgiCn7ZvfYaFmjnncrRj1e+VctX0qI6AfzgnVojrqBtUaR1NRteCDwjG2q6gW4A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QgfyDVzT05d6tGWL6fAXUcwTYu3wbpDAJAtWvcyfnyDcq8qLsy891YKINQRCVhezS3L2LQy6AoT8SowRnO71FFqVArkpsQ+jfeWjEfd5eHQBj7M9RyBpoCKkwWHGRE5dbpaOa+iIxTvig/KsRd5RR4Nlg7WcMV1Mrr/N7/iRJmg1zakDFzKmfXJCuYGX5SYsM3dhnqtFkSbpIWVqzb8KaGSnVEOtARgK5XGX1j2jL0ybhcoJ+TVJZuxCA9jRg33HntMItSz0h9Ik1j0eF4250v5iLhyepkn6GTeiM2TOU7TY2rLa1jHuNomWt2hzIuwkZrhtlRnmk5Iq3HgkMPEKxg==
  • Authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 24 Aug 2021 14:29:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.08.2021 16:26, Jan Beulich wrote:
> For one none of the three IOMMU implementations on Arm specify a dumping
> hook. Generalize VT-d's "don't dump shared page tables" to cover for
> this.
> 
> Further in the past I was told that on Arm in principle there could be
> multiple different IOMMUs, and hence different domains' platform_ops
> pointers could differ. Use each domain's ops for calling the dump hook.
> (In the long run all uses of iommu_get_ops() would likely need to
> disappear for this reason.)
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Should have Cc-ed Kevin on this one as well; now added.

Jan

> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -640,12 +640,9 @@ bool_t iommu_has_feature(struct domain *
>  static void iommu_dump_page_tables(unsigned char key)
>  {
>      struct domain *d;
> -    const struct iommu_ops *ops;
>  
>      ASSERT(iommu_enabled);
>  
> -    ops = iommu_get_ops();
> -
>      rcu_read_lock(&domlist_read_lock);
>  
>      for_each_domain(d)
> @@ -653,7 +650,13 @@ static void iommu_dump_page_tables(unsig
>          if ( is_hardware_domain(d) || !is_iommu_enabled(d) )
>              continue;
>  
> -        ops->dump_page_tables(d);
> +        if ( iommu_use_hap_pt(d) )
> +        {
> +            printk("%pd sharing page tables\n", d);
> +            continue;
> +        }
> +
> +        dom_iommu(d)->platform_ops->dump_page_tables(d);
>      }
>  
>      rcu_read_unlock(&domlist_read_lock);
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -2835,12 +2835,6 @@ static void vtd_dump_page_tables(struct
>  {
>      const struct domain_iommu *hd = dom_iommu(d);
>  
> -    if ( iommu_use_hap_pt(d) )
> -    {
> -        printk(VTDPREFIX " %pd sharing EPT table\n", d);
> -        return;
> -    }
> -
>      printk(VTDPREFIX" %pd table has %d levels\n", d,
>             agaw_to_level(hd->arch.vtd.agaw));
>      vtd_dump_page_table_level(hd->arch.vtd.pgd_maddr,
> 
> 




 


Rackspace

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