[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>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Feb 2022 13:50:48 +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=9fJYLOu+SSapEu4PHaPUc4xhfvLCAo0tqu4/AKsrBAE=; b=im4bV4/4lf/GQTvvfHGV2+8bco7TWpjWEMFG0k+t85NjEkTSSGLk0hf2QAE7qgZr4qHMvXLmIGgYhTUOdLtCH2wM6ijorSjLyJrtEaQXyjzfn023lW1Jh0wQzsM2D+zSiA5cIEthk6XPIYab2Zzrex8rZu5qdQcRn0FIIWjN/aSx8E/08G3UkceneRFGydRme0+wd8WltjYmMxXwWvs7mCe/CatUfVdq+jS+HcLcPrCu9egi3Hx2XO7AbwkwkcTB+AeKjhX1p1rkS0AoCSuUy7Z46/TqgwoQhVnh5Hvwa6G2qwp1HmDGOPyL3UZijM4rLTLXzSiIJkVy9yQUHbgi5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cs4Clw9uLH9qLlHP0M9a5dQL62Gv7z+4SWuRaGz8hFKdHaj/rw4tlA38Zio3zjkB3J3RPHoYKhYAF79GBgoBfxJpXYYiFUj7+x91tpgBv3TK1oqCW1IC/V1GDngqxajRVWzix1bIcfkPd8QR54Fq1qqOc6MTETHmFysod2dANn4+vI3QT7cEJCA+prt17RzYnG9qWNKs3x0q3GEfybLmVxXpm6C07ISMPg4Ps4Znf+w8ihuKMt4SSmHLM5Kru8Q6W01mkfceqbIHjHgTkGfKUpZe3IZLwF/t6WWH2Kv/22d/vCYDxyrXxZBwtzHrLoX8Rh2bCm0HPP+mABeXSvT1Lg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • 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>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 03 Feb 2022 12:51:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.02.2022 13:48, Oleksandr Andrushchenko wrote:
> Hi, Jan!
> 
> On 03.02.22 14:44, Jan Beulich wrote:
>> On 03.02.2022 13:36, Oleksandr Andrushchenko wrote:
>>> 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.
>> Except that I guess BARs are special in that reads may not return ~0,
>> or else the low bits carry a meaning we don't want to convey. Unused
>> BARs need to be hard-wired to 0, I think.
> So, you mean we should have 2 sets of BAR handlers for guests:
> 1. normal emulation (these are implemented in this patch)
> 2. all other BARs: read 0/ignore write for all other BARs, including ROM, IO 
> etc.
> 
> Is this what you mean?

I think that's what we're going to need, yes.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.