[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1490378842-26950-1-git-send-email-kys@exchange.microsoft.com>
Date: Fri, 24 Mar 2017 11:07:20 -0700
From: kys@...hange.microsoft.com
To: helgaas@...nel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, devel@...uxdriverproject.org,
olaf@...fle.de, apw@...onical.com, vkuznets@...hat.com,
jasowang@...hat.com, leann.ogasawara@...onical.com,
marcelo.cerri@...onical.com, sthemmin@...rosoft.com
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>, <stable@...r.kernel.org>
Subject: [PATCH 1/2] PCI: hv: Fix a bug in specifying CPU affinity
From: K. Y. Srinivasan <kys@...rosoft.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@...rosoft.com>
Cc: <stable@...r.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
Powered by blists - more mailing lists