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

Re: [Xen-devel] [PATCH v3 10/14] AMD/IOMMU: allow enabling with IRQ not yet set up


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Woods, Brian" <Brian.Woods@xxxxxxx>
  • Date: Fri, 19 Jul 2019 18:38:42 +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=RUNztsdcvl8R5sMrdihEIgmkaKG7JJ+K/88cjEVRlN0=; b=hlrWmKH5kQCv+88tWlm6Th+kynQf0nPO2theQJshthuAtjGwgg9dTUX5OW6NJ1RS7KQAKDpHJN/blS/VXs/ZznJuXExbfKOgZiFRuVZ8mhLxbtG1AyP/fczE54AtSwLI8fJSHUF5suiWEHBkiswjAvjwL08FQejw5E7lD+TriXg31DR0UjZac+sXW777jmASilJAsmMnOSNsd9/KGP9m2mlE2ZF+yijl4DHQJvfZjvOXy+/cXxwcaQmfRJmD7w+6M0N3NC8Zt6M1imT4dbtz28mJmUhcmWKz6ziR/AYTWaH8hoITv783M1beVEiHZ3YmhCNXRtir8N3nRmKCW9zZoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KwVof2Bjm6Q/pn+bwdDqNXyG9PEnscGsMoJ2ZjMmczoTbIuoM+OrPzKupQj5zspWitXrPd+vtFhEs/rdGTJuRINhKsbLFHfXo1dOJZHsL7d4Dpirl9H0e7VY0knxcHhW93+zzz3wuwgmkUzD+X3Z8GFHtTxBH/JY9V4tl9aGnQj9mqTfqTlsqlId+RhZnEogupGR2RtYYuaw3wlQ6rNPfK+o4uz03uO9ObajLZSTZlQFVqf7aFnLF0WVKZWHMvtRdK1PhePgd6BLjS2HcGnWIi0a+54v6lp3xZyJE5DJwZZ6V0jmZM14UFi37zgTs4OmKLzYzOQQDlZZLVB82f+tuw==
  • 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: Fri, 19 Jul 2019 18:38:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/U8BV63KFRAsUK1NOH3w2KsA6bSSnKA
  • Thread-topic: [PATCH v3 10/14] AMD/IOMMU: allow enabling with IRQ not yet set up

On Tue, Jul 16, 2019 at 04:39:34PM +0000, Jan Beulich wrote:
> Early enabling (to enter x2APIC mode) requires deferring of the IRQ
> setup. Code to actually do that setup in the x2APIC case will get added
> subsequently.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

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

> ---
> v3: Re-base.
> 
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -814,7 +814,6 @@ static void amd_iommu_erratum_746_workar
>   static void enable_iommu(struct amd_iommu *iommu)
>   {
>       unsigned long flags;
> -    struct irq_desc *desc;
>   
>       spin_lock_irqsave(&iommu->lock, flags);
>   
> @@ -834,19 +833,27 @@ static void enable_iommu(struct amd_iomm
>       if ( iommu->features.flds.ppr_sup )
>           register_iommu_ppr_log_in_mmio_space(iommu);
>   
> -    desc = irq_to_desc(iommu->msi.irq);
> -    spin_lock(&desc->lock);
> -    set_msi_affinity(desc, NULL);
> -    spin_unlock(&desc->lock);
> +    if ( iommu->msi.irq > 0 )
> +    {
> +        struct irq_desc *desc = irq_to_desc(iommu->msi.irq);
> +
> +        spin_lock(&desc->lock);
> +        set_msi_affinity(desc, NULL);
> +        spin_unlock(&desc->lock);
> +    }
>   
>       amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
>   
>       set_iommu_ht_flags(iommu);
>       set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
> -    set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
>   
> -    if ( iommu->features.flds.ppr_sup )
> -        set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
> +    if ( iommu->msi.irq > 0 )
> +    {
> +        set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
> +
> +        if ( iommu->features.flds.ppr_sup )
> +            set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
> +    }
>   
>       if ( iommu->features.flds.gt_sup )
>           set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
> 

-- 
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®.