[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: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Mon, 31 Jan 2022 15:06:20 +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=cUMc7Cwgc3p4fx1LmRT4WAFT7O14oZIkwNY7wYk9LQk=; b=ekxELbwlPttKhrHHoknzHjCbEJFV1jI1XQ4Pu7s8RPFlyrMgBLQJQ59/H30IEKZrJlhsYIOyDtPfNrfJ+eN7LrdfOVJgf45QRTlEosvUW9FMETpOkqv1lN/NwVghkzFPAJ6vuKRnerb6+rDrUiOuqtD75GiIAUCHyJgLZQ2QBlgOT7LX+7RyN9MITTrD7/YYa4mr784LKFDbUDLUCkwKNxb1dQKxy5+dD3GdYb9NXW90pXX0bYgwss40NV+HDrAOrejd9RwTfi7DtH8AEYtyH94cfhBfQdfKKweLebXh77bgF60Vh00o6cBY2mro6FL05TSQCMKa0kRa/KXdz3FkXA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WaNllTJTFnTfB0MaxvzP9mAZqlFLcsFGs92IoYQegsRYXKtOw/evCWpcq2NjvgroPd/i9UNWs2oycr2+5wZe75MAPtG9wST/agaFl3UDfDDKZFcF0sRuZD7nJxxOgo00XrED7u96zhKOjD8wVcetZlcjL+nhtAOydnk+tJXtLofObwHXRO72s49VttY08yQQtJYI17nRDYKfxbaEJKGK9i1AI0eUujLIxvCtTtjrVrEr6L2eme0Inks0832AITSqRHxRIptEcEj/1mCOl0QPFT2mAFmVbq0kdRGN2uwUmfqLZjStJGMEl5cradsqJRPQVxi9ZzHdd0UCrJ9mO0tMxg==
- 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>, "jbeulich@xxxxxxxx" <jbeulich@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: Mon, 31 Jan 2022 15:06:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX4ewHyWAyD811HEGp8pIjUuVWNaxfndGAgB4GiwA=
- Thread-topic: [PATCH v5 06/14] vpci/header: implement guest BAR register handlers
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).
If you still see it clearer I can re-work the code
Thank you,
Oleksandr
[1] https://www.mail-archive.com/xen-devel@xxxxxxxxxxxxxxxxxxxx/msg103431.html
|