[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 06/14] vpci/header: implement guest BAR register handlers
- To: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Tue, 1 Feb 2022 07:31:31 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=sYXmMcxEZyscolsk1qt3re5nHyVHfn2eL1bnW92I+cA=; b=nqyXfcyY4gLorWH41bGRdhIBuOHGv4HOJpQc+3YTO7vjx9w0Crb4NZE+Sy2yLGpwaIPGLUIIAGKe+McsvL90kV0Y8s94mxp/Zjp/7ZXth+DzwforqpABCgOYvumAI2qHaGmEPjIxl9qSohBgwPXBotg9hp6X8hWbuCbubMLSiyzDunBUDyouzyuC06GB8yEiheVLgsCoRxogCaeETYV0xhsQfBunfrx4g/8N8uqZao+04x143Z7cupxvVeKupgg0ipeoNa22VrWivvbWHIo+ZNXTzsrmIkA6nWhkZsj/2/235//zoickSK8/mBKmV/nm+dz9YeV59gjAYvpOU+TJWg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FHn0coy58Nij7DDErEwdDqKWQ5AVwdmnr3StHo+aEouv9vyWqVccSmGjd4J4cZ0108PArKsN2njscv3P/nsOI1nvbl22iUL8sZL3ct2wEgeApal+MipRR4OztID9xuminMf+Pe1YZsGI/EmZR6ZckJNarr0npx/79jqhncL9dOyTo3L0HRSTMqeKm9Vvs9FlLPrqpWx/3/9mGqUc+TGUvfkhKWmP7m8On5ZoZdcnEMRV603jGCpyxrJEDAGI64pLMxScJg4MsDzow8AYInF8g7kx7zpm9lU11FumgWgHGxKg8nuxRIOiR4XOdQG3Zt5PckqKHnvC/yv0N9f+wPiqIA==
- 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>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Tue, 01 Feb 2022 07:32:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX4ewHyWAyD811HEGp8pIjUuVWNaxfndGAgB4GiwCAAAxbgIABBueA
- Thread-topic: [PATCH v5 06/14] vpci/header: implement guest BAR register handlers
On 31.01.22 17:50, Jan Beulich wrote:
> On 31.01.2022 16:06, Oleksandr Andrushchenko wrote:
>> Hi, Roger!
>>>> rom->type = VPCI_BAR_EMPTY;
>>>> }
>>>> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
>>>> index ed127a08a953..0a73b14a92dc 100644
>>>> --- a/xen/include/xen/vpci.h
>>>> +++ b/xen/include/xen/vpci.h
>>>> @@ -68,7 +68,10 @@ struct vpci {
>>>> struct vpci_header {
>>>> /* Information about the PCI BARs of this device. */
>>>> struct vpci_bar {
>>>> + /* Physical view of the BAR. */
>>> No, that's not the physical view, it's the physical (host) address.
>>>
>>>> uint64_t addr;
>>>> + /* Guest view of the BAR: address and lower bits. */
>>>> + uint64_t guest_reg;
>>> I continue to think it would be clearer if you store the guest address
>>> here (gaddr, without the low bits) and add those in guest_bar_read
>>> based on bar->{type,prefetchable}. Then it would be equivalent to the
>>> existing 'addr' field.
>>>
>> I agreed first to do such a change, but then recalled our discussion with
>> Jan [1].
>> And then we decided that in order for it to be efficient it is better if we
>> setup all the
>> things during the write phase (rare), rather then during the write phase
>> (more often).
> Small correction: The 2nd "write" was likely meant to be "read".
Yes, this is correct.
> But
> please recall that Roger is the maintainer of the code, so he gets
> the final say.
Agree, but would vote for the current approach as it still saves some
CPU cycles making the read operation really tiny
>
> Jan
>
Thank you,
Oleksandr
|