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

Re: [PATCH] vpci/header: cope with devices not having vpci allocated


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 25 May 2023 15:27:11 +0200
  • 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=wgdESvyLJ7sYJsZcsTFjNWa6MQxCvm8r2d9D2ykKoFs=; b=KDxvSVeQjKHos+J79i0hb9go7jCyprHmzvgp/8bSSlpqonPqr/DLQrDNVKTN5DPVdBdLmWUpiXweb5fZML9IYds8Erm6FEtQaSP1FWsT98TV31Oo5+jR/mgUJfK/6LqnsbQP6vlI6FEQg9ui5mPi3vNU8KshpYX5HepXj4bV1lYww81qqlNnodvJQJAfYEdZNw9eFMQ+HPTYS3JAzhvia77gtS7clpFeGpA/cU8Zfved/5lirs4AaDpPumFMuwwg+yNz6gxJmntqpu/fgX7dgckuQfqytamQ5EwiHPiQTMdYaS0jzIeNTYkVK+xSw/8jIiPKuROc6qEo/VpuicQPQg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgiRxCjW5xWxRDW4JeWZuEY0Z1uO8v5mw1kOM1PmHfKcpvETg8XACH5HNj1P1jeV/P4wOA+LMtPbWTVrhtXOOJEhqM0Lqv9S3a2NmuXJFf3czGQPMar4td20nIOl+2fxQjKtsLwDmAvygNW2dOXJkb2mbDY2G/IHFo/yOHI2Y/ZiwY1ASWM9k0tpuEOF/gjlos0BV/X5h7ipK5LqGJtbbPC1yE9t9cJYCgvebb2/xZrH2JL9kQwzdhTUlpGmrzz5dli+3/J1QxXAeJDw06NIa47GCxdwyZU8bDW3c/sZjzuuFEy/kNvDr2KYQyMK4kSEy1crcY7BNNxkQ+ymHBwdRw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 25 May 2023 13:27:29 +0000
  • Ironport-data: A9a23:RAw4R6Lcvj7R9IF2FE+Rw5QlxSXFcZb7ZxGr2PjKsXjdYENS0jRSm GBNDGrUaf2NZ2CnKNAjboixpENU6MSBmIMxSwBlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpKrfrbwP9TlK6q4mhA4wZjPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c4qP29W0 sEaOQwoSRS7qO+dz+67DbFz05FLwMnDZOvzu1lG5BSAVbMKZM6GRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/dnpTGLlWSd05C0WDbRUsaNSshP2F6Ru 0rN/njjAwFcP9uaodaA2iv13r+Xx3yhCOr+EpW056dNnAGOw1cPDR06TXaxn6aDmheHDoc3x 0s8v3BGQbIJ3E6hQ8T5Xha4iGWZpRNaUN1Ve8Uq5QfIxqfK7gKxAmkfUiUHeNEgrNUxRzEhy hmOhdyBONB0mLicSHbY+rLKqzq3YHARNTVbPXZCShYZ6d7+po11lgjIUttoDK+yiJvyBC30x DeJ6iM5gt3/kPI26klyxnif6xrEm3QDZlRdCtn/No590j5EWQ==
  • Ironport-hdrordr: A9a23:TL7abaG7jXXHQa6ipLqELMeALOsnbusQ8zAXPiBKJCC9E/bo8v xG+c5w6faaslkssR0b9+xoW5PwI080l6QU3WB5B97LMDUO0FHCEGgI1/qA/9SPIUzDHu4279 YbT0B9YueAcGSTW6zBkXWF+9VL+qj5zEix792uq0uE1WtRGtldBwESMHf9LmRGADNoKLAeD5 Sm6s9Ot1ObCA8qhpTSPAhiYwDbzee77a7bXQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, May 25, 2023 at 11:05:52AM +0200, Jan Beulich wrote:
> On 25.05.2023 10:30, Roger Pau Monne wrote:
> > When traversing the list of pci devices assigned to a domain cope with
> > some of them not having the vpci struct allocated. It's possible for
> > the hardware domain to have read-only devices assigned that are not
> > handled by vPCI, or for unprivileged domains to have some devices
> > handled by an emulator different than vPCI.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> >  xen/drivers/vpci/header.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> > index ec2e978a4e6b..3c1fcfb208cf 100644
> > --- a/xen/drivers/vpci/header.c
> > +++ b/xen/drivers/vpci/header.c
> > @@ -289,6 +289,20 @@ static int modify_bars(const struct pci_dev *pdev, 
> > uint16_t cmd, bool rom_only)
> >       */
> >      for_each_pdev ( pdev->domain, tmp )
> >      {
> > +        if ( !tmp->vpci )
> > +            /*
> > +             * For the hardware domain it's possible to have devices 
> > assigned
> > +             * to it that are not handled by vPCI, either because those are
> > +             * read-only devices, or because vPCI setup has failed.
> 
> So this really is a forward looking comment, becoming true only (aiui)
> when my patch also makes it in.

The r/o part yes, device setup failing is already possible.

I think it's fine to have the r/o part added already.

> > +             * For unprivileged domains we should aim for passthrough 
> > devices
> > +             * to be capable of being handled by different emulators, and 
> > hence
> > +             * a domain could have some devices handled by vPCI and others 
> > by
> > +             * QEMU for example, and the later won't have pdev->vpci
> > +             * allocated.
> 
> This, otoh, I don't understand: Do we really intend to have pass-through
> devices handled by qemu or alike, for PVH? Or are you thinking of hybrid
> HVM (some vPCI, some qemu)?

I was thinking about hybrid.

> Plus, when considering hybrid guests, won't
> we need to take into account BARs of externally handled devices as well,
> to avoid overlaps?

On that scenario we would request non-overlapping BARs for things to
work as expected, I think that's already the case for HVM if you mix
QEMU and demu for the same domain.

> In any event, until the DomU side picture is more clear, I'd suggest we
> avoid making statements pinning down expectations. That said, you're the
> maintainer, so if you really want it like this, so be it.

OK, I don't have a strong opinion, so I'm fine with dropping the "For
unprivileged domains ..." paragraph.

Would you like me to resend with that dropped?

I assume you also want the commit message adjusted to not mention
unprivileged domains?

Thanks, Roger.



 


Rackspace

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