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

Re: [PATCH 02/10] arm/pci: Maintain PCI assignable list


  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 11 Nov 2020 16:03:10 +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-SenderADCheck; bh=xXVqu6XMKSzoC832hSQGLGFgOtmCssn910dE3tCovKc=; b=f48dXWMII3VkkZ7XHgO5Viap5w09nZ1JF8cDA6opKNsZqLPxiTqANQUBJ4RWnVA/raUXib/lfMdma4l5K13YMFs5ojet5zcCbN/h8FHSzveJ7e/sajtQ9+nH33Et3DQ1HLi3NuU8sbamQERayvjKV4Ynj4X/WeYTgcuqJFQjmJVQMgdMXLyaEdE9bUBw0qsHD9xyfo2NpX7Xk6eVNFMsuQq0sWipQPtvQwV1GYQlzBOZHBFWW8rQ/FmWlcCO8eFYxS42J+Y/9cgMBNcqqAxKulRyZqQ2rc3igkF9zNqdp4PTztjQHMARJiwQMzNiE2M7/lT55dJxrs+12//CdD/ceA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jyvan3vHa4UaqiObbABMYi0o4eJJxgMcsiUFG2ZSUHC83KEHcyBi04TXZjwZfuAX7nTJF82HhKLTrUKrfAazRnDecs8RVh7XUzetGdsA+Xy1n3ZK9PsGqT2UyE83cNCcY1Y0vM+Ti074qTpUbDOcgsA69VUBhrpXwevkThGLm9G9BetWXuGZtw1ytDJNSWimbm7GbCgH4f0JWfvgiOoJeE33huvP5zGiqNZqonkXgcCmczaEGJyUNjZ+jUKa1eUcE4LvSBX/o9/abPsGaLCgx62OElfBH4f91mnp6CoF42V9NHcfA6WnvF8qB0RNQIWkdsAEJuP6laxMqPnD5/8eHg==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "Rahul.Singh@xxxxxxx" <Rahul.Singh@xxxxxxx>, "Bertrand.Marquis@xxxxxxx" <Bertrand.Marquis@xxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>
  • Delivery-date: Wed, 11 Nov 2020 15:03:42 +0000
  • Ironport-sdr: 4h6IwsyPdVDMcNBgZCEKOqENnunstA9BpifI2XHLgNhYyASY6d5ovV+c1rAfQ8MlAAdgJiJ+jt y1Sxlb3Q3yCcn3Y+nZ0pIlWqAF095xtvKVSXif/kY3VgcCX2SGbTwmbY8J3ZhmJPv4GecK+vT5 QH8pkmpAmOB2f5j3KNycQxsrP8ygTETh32cgkmRedLQDKUfLj2Jf8XrdVy62bvfMhxwxX4k4P7 9dCya7Q9Z9yQrvTB5fwd3+7qTISfeqlGVgiq+5lQ3ARfV7v/gsZwFkrcBKAyCqGNIuzrBYHLd/ E2Q=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Nov 11, 2020 at 02:38:47PM +0000, Oleksandr Andrushchenko wrote:
> On 11/11/20 3:53 PM, Roger Pau Monné wrote:
> > On Mon, Nov 09, 2020 at 02:50:23PM +0200, Oleksandr Andrushchenko wrote:
> >> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> >>
> >> The original code depends on pciback to manage assignable device list.
> >> The functionality which is implemented by the pciback and the toolstack
> >> and which is relevant/missing/needed for ARM:
> >>
> >> 1. pciback is used as a database for assignable PCI devices, e.g. xl
> >>     pci-assignable-{add|remove|list} manipulates that list. So, whenever 
> >> the
> >>     toolstack needs to know which PCI devices can be passed through it 
> >> reads
> >>     that from the relevant sysfs entries of the pciback.
> >>
> >> 2. pciback is used to hold the unbound PCI devices, e.g. when passing 
> >> through
> >>     a PCI device it needs to be unbound from the relevant device driver 
> >> and bound
> >>     to pciback (strictly speaking it is not required that the device is 
> >> bound to
> >>     pciback, but pciback is again used as a database of the passed through 
> >> PCI
> >>     devices, so we can re-bind the devices back to their original drivers 
> >> when
> >>     guest domain shuts down)
> >>
> >> 1. As ARM doesn't use pciback implement the above with additional sysctls:
> >>   - XEN_SYSCTL_pci_device_set_assigned
> > I don't see the point in having this sysfs, Xen already knows when a
> > device is assigned because the XEN_DOMCTL_assign_device hypercall is
> > used.
> 
> But how does the toolstack know about that? When the toolstack needs to
> 
> list/know all assigned devices it queries pciback's sysfs entries. So, with
> 
> XEN_DOMCTL_assign_device we make that knowledge available to Xen,
> 
> but there are no means for the toolstack to get it back.

But the toolstack will figure out whether a device is assigned or
not by using
XEN_SYSCTL_pci_device_get_assigned/XEN_SYSCTL_pci_device_enum_assigned?

AFAICT XEN_SYSCTL_pci_device_set_assigned tells Xen a device has been
assigned, but Xen should already know it because
XEN_DOMCTL_assign_device would have been used to assign the device?

> >
> >>   - XEN_SYSCTL_pci_device_get_assigned
> >>   - XEN_SYSCTL_pci_device_enum_assigned
> >> 2. Extend struct pci_dev to hold assignment state.
> > I'm not really found of this, the hypervisor is no place to store a
> > database like this, unless it's strictly needed.
> I do agree and it was previously discussed a bit
> >
> > IMO the right implementation here would be to split Linux pciback into
> > two different drivers:
> >
> >   - The pv-pci backend for doing passthrough to classic PV guests.
> Ok
> >   - The rest of pciback: device reset, hand-holding driver for devices
> >     to be assigned and database.
> 
> These and assigned devices list seem to be the complete set which
> 
> is needed by the toolstack on ARM. All other functionality provided by
> 
> pciback is not needed for ARM.
> 
> Jan was saying [1] that we might still use pciback as is, but simply use only
> 
> the functionality we need.
> 
> >
> > I think there must be something similar in KVM that performs the tasks
> > of my last point, maybe we could piggyback on it?
> I promised to look at it. I owe this
> >
> > If we want to go the route proposed by this patch, ie: Xen performing
> > the functions of pciback you would also have to move the PCI reset
> > code to Xen, so that you can fully manage the PCI devices from Xen.
> In case of dom0less this would be the case: no pciback, no Domain-0

But for dom0less there's no need for any database of assignable
devices, nor the need to perform pci device resets, as it's all
assigned at boot time and then never modified?

Roger.



 


Rackspace

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