lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Mar 2017 18:13:30 +0000
From:   Long Li <longli@...rosoft.com>
To:     KY Srinivasan <kys@...rosoft.com>,
        "helgaas@...nel.org" <helgaas@...nel.org>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
        "olaf@...fle.de" <olaf@...fle.de>,
        "apw@...onical.com" <apw@...onical.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "jasowang@...hat.com" <jasowang@...hat.com>,
        "leann.ogasawara@...onical.com" <leann.ogasawara@...onical.com>,
        "marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
        "Stephen Hemminger" <sthemmin@...rosoft.com>
CC:     "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity

> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@...uxdriverproject.org] On
> Behalf Of kys@...hange.microsoft.com
> Sent: Friday, March 24, 2017 11:07 AM
> 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; Stephen
> Hemminger <sthemmin@...rosoft.com>
> Cc: stable@...r.kernel.org
> Subject: [PATCH 1/2] pci-hyperv: 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>

Reviewed-by: Long Li <longli@...rosoft.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@...uxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ