All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@vates.tech>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device
Date: Fri, 26 Jul 2024 14:20:48 +0000	[thread overview]
Message-ID: <ZqOwv6j6Xh+RfITd@l14> (raw)
In-Reply-To: <ZqJeRpv0leu3vWuf@mail-itl>

On Thu, Jul 25, 2024 at 04:16:37PM +0200, Marek Marczykowski-Górecki wrote:
> On Thu, Jul 25, 2024 at 02:06:04PM +0000, Anthony PERARD wrote:
> > On Thu, May 16, 2024 at 03:58:28PM +0200, Marek Marczykowski-Górecki wrote:
> > > Especially allow it to control MSI/MSI-X enabling bits. This part only
> > > writes a flag to a sysfs, the actual implementation is on the kernel
> > > side.
> > >
> > > This requires Linux >= 5.10 in dom0 (or relevant patch backported).
> >
> > Does it not work before 5.10? Because the
> > Documentation/ABI/testing/sysfs-driver-pciback in linux tree say that
> > allow_interrupt_control is in 5.6.
>
> For MSI-X to work at least with Linux it needs a fixup
> 2c269f42d0f382743ab230308b836ffe5ae9b2ae, which was backported to
> 5.10.201, but not further.
>
> > > diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
> > > index 96cb4da0794e..6f357b70b815 100644
> > > --- a/tools/libs/light/libxl_pci.c
> > > +++ b/tools/libs/light/libxl_pci.c
> > > @@ -1513,6 +1513,14 @@ static void pci_add_dm_done(libxl__egc *egc,
> > >              rc = ERROR_FAIL;
> > >              goto out;
> > >          }
> > > +    } else if (libxl_is_stubdom(ctx, domid, NULL)) {
> > > +        /* Allow acces to MSI enable flag in PCI config space for the stubdom */
> >
> > s/acces/access/
> >
> > > +        if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/allow_interrupt_control",
> > > +                             pci) < 0 ) {
> > > +            LOGD(ERROR, domainid, "Setting allow_interrupt_control for device");
> > > +            rc = ERROR_FAIL;
> > > +            goto out;
> >
> > Is it possible to make this non-fatal for cases where the kernel is
> > older than the introduction of the new setting? Or does pci passthrough
> > doesn't work at all with a stubdom before the change in the kernel?
>
> MSI/MSI-X will not work. And if QEMU wouldn't hide MSI/MSI-X (upstream
> one doesn't), Linux won't fallback to INTx, so the device won't work at
> all.

Ok

I guess this patch is fine then:
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

--

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



  reply	other threads:[~2024-07-26 14:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
2024-05-17 20:57   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 02/12] automation: update fedora build to F39 Marek Marczykowski-Górecki
2024-05-17 20:57   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 03/12] automation: switch to alpine:3.19 Marek Marczykowski-Górecki
2024-05-17 21:58   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 04/12] automation: increase verbosity of starting a domain Marek Marczykowski-Górecki
2024-05-17 21:50   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 05/12] automation: prevent grub unpacking initramfs Marek Marczykowski-Górecki
2024-05-17 21:51   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test Marek Marczykowski-Górecki
2024-05-18  0:40   ` Stefano Stabellini
2024-05-18  1:28     ` Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device Marek Marczykowski-Górecki
2024-07-25 14:06   ` Anthony PERARD
2024-07-25 14:16     ` Marek Marczykowski-Górecki
2024-07-26 14:20       ` Anthony PERARD [this message]
2024-05-16 13:58 ` [PATCH 08/12] automation: update kernel for x86 tests Marek Marczykowski-Górecki
2024-05-17 21:53   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 09/12] WIP: automation: temporarily add 'testlab' tag to stubdomain build Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 10/12] automation: stubdom test with PCI passthrough Marek Marczykowski-Górecki
2024-05-18  0:41   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 11/12] automation: stubdom test with boot from CDROM Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 12/12] [DO NOT MERGE] switch to my containers fork Marek Marczykowski-Górecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZqOwv6j6Xh+RfITd@l14 \
    --to=anthony.perard@vates.tech \
    --cc=jgross@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.