[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 00/11] PCI devices passthrough on Arm, part 3


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 19 Nov 2021 15:23:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=MeklMwL1MzYLpBOSQucrFfty7Z2RRccaIAw5pIApugo=; b=Vwy26Dmjy0jsRD0ux5a/RjPgkz2tSKdHEn1y5cZp4Zk7lUx0aGKRJYXWEz+qiSPzK8kAg4DbjvOYM4GWPIjPn2Z35bCtgHsv9hL89QCDeiEkgc184HtxLerRXxQ0Onkjr+2vqT+Qlq+86dktB8FTkpBonFr4YmOLY2AQrWZ/3CcVdtzv+2HzGqs3smdz2Atcvl4yr7qptE0lC3b9q/S8+bsT6+hnyFKBjd1XIzWMkCMRGzE8x3X/OlQfi91/q3GDf/mQBtkBQWogW0WDSDp0zPRnqp6DKGrX4XnR+s8tC+kZDDQeIQdax7E3mDWHgYejQQ1X86rBFjXM8cQbEy3Saw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwuyZ2PAXKJuXSfwb7d28rzSenscRyRKAWJv7NUzUlYYF8a0MSgOWZoYTWCNPOcrN08FR5H1m+NfSL1J5KFo3GSYaL/QzD5IGCgpBfmi/DzBUz3Q/LMwxzkz5jBX/FlJlNaTeCgyeB2fbGcv3NT7Hb3vn+VEuEFlnwML8P/QPuAZbHm1GYYWSEwvD6CAOXLtRdXyDK4J7V6KmOuGmfxprXZIPdXT1jhDh93pWeH4HXT6cTa8yNj8NvBa1as7pfHmUd5gdKk700RRFWAW5ykRd8NSDrpgW5AyLj/efHX9gmHF34ZA6p+3gPHeDGtG6y3of585ouymnZ6dt9gr40sSiA==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, <julien@xxxxxxx>, <sstabellini@xxxxxxxxxx>, <oleksandr_tyshchenko@xxxxxxxx>, <volodymyr_babchuk@xxxxxxxx>, <Artem_Mygaiev@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <paul@xxxxxxx>, <bertrand.marquis@xxxxxxx>, <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 Nov 2021 14:23:58 +0000
  • Ironport-data: A9a23:NR+7va1c5FO137lke/bD5ep3kn2cJEfYwER7XKvMYLTBsI5bpzNRz GMaX2GEafzcM2Ghft4na47n9UxUsZPdx9AxTQRopC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkS5PE3oHJ9RGQ74nRLlbHILOCan8ZqTNMEn970Es6wr9h2+aEvPDia++zk YKqyyHgEAfNNw5cagr4PIra9XuDFNyr0N8plgRWicJj5TcypFFMZH4rHomjLmOQf2VhNrXSq 9Avbl2O1jixEx8FUrtJm1tgG6EAaua60QOm0hK6V0U+6/TrS+NbPqsTbZIhhUlrZzqhuJchx uV1hIGLQhZwFJTiktsnTCZiDHQrVUFG0OevzXmXtMWSywvNcmf2wuUoB0YzVWEa0r8pWycUr 6VecW1TKEDY7w616OvTpu1EnMMsIdOtJIoCknph0SvYHbAtRpWrr6DiuI8BjG1t15km8fD2T cYpWwVLfkX7WgBiN00rArgOv/yKmSy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vrjguBGLwIQGlrOZPSsTLnULW3f9IHZRSaxrgZ RhRNLWy9CwbmlLzf4nvAvOAB0/oJ6j1QsWc5AxkJLm+8szWxp794GpUNTeLOUFYLw2MkkNS95V Zsk8WTFzoShVOYdu1JIUDQyDdsFvlyZNVTwtUgGgOZBa5Oa7MPs3xeEYSzodyETQQUsbKeVT2f HXCYwS8TkC/k/jfw7PWx/7sK
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Nov 19, 2021 at 02:56:12PM +0100, Jan Beulich wrote:
> On 05.11.2021 07:56, Oleksandr Andrushchenko wrote:
> > From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> > 
> > Hi, all!
> > 
> > This patch series is focusing on vPCI and adds support for non-identity
> > PCI BAR mappings which is required while passing through a PCI device to
> > a guest. The highlights are:
> > 
> > - 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 based on physical BAR 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.
> > 
> > - Instead of handling a single range set, that contains all the memory
> >   regions of all the BARs and ROM, have them per BAR.
> > 
> > - Take into account guest's BAR view and program its p2m accordingly:
> >   gfn is guest's view of the BAR and mfn is the physical BAR value as set
> >   up by the host bridge in the hardware domain.
> >   This way hardware doamin sees physical BAR values and guest sees
> >   emulated ones.
> > 
> > The series also adds support for virtual PCI bus topology for guests:
> >  - We emulate a single host bridge for the guest, so segment is always 0.
> >  - The implementation is limited to 32 devices which are allowed on
> >    a single PCI bus.
> >  - The virtual bus number is set to 0, so virtual devices are seen
> >    as embedded endpoints behind the root complex.
> > 
> > The series was also tested on:
> >  - x86 PVH Dom0 and doesn't break it.
> >  - x86 HVM with PCI passthrough to DomU and doesn't break it.
> > 
> > Thank you,
> > Oleksandr
> > 
> > Oleksandr Andrushchenko (11):
> >   vpci: fix function attributes for vpci_process_pending
> >   vpci: cancel pending map/unmap on vpci removal
> >   vpci: make vpci registers removal a dedicated function
> >   vpci: add hooks for PCI device assign/de-assign
> >   vpci/header: implement guest BAR register handlers
> >   vpci/header: handle p2m range sets per BAR
> >   vpci/header: program p2m with guest BAR view
> >   vpci/header: emulate PCI_COMMAND register for guests
> >   vpci/header: reset the command register when adding devices
> >   vpci: add initial support for virtual PCI bus topology
> >   xen/arm: translate virtual PCI bus topology for guests
> 
> If I'm not mistaken by the end of this series a guest can access a
> device handed to it. I couldn't find anything dealing with the
> uses of vpci_{read,write}_hw() and vpci_hw_{read,write}*() to cover
> config registers not covered by registered handlers. IMO this should
> happen before patch 5: Before any handlers get registered the view a
> guest would have would be all ones no matter which register it
> accesses. Handler registration would then "punch holes" into this
> "curtain", as opposed to Dom0, where handler registration hides
> previously visible raw hardware registers.

FWIW, I've also raised the same concern in a different thread:

https://lore.kernel.org/xen-devel/YYD7VmDGKJRkid4a@Air-de-Roger/

It seems like this is future work, but unless such a model is
implemented vPCI cannot be used for guest passthrough.

I'm fine with doing it in a separate series, but needs to be kept in
mind.

Regards, Roger.



 


Rackspace

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