[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: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 31 Jan 2022 16:50:33 +0100
- 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=Qx6/YJRo4itrxy555f4/dNExjdDK3eyjdPvG4r1aV10=; b=Kc8cVwH/Ja4Ykm+OA9x+aS8mDxz33Fu2BVo4zW485zKzS0lJMAFZKOGAu62Vy0qBnnhBDGizv7dkhmUf3hTgFghxtw/3b/cnlHPlpHKEiNzbFyu4R3S8CNGHMNuMsEL12CE1L9RnHPpaG2udFQyPYkeDlUnafUAnvBLLBRiEry7iocGygX53I9VjCK3yUjr9ZqDbaQ65hq8TDPmHfsO2f0jAr+hronMFCPpN6Rh10Cw+cAYmahXYHeVuR6xum5dbvQwFbFHHj/dupRvVN32i9T+LNfXOityuz4QA1+o8/K+PH6oK8cyI3OqdkZua3Z8IhT46SKL670zXy15xsvzp6w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OnpzM2kAw4ws9z5QPuzuPVesDELp36oBO6S0XGo01k7T8tvxw/9V4KebF188NPCl5K5A8qhSQeclSgiRzVynVJa5Ts0d+xofEaRXA7atQtYkTpDScLbzqVDlDTJzN8M87iUmQdzNVRDDD8hz2LsEmiCOjNEbP2ARp3PfOcEz29UFtacztHm+bam0ItiTvqOfE7QmmuGJWWywFkrAlIc3G4N2CjfhFidI4TlfRqkcsMQodQF0CaDPxeQycqXRHvb3fzpN2oOVz479xFJQ5qVVwH8IZmwrw6xEZ5cRgKAqM7lRQBl1KHy2cRgTv2gDRR08SNHozsI8xgLannghJ7QOkg==
- 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>, "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>
- Delivery-date: Mon, 31 Jan 2022 15:50:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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". But
please recall that Roger is the maintainer of the code, so he gets
the final say.
Jan
|