From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] libxl+hvmloader: extend IGD check part 2
Date: Tue, 8 Apr 2025 17:28:53 +0200 [thread overview]
Message-ID: <Z_VJEPQaFuebdH3V@mail-itl> (raw)
In-Reply-To: <7c8cfe6d-6d61-44e5-b1ba-8a7795424977@suse.com>
[-- Attachment #1: Type: text/plain, Size: 2046 bytes --]
On Tue, Apr 08, 2025 at 04:11:36PM +0200, Jan Beulich wrote:
> On 08.04.2025 15:23, Marek Marczykowski-Górecki wrote:
> > --- a/tools/firmware/hvmloader/pci.c
> > +++ b/tools/firmware/hvmloader/pci.c
> > @@ -173,6 +173,7 @@ void pci_setup(void)
> > switch ( class )
> > {
> > case 0x0300:
> > + case 0x0380:
> > /* If emulated VGA is found, preserve it as primary VGA. */
> > if ( (vendor_id == 0x1234) && (device_id == 0x1111) )
> > {
>
> Unlike here, where vendor IDs are subsequently checked (and the sole question
> that arises is whether any of the combinations can actually come as Display
> rather than VGA), ...
>
> > --- a/tools/libs/light/libxl_pci.c
> > +++ b/tools/libs/light/libxl_pci.c
> > @@ -2575,7 +2575,8 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,
> >
> > if (sysfs_dev_get_class(gc, pci, &pci_device_class))
> > continue;
> > - if (pci_device_class != 0x030000) /* VGA class */
> > + if (pci_device_class != 0x030000 && /* VGA class */
> > + pci_device_class != 0x038000) /* Display class */
> > continue;
>
> ... there's no such checking here, and instead very much VGA-specific things
> are being done then. Is that really in line with permitting Display class
> devices here as well?
Well, it was necessary to get IGD passthrough working. But I think
upstream Xen still doesn't have all the pieces here. Specifically,
Qubes's version includes (a variant of)
https://lore.kernel.org/xen-devel/87d74a21bde95cfc7c53fad56bf8f0e47724953e.1592171394.git.gorbak25@gmail.com/T/#m8644141760ee36d691434dfaf55031110492929b
and that adds here access not only to the video memory, but also vbios,
which was needed to get it working.
Anyway, this code is reachable only if gfx_passthrou is enabled and
currently this option is specific to IGD.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-04-08 16:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 13:23 [PATCH] libxl+hvmloader: extend IGD check part 2 Marek Marczykowski-Górecki
2025-04-08 13:31 ` Andrew Cooper
2025-04-08 13:34 ` Marek Marczykowski-Górecki
2025-04-08 14:07 ` Jan Beulich
2025-04-08 14:11 ` Jan Beulich
2025-04-08 15:28 ` Marek Marczykowski-Górecki [this message]
2025-05-21 13:31 ` Anthony PERARD
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=Z_VJEPQaFuebdH3V@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=roger.pau@citrix.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.