[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH0PR21MB30257943986E96BAF8F925ADD7949@PH0PR21MB3025.namprd21.prod.outlook.com>
Date: Tue, 26 Jul 2022 03:34:16 +0000
From: "Michael Kelley (LINUX)" <mikelley@...rosoft.com>
To: Randy Dunlap <rdunlap@...radead.org>,
Stephen Hemminger <sthemmin@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
"joro@...tes.org" <joro@...tes.org>,
"will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>,
"samuel@...lland.org" <samuel@...lland.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"tsbogend@...ha.franken.de" <tsbogend@...ha.franken.de>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>
Subject: RE: [PATCH 1/1] iommu/hyper-v: Use helper instead of directly
accessing affinity
From: Randy Dunlap <rdunlap@...radead.org> Sent: Monday, July 25, 2022 7:39 PM
>
> On 7/25/22 17:53, Michael Kelley wrote:
> > Recent changes to solve inconsistencies in handling IRQ masks #ifdef
> > out the affinity field in irq_common_data for non-SMP configurations.
> > The current code in hyperv_irq_remapping_alloc() gets a compiler error
> > in that case.
> >
> > Fix this by using the new irq_data_update_affinity() helper, which
> > handles the non-SMP case correctly.
> >
>
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
Indeed. Apologies for omitting this originally.
> > Signed-off-by: Michael Kelley <mikelley@...rosoft.com>
> Tested-by: Randy Dunlap <rdunlap@...radead.org>
> Acked-by: Randy Dunlap <rdunlap@...radead.org>
>
> Thanks.
This patch needs to go through the same tree as Samuel Holland's earlier
patch set to solve inconsistencies in handling IRQ masks on SMP and
non-SMP configs. From what I can tell, that's the irq/irqchip-next tree.
FWIW, it appears there's another occurrence of this same kind of
problem in arch/mips/sgi-ip27/ip27-irq.c where the "affinity" field
is referenced without an #ifdef CONFIG_SMP. Copying the MIPS maintainer
and mailing list -- this one is out of my scope to fix.
Michael
>
> > ---
> > drivers/iommu/hyperv-iommu.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
> > index 51bd66a..e190bb8 100644
> > --- a/drivers/iommu/hyperv-iommu.c
> > +++ b/drivers/iommu/hyperv-iommu.c
> > @@ -68,7 +68,6 @@ static int hyperv_irq_remapping_alloc(struct irq_domain
> *domain,
> > {
> > struct irq_alloc_info *info = arg;
> > struct irq_data *irq_data;
> > - struct irq_desc *desc;
> > int ret = 0;
> >
> > if (!info || info->type != X86_IRQ_ALLOC_TYPE_IOAPIC || nr_irqs > 1)
> > @@ -90,8 +89,7 @@ static int hyperv_irq_remapping_alloc(struct irq_domain
> *domain,
> > * Hypver-V IO APIC irq affinity should be in the scope of
> > * ioapic_max_cpumask because no irq remapping support.
> > */
> > - desc = irq_data_to_desc(irq_data);
> > - cpumask_copy(desc->irq_common_data.affinity, &ioapic_max_cpumask);
> > + irq_data_update_affinity(irq_data, &ioapic_max_cpumask);
> >
> > return 0;
> > }
>
> --
> ~Randy
Powered by blists - more mailing lists