From: Daniel Vetter <daniel@ffwll.ch>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH] i915: Add module option to support VGA arbiter on HD devices
Date: Fri, 16 May 2014 11:06:49 +0200 [thread overview]
Message-ID: <20140516090649.GD8790@phenom.ffwll.local> (raw)
In-Reply-To: <1400215610.3289.174.camel@ul30vt.home>
On Thu, May 15, 2014 at 10:46:50PM -0600, Alex Williamson wrote:
> On Fri, 2014-05-16 at 00:50 +0200, Daniel Vetter wrote:
> > On Thu, May 15, 2014 at 11:43 PM, Alex Williamson
> > <alex.williamson@redhat.com> wrote:
> > > I don't know what to do with this. It seems like a lot of wishful
> > > thinking that in the best case would drag on for years. Even if we get
> > > VGA arbitration out of Xorg, the bit about making the userspace VGA
> > > arbiter interface lie depending on current->comm sounds tricky and
> > > horrible. If we can lie to Xorg there, why don't we do that now? If we
> > > can't lie to Xorg now, then what deprecation event or detection of the
> > > caller is going to allow us to do so in the future?
> >
> > Well we wouldn't necessarily need to lie to X, but could instead look
> > whether all the vga devices in a system are claimed by kms drivers. If
> > that's the case the userspace doesn't have an awful lot of business
> > touching the VGA registers and we could simply not obey a vga arb
> > request from userspace.
> >
> > More advanced would be if we still obey it for those devices not
> > claimed by kms drivers. So not really a need to key on current->comm.
>
> This is a requirement for me, I don't really care about KMS or Xorg, the
> use case I want to enable is binding a VGA device to vfio-pci so that it
> can be assigned to a guest virtual machine. This works on an unmodified
> kernel today so long as you don't have an Intel IGD in your system. If
> you do, we try to switch the VGA device, but it doesn't actually get
> switched because i915 opts-out of arbitration yet still claims VGA
> accesses.
I get that its a requirement for you.
I've also just detailed the solution for you above, but I'm not going to
write the patch itself (since I can't test it really).
We have two users of the vga-arb crap relevant here:
- pci/pci-sysfs.c, used by X through libpciaccess
- vfio/pci/vfio_pci_rdwr.c, for vfio-pci vga forwarding
Make the former lie if all vga devices have kms drivers and the latter
still work correctly. That will prevent X from going nasty if there are
kms drivers, while still keeping vfio going.
Then we re-re-revert the i915 to have proper vga-arb.
Afaics no need for hacks, module options, special casing or breaking old
userspace. And really, if there is a kms driver userspace has zero
business touching the vga registers, so imo we don't lose an real
functionality. You can always opt to not load kms drivers if you want
userspace access.
What am I missing?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-05-16 9:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 20:20 [PATCH] i915: Add module option to support VGA arbiter on HD devices Alex Williamson
2014-05-12 19:08 ` Daniel Vetter
2014-05-12 19:30 ` Alex Williamson
2014-05-12 19:38 ` Daniel Vetter
2014-05-15 21:43 ` Alex Williamson
2014-05-15 22:50 ` Daniel Vetter
2014-05-16 4:46 ` Alex Williamson
2014-05-16 9:06 ` Daniel Vetter [this message]
2014-05-16 14:38 ` Alex Williamson
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=20140516090649.GD8790@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox