[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen-pciback: Consider MSI-X enabled only when MASKALL bit is cleared


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 17 Nov 2022 14:50:55 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ofcvnwf3QX63P3Nn/kkg3fokokcoLmhBk0ljKAKcG9g=; b=hgUHuK7E11P4v/fowOTTFqdaNfasDj9qnGwRqI+CHzlZzJGib+/Ge07zCUSR70+QOVMKf3vTn9C1DMwlBbZswoU/dthGSK/EaymLFsiKz+02hsZI04ysbln8qkAt29eK2JOomDCgF2mliqiwIW8Ny/rSJCaDBTqKIZ4iHMrxuMOfuw3BdzgK+aBEwBd1LbktueZnpe0XLmAlyLcgjK/TfL0/rStkcejMBL0WT8WHrO7YBmCW4DzOpxoCBhWU7/5B5m0xGqPOxbOVvDjlhzmx0r3Y+icFH5rzoVZTv0RvEzG3JDsWRDAOHKbQm/u1uFPTqLsjE7HUQZH4CctYDaa8+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BNJYR4jFZLCKUtbiJCUI8wPYiEKN1GX6hsyvrp/OaKlul5/3Di3+K2KICvvcp1b/h/wokkTxaRMLR++tSFjsMb5ee199aJMYPKWjxgqVcRBiXGaDfOo/UzsmgzCD3nWZyWqunfZRtGW4reJbqh5zUQnL2d3KqKT5TctOiE/5XMffb3ioHD4WFNyoFXaYyKFE0NCvjtMz59UiKM2kagXqQ8m3dbZufmVXJLVcss+oq8EFXLkEyPe75dOloFSXFyGxhB9uz7mGxjoMxghjkc1iQogY8orxovrLr5NwY8Yr0FDMuBsEppUnX3bKsWgNdi/E1Okc04h35yNTDrUkJN3/Ug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, "moderated list:XEN HYPERVISOR INTERFACE" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
  • Delivery-date: Thu, 17 Nov 2022 13:51:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.11.2022 12:41, Marek Marczykowski-Górecki wrote:
> --- a/drivers/xen/xen-pciback/conf_space.c
> +++ b/drivers/xen/xen-pciback/conf_space.c
> @@ -313,7 +313,7 @@ int xen_pcibk_get_interrupt_type(struct pci_dev *dev)
>                               &val);
>               if (err)
>                       return err;
> -             if (val & PCI_MSIX_FLAGS_ENABLE)
> +             if (val & PCI_MSIX_FLAGS_ENABLE && !(val & 
> PCI_MSIX_FLAGS_MASKALL))
>                       ret |= INTERRUPT_TYPE_MSIX;
>       }
>       return ret ?: INTERRUPT_TYPE_NONE;

Considering Andrew's reply, maybe it wasn't a good suggestion to change
the code here. If, however, you/we decide to keep the change, then
please add another pair of parentheses around the operands of the left
hand &.

If the change was to be dropped again, I think ...

> --- a/drivers/xen/xen-pciback/conf_space_capability.c
> +++ b/drivers/xen/xen-pciback/conf_space_capability.c
> @@ -242,6 +242,10 @@ static int msi_msix_flags_write(struct pci_dev *dev, int 
> offset, u16 new_value,
>               if (int_type == INTERRUPT_TYPE_NONE ||
>                   int_type == field_config->int_type)
>                       goto write;
> +             if (int_type == INTERRUPT_TYPE_INTX &&

... this would need extending to also cover the INTX|MSIX case (i.e.
if a second such write made it here when the enable+maskall bits are
already set).

Jan

> +                 field_config->int_type == INTERRUPT_TYPE_MSIX &&
> +                 (new_value & PCI_MSIX_FLAGS_MASKALL))
> +                     goto write;
>               return PCIBIOS_SET_FAILED;
>       }
>  




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.