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

Re: [PATCH v3 08/11] vpci/header: Emulate PCI_COMMAND register for guests


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 3 Nov 2021 11:34:45 +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=bbvy3+lKfyxPz1EZNGPRWx3Zx5KsZ8B+QhFeyEV/chc=; b=NBglv4+WDDm/oiouqCd/Pqnm3UZGeuwWyY5bMKibmqHjC3Dlo45qC7Bklj/3j3mWTWwe3FyQmiD/j1NgM4aCKt8SilaE6BzvncW8hMrDF3dTXQbZzSSjLbIpWj7yZqifaaq5V5YILD/6v1kpl/JeguXigoq6WrdJOzV8BVRVTZePIpa5b1Hg90Ow6H4Sp01a6W56tx9mCDWn34H757lBbkOdsGIaEEUep7KEOHygHpSQWIo0ury0Cg77olM2n1no9dXfcnw0yq1QtaHTqvn2ebhORoqJP8O1T6nMbDmEQbLnuwwioNq5l/Ni5GZN8Ol/ROqnipRPqXysRRjjZT0Guw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eNSUzLwMVRmgQgfSmZ+D63Qo2Ml/Xne+RCGqNksA1AZlcNeo1zi6aVP7E8aOR1vu0lTQHlIcFC5plY5jFRemTL33WMo1xVcJmqK8iSctOPYD7Go05IhxHdvmqufxtnQp73nvLybJdzchVpEZbr5leHtLDoIGhIxf9PptxLnxD+DvrNK2Y6IgPil+OUImSTqjmIH6OqU+IsX4NYYAFVKRITYpNE2MlXBv0ujMnpddqUhJlN6xlmAdVydYz8EcTy0Qxj0Roo9OTTtgXMszJv+dlck3wj29CPhHE2ausUeu9YvbfPg0LTvJljjr+BZvNA20xodMNf4sBMZz6zUyHEcL1g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 03 Nov 2021 10:35:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.11.2021 11:24, Oleksandr Andrushchenko wrote:
> On 03.11.21 11:49, Jan Beulich wrote:
>> Aiui you want to prevent the guest from clearing the bit if either
>> MSI or MSI-X are in use. Symmetrically, when the guest enables MSI
>> or MSI-X, you will want to force the bit set (which may well be in
>> a separate, future patch).
> static uint32_t emulate_cmd_reg(const struct pci_dev *pdev, uint32_t cmd)
> {
>      /* TODO: Add proper emulation for all bits of the command register. */
> 
>      if ( (cmd & PCI_COMMAND_INTX_DISABLE) == 0 )
>      {
>          /* Guest wants to enable INTx. It can't be enabled if MSI/MSI-X 
> enabled. */
> #ifdef CONFIG_HAS_PCI_MSI
>          if ( pdev->vpci->msi->enabled )
>              cmd |= PCI_COMMAND_INTX_DISABLE;
> #endif
>      }
> 
>      return cmd;
> }
> 
> Is this what you mean?

Something along these lines, yes. I'd omit the outer if() for clarity /
brevity.

Jan




 


Rackspace

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