[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: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Wed, 3 Nov 2021 10:36:36 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=4Ywo3xrZjaLVGm9inqDxzUFieacVKcDDvsabIOFW8nM=; b=nVg8r1mQwYcxeb+0qZGUxln6Ow2CbkRG9U0z5VVdTtBWt5K3pVzGQHiOzwbZFbiv9Uu1Ozc6ZxAdpQtKUMAKYA9aAhQlblQZnvQZu4DeNiorMZi+9Mc2clpiz8aD0q7pYmZv/EBjaTlojgiU1afvCsc2D6aWPKcjjwUvB4bX47JKXZZdn/k/YO8tRNVd3ycYGtlGPihGkPC+uVNdyvoX6U9rfXLGic7mUiV/bxEqNYUFtzBqDS0Hcswo1BNqsRMtfuyxqlGCe42e3Al+XiKoo2vt4m9UwRCarDA08jct3fXXa11NnOjzs1wXf+IDW0OHM/pWgQPdeeEoaqEa1y7B5A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EBr2RIfGmKFYC0B/4bkZjVNtRnb9EVkiLJ202Y2q907Y0eYaHgV4A7uLlbrZaVLJmVB+aWGR+OGWOtY/E2AP+1P8gCY+T2MW8rZ0VXTgS/ty/RIKic8UVNS1RLRCBECHCKIAaitAjnWVTgLCibCKZ58urVRwGT8rRjWeLZnaR+6CelP48bTWyemSSNeS6KzRNdZk488Mg+cqLxLjki6vHA5wvX1t14Z/lE3RU5Xyz3fIaH1wWU9nQEdMjtCGAbTou8ON3+bJJh8U9q5Dk2RvxypJoxGcz0uHMI8YctpY6fQ8PxazrV+Emnr5/Hjg30luhoQm1iS88hVyRMBsCkBufw==
- 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>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Wed, 03 Nov 2021 10:36:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHXtdAkq8Qmwxr3HUWTio8KWsEpvKvlQ6KAgAsHq4CAAAimAIAAIt2AgAAEUICAATmxAIAABTcAgAABvgCAAAHkAIAAAZSAgAAFc4CAAAmcgIAAAuiAgAAAg4A=
- Thread-topic: [PATCH v3 08/11] vpci/header: Emulate PCI_COMMAND register for guests
On 03.11.21 12:34, Jan Beulich wrote:
> 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.
Sure, thank you!
@Roger are you ok with this approach?
>
> Jan
>
>
|