[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: Fri, 26 Nov 2021 12:19:35 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; 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=4CJN6twaB/kwiO/2k7M17iV0qjqIB85527pwEKBSqL4=; b=OE5NniKjdngx0CB5YQ1o+1cVHjqVz/EEsmyKLUpTbJUPDEO8HPOMLGzoqtqtX6rc03Sl6gzanQWviGRqe3QFdPczV9KCzIGcSzP4oZDG1U/MG4fA/KpZxjSF256ZPVcZwxIvt47yhGjIqWkpMKyQFYHvf+jJXVh3bQ939K6tIZUlfh8AQEwPHDF9cio9gdgHa/Wt/6kMCt9nIGfBxHFLIizvgn3NMjB1opUHYeJAiPANyESPDUZI5qz6UKWKnDeNx2pK0/74ck4gxocYeC1Lu+V3pxnwY68IwqrDViEOsxePVkLS4xQwp+e4yI/+PyYPYDhE86yC0p3AnOocGZac/w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ORb6+PizVGtoovzi9WJhKaX6voejuoNyKFAtlN3PQMjRwO7Epdzu5iSd5TfrgtESaLR88Pz32nICQZw9ng0/c720WzoORPJGlIlMQy4iAsUvSWzH4QZiAebLiDOIRpIFeOyN680Asx9HEWH1uCdKocXsqVKufD+9KuuaK6Hn7ipBGrMZIKxLPmKMklzQr0XlSrlHb8MkRqb4aDpy2SN1ua5osrqTdHqVYrbA6VqYk7Z2TKltu2jw+aEeyVqOp/Jic3YWHZKMYKbSnKH2lHt+P9QjSbYfhzxQSxu0QxzDcnLEq53kncpe2avGlq3dh169yUIMIomDjmmQZemiEGHF2w==
- 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>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Fri, 26 Nov 2021 12:20:13 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX4ewHyWAyD811HEGp8pIjUuVWNawUby8AgAFMuIA=
- Thread-topic: [PATCH v5 06/14] vpci/header: implement guest BAR register handlers
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
>
> I think we should instead make sure that we intercept all accesses to BARs
> and return
> something empty for IOPORTS BARs.
I would like to hear from Roger on what was the initial plan for that, so
we are aligned between the different architectures, Arm and x86 here for now
Thank you,
Oleksandr
|