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

Re: [Xen-devel] [PATCH v4 11/12] AMD/IOMMU: don't needlessly log headers when dumping IRTs


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Woods, Brian" <Brian.Woods@xxxxxxx>
  • Date: Tue, 30 Jul 2019 16:36:51 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=amd.com;dmarc=pass action=none header.from=amd.com;dkim=pass header.d=amd.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=SRZmA1SvxK5+GPGuHBqigl25zP9izzggFHMZ/BNRMUM=; b=egS92RApTi9vPxMLI1sXVS2KWNJNF2i+IgDupP7MbMXFvxiFBuFVROytbnlKA5H1Ai2s+1m7ouzLp5rQAM8RzpLinatERUml4XYqPJCnOIWmCm54cBdVASJIvDbS9JN2ZP9txboPonMxs1sPCL2Av02O2PgSAlgtC47Bjzre+UZLhq7uoDUBKL7yz8Ju/5yfBAOzS0oh6SuWFyvGTqORFIxUZ33dP62MqLd5leOXbFqM5sBGs8o8xr/8jbjKSr2WTijmXpveg2l4xtzZnZ7EkJcxsn+yW4iZZItMkF2D+C14EBp6P/h0qEv/Pu+T5jk+baSmHsA0wBR5D/MAHsPaFA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BjL2SG5aLDFKAoUi5EXfUBfcULco1yKnFtYamJTZyYIvddX1SryiZS3QxfM+9VBR6ATaL2UWcMcUwxrt+GXfwr2DBWWbZy8yEd38uIEMSnXXEQ+0RWzzdC+EpzDXv53blkFHVYVf95uslZ/y24dYEp6YA2q7gPqJXqbzaN7U5n/Jca+WptjwrEgKmBNW2KgH5GsmrhRkZNnO5x8ApLnPq2zH/X5eeCYzm3dlD62dzsjtgxbt1wttHiQKXX5+8yc12Bd3VHq5Q9FeniW+3FvI2S3eq5qhKGMS0J8kzqO2bQh6wnr42iXVaK2Ivoe8RTxTMg5bg/Jfo3khwOF1rQKZNg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Woods@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Woods, Brian" <Brian.Woods@xxxxxxx>, "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Tue, 30 Jul 2019 16:36:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQu3vQWkQ4BW/m0a3zbmA7VKnu6bjZBoA
  • Thread-topic: [PATCH v4 11/12] AMD/IOMMU: don't needlessly log headers when dumping IRTs

On Thu, Jul 25, 2019 at 01:33:24PM +0000, Jan Beulich wrote:
> Log SBDF headers only when there are actual IRTEs to log. This is
> particularly important for the total volume of output when the ACPI
> tables describe far more than just the existing devices. On my Rome
> system so far there was one line for every function of every device on
> all 256 buses of segment 0, with extremely few exceptions (like the
> IOMMUs themselves).
> 
> Also only log one of the "per-device" or "shared" overall headers.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Brian Woods <brian.woods@xxxxxxx>

> ---
> v4: New.
> 
> --- a/xen/drivers/passthrough/amd/iommu_intr.c
> +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> @@ -883,7 +883,8 @@ int __init amd_setup_hpet_msi(struct msi
>   }
>   
>   static void dump_intremap_table(const struct amd_iommu *iommu,
> -                                union irte_cptr tbl)
> +                                union irte_cptr tbl,
> +                                const struct ivrs_mappings *ivrs_mapping)
>   {
>       unsigned int count;
>   
> @@ -892,19 +893,25 @@ static void dump_intremap_table(const st
>   
>       for ( count = 0; count < INTREMAP_ENTRIES; count++ )
>       {
> -        if ( iommu->ctrl.ga_en )
> -        {
> -            if ( !tbl.ptr128[count].raw[0] && !tbl.ptr128[count].raw[1] )
> +        if ( iommu->ctrl.ga_en
> +             ? !tbl.ptr128[count].raw[0] && !tbl.ptr128[count].raw[1]
> +             : !tbl.ptr32[count].raw )
>                   continue;
> +
> +        if ( ivrs_mapping )
> +        {
> +            printk("  %04x:%02x:%02x:%u:\n", iommu->seg,
> +                   PCI_BUS(ivrs_mapping->dte_requestor_id),
> +                   PCI_SLOT(ivrs_mapping->dte_requestor_id),
> +                   PCI_FUNC(ivrs_mapping->dte_requestor_id));
> +            ivrs_mapping = NULL;
> +        }
> +
> +        if ( iommu->ctrl.ga_en )
>               printk("    IRTE[%03x] %016lx_%016lx\n",
>                      count, tbl.ptr128[count].raw[1], 
> tbl.ptr128[count].raw[0]);
> -        }
>           else
> -        {
> -            if ( !tbl.ptr32[count].raw )
> -                continue;
>               printk("    IRTE[%03x] %08x\n", count, tbl.ptr32[count].raw);
> -        }
>       }
>   }
>   
> @@ -916,13 +923,8 @@ static int dump_intremap_mapping(const s
>       if ( !ivrs_mapping )
>           return 0;
>   
> -    printk("  %04x:%02x:%02x:%u:\n", iommu->seg,
> -           PCI_BUS(ivrs_mapping->dte_requestor_id),
> -           PCI_SLOT(ivrs_mapping->dte_requestor_id),
> -           PCI_FUNC(ivrs_mapping->dte_requestor_id));
> -
>       spin_lock_irqsave(&(ivrs_mapping->intremap_lock), flags);
> -    dump_intremap_table(iommu, ivrs_mapping->intremap_table);
> +    dump_intremap_table(iommu, ivrs_mapping->intremap_table, ivrs_mapping);
>       spin_unlock_irqrestore(&(ivrs_mapping->intremap_lock), flags);
>   
>       process_pending_softirqs();
> @@ -932,17 +934,22 @@ static int dump_intremap_mapping(const s
>   
>   static void dump_intremap_tables(unsigned char key)
>   {
> -    unsigned long flags;
> -
> -    printk("--- Dumping Per-dev IOMMU Interrupt Remapping Table ---\n");
> +    if ( !shared_intremap_table )
> +    {
> +        printk("--- Dumping Per-dev IOMMU Interrupt Remapping Table ---\n");
>   
> -    iterate_ivrs_entries(dump_intremap_mapping);
> +        iterate_ivrs_entries(dump_intremap_mapping);
> +    }
> +    else
> +    {
> +        unsigned long flags;
>   
> -    printk("--- Dumping Shared IOMMU Interrupt Remapping Table ---\n");
> +        printk("--- Dumping Shared IOMMU Interrupt Remapping Table ---\n");
>   
> -    spin_lock_irqsave(&shared_intremap_lock, flags);
> -    dump_intremap_table(list_first_entry(&amd_iommu_head, struct amd_iommu,
> -                                         list),
> -                        shared_intremap_table);
> -    spin_unlock_irqrestore(&shared_intremap_lock, flags);
> +        spin_lock_irqsave(&shared_intremap_lock, flags);
> +        dump_intremap_table(list_first_entry(&amd_iommu_head, struct 
> amd_iommu,
> +                                             list),
> +                            shared_intremap_table, NULL);
> +        spin_unlock_irqrestore(&shared_intremap_lock, flags);
> +    }
>   }
> 

-- 
Brian Woods

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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