All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Zmudzinski <brchuckz@netscape.net>
To: Andrew Cooper <amc96@srcf.net>,
	Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [XEN PATCH] tools/libs/light/libxl_pci.c: explicitly grant access to Intel IGD opregion
Date: Wed, 30 Mar 2022 23:54:23 -0400	[thread overview]
Message-ID: <46a8585e-2a2a-4d12-f221-e57bd157dec6@netscape.net> (raw)
In-Reply-To: <408e5e07-453c-f377-a5b0-c421d002aec5@srcf.net>

On 3/30/22 1:27 PM, Andrew Cooper wrote:
> On 30/03/2022 18:15, Anthony PERARD wrote:
>>
>> Some more though on that, looking at QEMU, it seems that there's already
>> a call to xc_domain_iomem_permission(), in igd_write_opregion().
> This has been discussed before, but noone's done anything about it.
> It's a massive layering violation for QEMU to issue
> xc_domain_iomem_permission()/etc hypercalls.
>
> It should be the toolstack, and only the toolstack, which makes
> permissions hypercalls, which in turn will fix a slew of "QEMU doesn't
> work when it doesn't have dom0 superpowers" bugs with stubdomains.

How much say does the Xen project have over the code
in Qemu under hw/xen? I would not be against having libxl
do the permissions hypercalls in this case instead of Qemu
doing it. My test with Qemu traditional and this patch proves
the permission can be granted by libxl instead of the device
model.
> In this case specifically, the opregion is a magic Intel graphics
> specific bodge.  The i915 driver in the guest really does need to access
> part of the real PCH during init, which (in Xen's permission model)
> really does require permitting access to the MMIO range (8k iirc) so it
> can be mapped as a BAR in QEMU's emulated PCH.

That is exactly what my testing confirmed, but in my
tests only Linux guests need access to the magic Intel
opregion. The proprietary Windows Intel graphics
drivers are apparently able to work around lack of
access to the opregion, at least on my system, and
Windows guests with Intel IGD passthrough function
very well without needing this patch. So the problem
could be fixed in the Linux i915 kernel driver, but Intel
has not contributed the magic sauce to the Linux kernel
that would enable Linux guests to work without access
to the Intel opregion.

And you are correct, the opregion is 8k (2 pages) in size,
but it is not always page aligned, as mentioned earlier,
so the IGD_OPREGION_PAGES constant is set to 3 instead
of 2.

Chuck


  reply	other threads:[~2022-03-31  3:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b62fbc602a629941c1acaad3b93d250a3eba33c0.1647222184.git.brchuckz.ref@netscape.net>
2022-03-14  3:41 ` [XEN PATCH] tools/libs/light/libxl_pci.c: explicitly grant access to Intel IGD opregion Chuck Zmudzinski
2022-03-15 11:38   ` Jan Beulich
2022-03-15 18:31     ` Chuck Zmudzinski
2022-03-16  1:27     ` Chuck Zmudzinski
2022-03-16 12:18       ` Chuck Zmudzinski
2022-03-28 21:31     ` Chuck Zmudzinski
2022-03-18  8:13   ` Jan Beulich
2022-03-30 18:45     ` Jason Andryuk
2022-03-31  4:34       ` Chuck Zmudzinski
2022-03-31 12:23         ` Jason Andryuk
2022-03-31 13:57           ` Chuck Zmudzinski
2022-04-01 13:21       ` Chuck Zmudzinski
2022-04-01 13:41         ` Chuck Zmudzinski
2022-04-01 13:49           ` Jason Andryuk
2022-04-06  1:31         ` Chuck Zmudzinski
2022-04-06 13:10           ` Jason Andryuk
2022-04-06 15:24             ` Chuck Zmudzinski
2022-04-06 17:39             ` Chuck Zmudzinski
2022-03-30 17:15   ` Anthony PERARD
2022-03-30 17:27     ` Andrew Cooper
2022-03-31  3:54       ` Chuck Zmudzinski [this message]
2022-03-31 12:29         ` Jason Andryuk
2022-03-31 14:05           ` Chuck Zmudzinski
2022-03-31 14:19             ` Jason Andryuk
2022-03-31 19:44               ` Chuck Zmudzinski
2022-06-17 13:46                 ` Anthony PERARD
2022-06-17 20:39                   ` Chuck Zmudzinski
2022-03-31  2:41     ` Chuck Zmudzinski
2022-03-31 18:32     ` Chuck Zmudzinski
2022-04-01  0:27       ` Chuck Zmudzinski
2022-03-31 23:23     ` Chuck Zmudzinski
2022-06-04  1:10     ` Chuck Zmudzinski
2022-06-06 18:47       ` Chuck Zmudzinski
     [not found] <b11b0b13-4f10-7d77-d02d-bb9a22bce887@netscape.net>
2022-03-15 17:25 ` Chuck Zmudzinski

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=46a8585e-2a2a-4d12-f221-e57bd157dec6@netscape.net \
    --to=brchuckz@netscape.net \
    --cc=amc96@srcf.net \
    --cc=anthony.perard@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=wl@xen.org \
    --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.