Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1608746 > unrolled thread
| Started by | kys@exchange.microsoft.com |
|---|---|
| First post | 2017-03-24 19:10 +0100 |
| Last post | 2017-04-04 23:50 +0200 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] pci-hyperv: Some miscellaneous fixes kys@exchange.microsoft.com - 2017-03-24 19:10 +0100
[PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity kys@exchange.microsoft.com - 2017-03-24 19:10 +0100
RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity Long Li <longli@microsoft.com> - 2017-03-27 20:20 +0200
[PATCH 2/2] pci-hyperv: Fix an atomic bug kys@exchange.microsoft.com - 2017-03-24 19:10 +0100
RE: [PATCH 2/2] pci-hyperv: Fix an atomic bug Long Li <longli@microsoft.com> - 2017-03-27 20:20 +0200
[PATCH 1/2] PCI: hv: Fix a bug in specifying CPU affinity kys@exchange.microsoft.com - 2017-03-24 19:20 +0100
Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes Bjorn Helgaas <helgaas@kernel.org> - 2017-04-04 21:10 +0200
RE: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes KY Srinivasan <kys@microsoft.com> - 2017-04-04 22:00 +0200
Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes Bjorn Helgaas <helgaas@kernel.org> - 2017-04-04 22:40 +0200
RE: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes KY Srinivasan <kys@microsoft.com> - 2017-04-04 23:50 +0200
| From | kys@exchange.microsoft.com |
|---|---|
| Date | 2017-03-24 19:10 +0100 |
| Subject | [PATCH 0/2] pci-hyperv: Some miscellaneous fixes |
| Message-ID | <toBOW-5jj-17@gated-at.bofh.it> |
From: K. Y. Srinivasan <kys@microsoft.com> Some miscellaneous fixes. K. Y. Srinivasan (2): pci-hyperv: Fix a bug in specifying CPU affinity pci-hyperv: Fix an atomic bug drivers/pci/host/pci-hyperv.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
[toc] | [next] | [standalone]
| From | kys@exchange.microsoft.com |
|---|---|
| Date | 2017-03-24 19:10 +0100 |
| Subject | [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity |
| Message-ID | <toBOW-5jj-21@gated-at.bofh.it> |
| In reply to | #1608746 |
From: K. Y. Srinivasan <kys@microsoft.com>
When we have 32 or more CPUs in the affinity mask, we should
use a special constant to specify that to the host. Fix this issue.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
---
drivers/pci/host/pci-hyperv.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index ada9856..32a16fb 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -72,6 +72,7 @@ enum {
PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1
};
+#define CPU_AFFINITY_ALL -1ULL
#define PCI_CONFIG_MMIO_LENGTH 0x2000
#define CFG_PAGE_OFFSET 0x1000
#define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH - CFG_PAGE_OFFSET)
@@ -897,9 +898,13 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
* processors because Hyper-V only supports 64 in a guest.
*/
affinity = irq_data_get_affinity_mask(data);
- for_each_cpu_and(cpu, affinity, cpu_online_mask) {
- int_pkt->int_desc.cpu_mask |=
- (1ULL << vmbus_cpu_number_to_vp_number(cpu));
+ if (cpumask_weight(affinity) >= 32) {
+ int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL;
+ } else {
+ for_each_cpu_and(cpu, affinity, cpu_online_mask) {
+ int_pkt->int_desc.cpu_mask |=
+ (1ULL << vmbus_cpu_number_to_vp_number(cpu));
+ }
}
ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt,
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Long Li <longli@microsoft.com> |
|---|---|
| Date | 2017-03-27 20:20 +0200 |
| Subject | RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity |
| Message-ID | <tpHpg-3Jt-21@gated-at.bofh.it> |
| In reply to | #1608747 |
> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On
> Behalf Of kys@exchange.microsoft.com
> Sent: Friday, March 24, 2017 11:07 AM
> To: helgaas@kernel.org; linux-pci@vger.kernel.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com;
> leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen
> Hemminger <sthemmin@microsoft.com>
> Cc: stable@vger.kernel.org
> Subject: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity
>
> From: K. Y. Srinivasan <kys@microsoft.com>
>
> When we have 32 or more CPUs in the affinity mask, we should use a special
> constant to specify that to the host. Fix this issue.
>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Cc: <stable@vger.kernel.org>
Reviewed-by: Long Li <longli@microsoft.com>
> ---
> drivers/pci/host/pci-hyperv.c | 11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index ada9856..32a16fb 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -72,6 +72,7 @@ enum {
> PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1 };
>
> +#define CPU_AFFINITY_ALL -1ULL
> #define PCI_CONFIG_MMIO_LENGTH 0x2000
> #define CFG_PAGE_OFFSET 0x1000
> #define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH -
> CFG_PAGE_OFFSET) @@ -897,9 +898,13 @@ static void
> hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
> * processors because Hyper-V only supports 64 in a guest.
> */
> affinity = irq_data_get_affinity_mask(data);
> - for_each_cpu_and(cpu, affinity, cpu_online_mask) {
> - int_pkt->int_desc.cpu_mask |=
> - (1ULL << vmbus_cpu_number_to_vp_number(cpu));
> + if (cpumask_weight(affinity) >= 32) {
> + int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL;
> + } else {
> + for_each_cpu_and(cpu, affinity, cpu_online_mask) {
> + int_pkt->int_desc.cpu_mask |=
> + (1ULL << vmbus_cpu_number_to_vp_number(cpu));
> + }
> }
>
> ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt,
> --
> 1.7.1
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[toc] | [prev] | [next] | [standalone]
| From | kys@exchange.microsoft.com |
|---|---|
| Date | 2017-03-24 19:10 +0100 |
| Subject | [PATCH 2/2] pci-hyperv: Fix an atomic bug |
| Message-ID | <toBOX-5jj-53@gated-at.bofh.it> |
| In reply to | #1608746 |
From: K. Y. Srinivasan <kys@microsoft.com> The memory allocation here needs to be non-blocking. Fix the issue. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: <stable@vger.kernel.org> --- drivers/pci/host/pci-hyperv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 32a16fb..85088a1 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -877,7 +877,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) hv_int_desc_free(hpdev, int_desc); } - int_desc = kzalloc(sizeof(*int_desc), GFP_KERNEL); + int_desc = kzalloc(sizeof(*int_desc), GFP_ATOMIC); if (!int_desc) goto drop_reference; -- 1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Long Li <longli@microsoft.com> |
|---|---|
| Date | 2017-03-27 20:20 +0200 |
| Subject | RE: [PATCH 2/2] pci-hyperv: Fix an atomic bug |
| Message-ID | <tpHpg-3Jt-23@gated-at.bofh.it> |
| In reply to | #1608762 |
> -----Original Message----- > From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On > Behalf Of kys@exchange.microsoft.com > Sent: Friday, March 24, 2017 11:07 AM > To: helgaas@kernel.org; linux-pci@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com; > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > Hemminger <sthemmin@microsoft.com> > Cc: stable@vger.kernel.org > Subject: [PATCH 2/2] pci-hyperv: Fix an atomic bug > > From: K. Y. Srinivasan <kys@microsoft.com> > > The memory allocation here needs to be non-blocking. > Fix the issue. > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> > Cc: <stable@vger.kernel.org> Reviewed-by: Long Li <longli@microsoft.com> > --- > drivers/pci/host/pci-hyperv.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c > index 32a16fb..85088a1 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -877,7 +877,7 @@ static void hv_compose_msi_msg(struct irq_data > *data, struct msi_msg *msg) > hv_int_desc_free(hpdev, int_desc); > } > > - int_desc = kzalloc(sizeof(*int_desc), GFP_KERNEL); > + int_desc = kzalloc(sizeof(*int_desc), GFP_ATOMIC); > if (!int_desc) > goto drop_reference; > > -- > 1.7.1 > > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[toc] | [prev] | [next] | [standalone]
| From | kys@exchange.microsoft.com |
|---|---|
| Date | 2017-03-24 19:20 +0100 |
| Subject | [PATCH 1/2] PCI: hv: Fix a bug in specifying CPU affinity |
| Message-ID | <toBYE-5oX-55@gated-at.bofh.it> |
| In reply to | #1608746 |
From: K. Y. Srinivasan <kys@microsoft.com>
When we have 32 or more CPUs in the affinity mask, we should
use a special constant to specify that to the host. Fix this issue.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
---
drivers/pci/host/pci-hyperv.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index ada9856..2c2ea1e 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -897,9 +897,13 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
* processors because Hyper-V only supports 64 in a guest.
*/
affinity = irq_data_get_affinity_mask(data);
- for_each_cpu_and(cpu, affinity, cpu_online_mask) {
- int_pkt->int_desc.cpu_mask |=
- (1ULL << vmbus_cpu_number_to_vp_number(cpu));
+ if (cpumask_weight(affinity) >= 32) {
+ int_pkt->int_desc.cpu_mask = -1ULL;
+ } else {
+ for_each_cpu_and(cpu, affinity, cpu_online_mask) {
+ int_pkt->int_desc.cpu_mask |=
+ (1ULL << vmbus_cpu_number_to_vp_number(cpu));
+ }
}
ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt,
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-04-04 21:10 +0200 |
| Message-ID | <tsC02-Cw-15@gated-at.bofh.it> |
| In reply to | #1608746 |
On Fri, Mar 24, 2017 at 11:06:40AM -0700, kys@exchange.microsoft.com wrote: > From: K. Y. Srinivasan <kys@microsoft.com> > > Some miscellaneous fixes. > > K. Y. Srinivasan (2): > pci-hyperv: Fix a bug in specifying CPU affinity > pci-hyperv: Fix an atomic bug > > drivers/pci/host/pci-hyperv.c | 13 +++++++++---- > 1 files changed, 9 insertions(+), 4 deletions(-) I applied these with Long's reviewed-by to pci/host-hv for v4.12 with the following subject lines: PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC There were two copies of [1/2], which makes this error-prone. I applied the second one that defines CPU_AFFINITY_ALL. They're both marked for stable, but without any clue about when the problems were introduced or how serious they are, I did not queue them for v4.11. If you want them in v4.11, please supply those additional details. Bjorn
[toc] | [prev] | [next] | [standalone]
| From | KY Srinivasan <kys@microsoft.com> |
|---|---|
| Date | 2017-04-04 22:00 +0200 |
| Message-ID | <tsCMp-UQ-11@gated-at.bofh.it> |
| In reply to | #1616342 |
> -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Tuesday, April 4, 2017 12:04 PM > To: KY Srinivasan <kys@microsoft.com> > Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > vkuznets@redhat.com; jasowang@redhat.com; > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > Hemminger <sthemmin@microsoft.com> > Subject: Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes > > On Fri, Mar 24, 2017 at 11:06:40AM -0700, kys@exchange.microsoft.com > wrote: > > From: K. Y. Srinivasan <kys@microsoft.com> > > > > Some miscellaneous fixes. > > > > K. Y. Srinivasan (2): > > pci-hyperv: Fix a bug in specifying CPU affinity > > pci-hyperv: Fix an atomic bug > > > > drivers/pci/host/pci-hyperv.c | 13 +++++++++---- > > 1 files changed, 9 insertions(+), 4 deletions(-) > > I applied these with Long's reviewed-by to pci/host-hv for v4.12 with the > following subject lines: > > PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs > PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC > Thank you. > There were two copies of [1/2], which makes this error-prone. I applied > the second one that defines CPU_AFFINITY_ALL. Thanks again; sorry for the confusion. > > They're both marked for stable, but without any clue about when the > problems were introduced or how serious they are, I did not queue them for > v4.11. If you want them in v4.11, please supply those additional details. I think these issues have been there since the driver got merged upstream. I would want this to be applied against 4.11 as well. Let me know if I should resend these patches. Thanks, K. Y > > Bjorn
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-04-04 22:40 +0200 |
| Message-ID | <tsDp7-1nT-9@gated-at.bofh.it> |
| In reply to | #1616366 |
On Tue, Apr 04, 2017 at 07:54:33PM +0000, KY Srinivasan wrote: > > -----Original Message----- > > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > > Sent: Tuesday, April 4, 2017 12:04 PM > > To: KY Srinivasan <kys@microsoft.com> > > Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > > vkuznets@redhat.com; jasowang@redhat.com; > > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > > Hemminger <sthemmin@microsoft.com> > > Subject: Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes > > > > On Fri, Mar 24, 2017 at 11:06:40AM -0700, kys@exchange.microsoft.com > > wrote: > > > From: K. Y. Srinivasan <kys@microsoft.com> > > > > > > Some miscellaneous fixes. > > > > > > K. Y. Srinivasan (2): > > > pci-hyperv: Fix a bug in specifying CPU affinity > > > pci-hyperv: Fix an atomic bug > > > > > > drivers/pci/host/pci-hyperv.c | 13 +++++++++---- > > > 1 files changed, 9 insertions(+), 4 deletions(-) > > > > I applied these with Long's reviewed-by to pci/host-hv for v4.12 with the > > following subject lines: > > > > PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs > > PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC > > > Thank you. > > > There were two copies of [1/2], which makes this error-prone. I applied > > the second one that defines CPU_AFFINITY_ALL. > > Thanks again; sorry for the confusion. > > > > > They're both marked for stable, but without any clue about when the > > problems were introduced or how serious they are, I did not queue them for > > v4.11. If you want them in v4.11, please supply those additional details. > > I think these issues have been there since the driver got merged upstream. > I would want this to be applied against 4.11 as well. Let me know if I should resend > these patches. No need to resend, but I do need more details about what issues these fix and why they're more urgent than garden-variety bug fixes that are planned for v4.12. In general for-linus is for fixing problems we added during the merge window, or other high-priority, low-risk changes. Bjorn
[toc] | [prev] | [next] | [standalone]
| From | KY Srinivasan <kys@microsoft.com> |
|---|---|
| Date | 2017-04-04 23:50 +0200 |
| Message-ID | <tsEuT-21A-19@gated-at.bofh.it> |
| In reply to | #1616377 |
> -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Tuesday, April 4, 2017 1:39 PM > To: KY Srinivasan <kys@microsoft.com> > Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > vkuznets@redhat.com; jasowang@redhat.com; > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > Hemminger <sthemmin@microsoft.com> > Subject: Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes > > On Tue, Apr 04, 2017 at 07:54:33PM +0000, KY Srinivasan wrote: > > > -----Original Message----- > > > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > > > Sent: Tuesday, April 4, 2017 12:04 PM > > > To: KY Srinivasan <kys@microsoft.com> > > > Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > > > devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; > > > vkuznets@redhat.com; jasowang@redhat.com; > > > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > > > Hemminger <sthemmin@microsoft.com> > > > Subject: Re: [PATCH 0/2] pci-hyperv: Some miscellaneous fixes > > > > > > On Fri, Mar 24, 2017 at 11:06:40AM -0700, kys@exchange.microsoft.com > > > wrote: > > > > From: K. Y. Srinivasan <kys@microsoft.com> > > > > > > > > Some miscellaneous fixes. > > > > > > > > K. Y. Srinivasan (2): > > > > pci-hyperv: Fix a bug in specifying CPU affinity > > > > pci-hyperv: Fix an atomic bug > > > > > > > > drivers/pci/host/pci-hyperv.c | 13 +++++++++---- > > > > 1 files changed, 9 insertions(+), 4 deletions(-) > > > > > > I applied these with Long's reviewed-by to pci/host-hv for v4.12 with the > > > following subject lines: > > > > > > PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs > > > PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC > > > > > Thank you. > > > > > There were two copies of [1/2], which makes this error-prone. I applied > > > the second one that defines CPU_AFFINITY_ALL. > > > > Thanks again; sorry for the confusion. > > > > > > > > They're both marked for stable, but without any clue about when the > > > problems were introduced or how serious they are, I did not queue them > for > > > v4.11. If you want them in v4.11, please supply those additional details. > > > > I think these issues have been there since the driver got merged > upstream. > > I would want this to be applied against 4.11 as well. Let me know if I should > resend > > these patches. > > No need to resend, but I do need more details about what issues these fix > and why they're more urgent than garden-variety bug fixes that are planned > for v4.12. In general for-linus is for fixing problems we added during the > merge window, or other high-priority, low-risk changes. For sure I want to get this into 4.12. Since it fixes issues that have been there for a long time, (including 4.11), it would be good to get it into 4.11 as well. Regards, K. Y > > Bjorn
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web