linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tianyu Lan <Tianyu.Lan@microsoft.com>
To: Michael Kelley <mikelley@microsoft.com>,
	"lantianyu1986@gmail.com" <lantianyu1986@gmail.com>
Cc: "joro@8bytes.org" <joro@8bytes.org>,
	"mchehab+samsung@kernel.org" <mchehab+samsung@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	KY Srinivasan <kys@microsoft.com>, vkuznets <vkuznets@redhat.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"sashal@kernel.org" <sashal@kernel.org>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [PATCH V4 2/3] HYPERV/IOMMU: Add Hyper-V stub IOMMU driver
Date: Fri, 22 Feb 2019 12:14:34 +0000	[thread overview]
Message-ID: <TY2P153MB0222F0ED0743B87BB103705C927F0@TY2P153MB0222.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <DM5PR2101MB091885D1CD3761322191CAAFD77E0@DM5PR2101MB0918.namprd21.prod.outlook.com>

Hi Michael:
               Thanks for your review.

-----Original Message-----
From: Michael Kelley <mikelley@microsoft.com> 
Sent: Friday, February 22, 2019 1:28 AM
To: lantianyu1986@gmail.com
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>; joro@8bytes.org; mchehab+samsung@kernel.org; davem@davemloft.net; gregkh@linuxfoundation.org; nicolas.ferre@microchip.com; arnd@arndb.de; linux-kernel@vger.kernel.org; iommu@lists.linux-foundation.org; KY Srinivasan <kys@microsoft.com>; vkuznets <vkuznets@redhat.com>; alex.williamson@redhat.com; sashal@kernel.org; dan.carpenter@oracle.com; linux-hyperv@vger.kernel.org
Subject: RE: [PATCH V4 2/3] HYPERV/IOMMU: Add Hyper-V stub IOMMU driver

From: lantianyu1986@gmail.com <lantianyu1986@gmail.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

  reply	other threads:[~2019-02-22 12:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 14:20 [PATCH V4 0/3] x86/Hyper-V/IOMMU: Add Hyper-V IOMMU driver to support x2apic mode lantianyu1986
2019-02-11 14:20 ` [PATCH V4 1/3] x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available lantianyu1986
2019-02-21 17:00   ` Michael Kelley
2019-02-11 14:20 ` [PATCH V4 2/3] HYPERV/IOMMU: Add Hyper-V stub IOMMU driver lantianyu1986
2019-02-21 17:27   ` Michael Kelley
2019-02-22 12:14     ` Tianyu Lan [this message]
2019-02-11 14:20 ` [PATCH V4 3/3] MAINTAINERS: Add Hyper-V IOMMU driver into Hyper-V CORE AND DRIVERS scope lantianyu1986
2019-02-21 17:28   ` Michael Kelley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TY2P153MB0222F0ED0743B87BB103705C927F0@TY2P153MB0222.APCP153.PROD.OUTLOOK.COM \
    --to=tianyu.lan@microsoft.com \
    --cc=alex.williamson@redhat.com \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kys@microsoft.com \
    --cc=lantianyu1986@gmail.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=sashal@kernel.org \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).