[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: Bertrand Marquis <bertrand.marquis@xxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Thu, 3 Feb 2022 12:36:05 +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=qvjXtdrceeDe0zyUuMbF/2QUXRGNXnQyZ4ZyVbFcofA=; b=oZ3+oZzviw+qkGdXnjFR9d0keolWzeDXu2dGcQq22FRq6fyBCqSR5PVkize1alEcL+J4Vof6MGh+CkvIl1pRoQgghT7FQYh7nV+7520/1fexu5zPNG0jmr4uXqT3gT+lH7BK6Qaoykzo3C26zx0s0uR5pX3mAKIMkc7eoxGSs7gXhNx0Ug+8cQTtISBbrCkww70UOsbeMley304pjJ3G4o0jaWyiNZYgl951axhoOvD+ROhh4Z76o1O2Wk/AUx2hP+akecO3c7turqLYXPgor6DNiATLNZNRifi1XxMn0zmln+WoSp2RoqCdhWYp2Ijrna/KR1hfVBmWggsbT+Ip+g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TMuSfnhVGyo/CNGY4O/e+LFkAilnTgZX4WOhohe82W1AovqeEWQkRkUP/AILjRojsZiU83YtTjSbmz5XW3fRHYxFmqnobFBeJz1IT7ckqZ7bsaT5Ojh3l5QPQVzuG5p5oEF3MN+KwYs51zoquCpo5FTUU/ybODGuH6Xd+e+xcXjEt8o9jLUqd2Mrqg7by5PfOEdurYIBUrKxklmpy25jUIbGx+/I30B/25mFfc+w+/LkX2xptl5x4Gv47AKceSvOP0nliqMkxc9nmpaRpVk988Etbk6eZ5H5TFcugmMxR0dxbJTJHtpKXovW5Kn6w1x6kXGRDs07kpRLfCUPJOoudA==
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <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>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Thu, 03 Feb 2022 12:36:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX4ewHyWAyD811HEGp8pIjUuVWNawUby8AgAFMuICAbHV4AA==
- Thread-topic: [PATCH v5 06/14] vpci/header: implement guest BAR register handlers
Hi, Bertrand!
On 26.11.21 14:19, Oleksandr Andrushchenko wrote:
> Hi, Bertrand!
>
> On 25.11.21 18:28, Bertrand Marquis wrote:
>> Hi Oleksandr,
>>
>>> On 25 Nov 2021, at 11:02, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
>>> wrote:
>>>
>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>>
>>> Add relevant vpci register handlers when assigning PCI device to a domain
>>> and remove those when de-assigning. This allows having different
>>> handlers for different domains, e.g. hwdom and other guests.
>>>
>>> Emulate guest BAR register values: this allows creating a guest view
>>> of the registers and emulates size and properties probe as it is done
>>> during PCI device enumeration by the guest.
>>>
>>> ROM BAR is only handled for the hardware domain and for guest domains
>>> there is a stub: at the moment PCI expansion ROM handling is supported
>>> for x86 only and it might not be used by other architectures without
>>> emulating x86. Other use-cases may include using that expansion ROM before
>>> Xen boots, hence no emulation is needed in Xen itself. Or when a guest
>>> wants to use the ROM code which seems to be rare.
>> In the generic code, bars for ioports are actually skipped (check code before
>> in header.c, in case of ioports there is a continue) and no handler is
>> registered for them.
>> The consequence will be that a guest will access hardware when reading those
>> BARs.
> Yes, this seems to be a valid point
So, with the approach we have developed these days we will ignore all writes
and return ~0 for reads for all unhandled ops, e.g. those which do not have
explicit
register handlers employed. Thus, this case will fall into unhandled clause.
Thank you,
Oleksandr
|