[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <TY2P153MB0222F0ED0743B87BB103705C927F0@TY2P153MB0222.APCP153.PROD.OUTLOOK.COM>
Date: Fri, 22 Feb 2019 12:14:34 +0000
From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
To: Michael Kelley <mikelley@...rosoft.com>,
"lantianyu1986@...il.com" <lantianyu1986@...il.com>
CC: "joro@...tes.org" <joro@...tes.org>,
"mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>,
"arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
KY Srinivasan <kys@...rosoft.com>,
vkuznets <vkuznets@...hat.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"sashal@...nel.org" <sashal@...nel.org>,
"dan.carpenter@...cle.com" <dan.carpenter@...cle.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>
Subject: RE: [PATCH V4 2/3] HYPERV/IOMMU: Add Hyper-V stub IOMMU driver
Hi Michael:
Thanks for your review.
-----Original Message-----
From: Michael Kelley <mikelley@...rosoft.com>
Sent: Friday, February 22, 2019 1:28 AM
To: lantianyu1986@...il.com
Cc: Tianyu Lan <Tianyu.Lan@...rosoft.com>; joro@...tes.org; mchehab+samsung@...nel.org; davem@...emloft.net; gregkh@...uxfoundation.org; nicolas.ferre@...rochip.com; arnd@...db.de; linux-kernel@...r.kernel.org; iommu@...ts.linux-foundation.org; KY Srinivasan <kys@...rosoft.com>; vkuznets <vkuznets@...hat.com>; alex.williamson@...hat.com; sashal@...nel.org; dan.carpenter@...cle.com; linux-hyperv@...r.kernel.org
Subject: RE: [PATCH V4 2/3] HYPERV/IOMMU: Add Hyper-V stub IOMMU driver
From: lantianyu1986@...il.com <lantianyu1986@...il.com> Sent: Monday, February 11, 2019 6:20 AM
> + /*
> + * Hyper-V doesn't provide irq remapping function for
> + * IO-APIC and so IO-APIC only accepts 8-bit APIC ID.
> + * Cpu's APIC ID is read from ACPI MADT table and APIC IDs
> + * in the MADT table on Hyper-v are sorted monotonic increasingly.
> + * APIC ID reflects cpu topology. There maybe some APIC ID
> + * gaps when cpu number in a socket is not power of two. Prepare
> + * max cpu affinity for IOAPIC irqs. Scan cpu 0-255 and set cpu
> + * into ioapic_max_cpumask if its APIC ID is less than 256.
> + */
> + for (i = min_t(unsigned int, num_possible_cpus(), 255); i >= 0; i--)
The above isn't quite right. For example, if num_possible_cpus() is 8, then the loop will be executed 9 times, for values 8 down through 0.
It should be executed for values 7 down through 0.
Yes, fix this in the V5. Thanks.
> + if (cpu_physical_id(i) < 256)
> + cpumask_set_cpu(i, &ioapic_max_cpumask);
> +
> + return 0;
> +}
Michael
Powered by blists - more mailing lists