public inbox for ksummit@lists.linux.dev
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	ksummit@lists.linux.dev, linux-cxl@vger.kernel.org,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	jgg@nvidia.com
Subject: Re: [MAINTAINERS SUMMIT] Device Passthrough Considered Harmful?
Date: Wed, 24 Jul 2024 23:00:12 +0300	[thread overview]
Message-ID: <20240724200012.GA23293@pendragon.ideasonboard.com> (raw)
In-Reply-To: <1e82a5c97e915144e01dd65575929c15bc0db397.camel@HansenPartnership.com>

On Tue, Jul 23, 2024 at 07:36:24AM -0400, James Bottomley wrote:
> On Tue, 2024-07-23 at 13:20 +0200, Jiri Kosina wrote:
> > On Mon, 8 Jul 2024, Dan Williams wrote:
> > 
> > > 2/ Device passthrough, kernel passing opaque payloads, is already
> > > taken for granted in many subsystems. USB and HID have "raw"
> > > interfaces
> > 
> > Just as a completely random datapoint here: after I implemented
> > hidraw inteface long time ago, I was a little bit hesitant about
> > really merging it, because there was a general fear that this would
> > shatter the HID driver ecosystem, making it difficult for people to
> > find proper drivers  for their devices, etc.
> 
> The problem with hidraw is that userspace has to understand the device
> to use it, but a lot of HID devices (keyboards, mice, serial ports,
> etc.) want to fit into an existing ecosystem so they have to have a
> kernel driver to avoid having to update all the user applications. 
> However, entirely new devices don't have the existing ecosystem
> problem.
> 
> > Turns out that that didn't happen. Drivers for generic devices are
> > still implemented properly in the kernel, and hidraw is mostly used
> > for rather specific, one-off solutions, where the vendor's business
> > plan is "ship this one appliance and forget forever", which doesn't
> > really cause any harm to the whole ecosystem.
> 
> That's not entirely true.  FIDO tokens (the ones Konstantin is
> recommending for kernel.org access) are an entire class of devices that
> use hidraw and don't have a kernel driver.  There's an array of
> manufacturers producing them, but the CTAP specification and its
> conformance is what keeps a single user mode driver (which is now
> present as a separate implementation in all web browsers and the
> userspace libfido2) for all of them.  Fido is definitely not a one off,
> but on the other hand, not having a kernel driver doesn't seem to harm
> the ecosystem and they can get away with it because there was no
> existing device type for them to fit into (except, as you say, an array
> of incompatible and short lived USB key tokens which annoyed everyone
> by having usability limits due to the oneoffness).

While "userspace drivers" often cause allergic reactions, I think I
won't cause a controversy if I say that we are all used to them in
certain areas. My heart rate will increase if someone proposes replacing
a USB webcam driver with a libusb-based solution, but I don't lose sleep
over the fact that my GPU is mostly controlled by code in Mesa.

What I get from the discussions I've followed or partcipated in over the
years is that the main worry of free software communities is being
forced to use closed-source userspace components, whether that would be
to make the device usable at all, or to achieve decent level of
performance or full feature set. We've been through years of mostly
closed-source GPU support, of printer "windrivers", and quite a few
other horrors. The good news is that we've so far overcome lots (most)
of those challenges. Reverse engineering projects paid off, and so did
working hand-in-hand with industry actors in multiple ways (both openly
and behind the scenes). One could then legitimately ask why we're still
scared.

I can't fully answer that question, but there are two points that I
think are relevant. Note that due to my background and experience, this
will be heavily biased towards consumer and embedded hardware, not data
centre-grade devices. Some technologies from the latter however have a
tendency to migrate to the former over time, so the distinction isn't
necessarily as relevant as one may consider.

The first point is that hardware gets more complicated over time, and in
some markets there's also an increase in the number of vendors and
devices. There's a perceived (whether true or not) danger that we won't
be able to keep up with just reverse engineering and a development model
relying on hobyists. Getting vendors involved is important if we want to
scale.

Second, I think there's a fear of regression. For some categories of
devices, we have made slow but real progress to try and convince the
industry to be more open. This sometimes took a decade of work,
patiently building bridges and creating ecosystems brick by brick. Some
of those ecosystems are sturdy, some not so. Giving pass-through a blank
check will likely have very different effects in different areas. I
don't personally believe it will shatter everything, but I'm convinced
it carries risk in areas where cooperation with vendors is in its
infancy or is fragile for any other reason.

Finally, let's not forget that pass-through APIs are not an all or
nothing option. To cite that example only, DRM requires GPU drivers to
have an open-source userspace implementation to merge the kernel driver,
and the same subsystems strongly pushes for API standardization for
display controllers. We can set different rules for different cases.

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2024-07-24 20:00 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 22:26 [MAINTAINERS SUMMIT] Device Passthrough Considered Harmful? Dan Williams
2024-07-09  6:09 ` Christoph Hellwig
2024-07-09 19:43   ` Dan Williams
2024-07-10 13:05     ` Jason Gunthorpe
2024-07-21 18:51       ` Laurent Pinchart
2024-07-22 13:27         ` Jason Gunthorpe
2024-07-09 10:01 ` Greg KH
2024-07-09 12:25   ` Leon Romanovsky
2024-07-09 12:33     ` Greg KH
2024-07-09 12:47       ` Leon Romanovsky
2024-07-11 14:07         ` Jason Gunthorpe
2024-07-09 20:09   ` Dan Williams
2024-07-09 16:02 ` James Bottomley
2024-07-09 22:15   ` Dan Williams
2024-07-10 13:22     ` Jonathan Cameron
2024-07-11 11:00       ` Jonathan Cameron
2024-07-11 15:05       ` Jason Gunthorpe
2024-07-11 17:01         ` Jonathan Cameron
2024-07-11 17:45           ` Jason Gunthorpe
2024-07-11 16:36       ` Dan Williams
2024-07-12 10:37         ` Jonathan Cameron
2024-07-21 19:25     ` Laurent Pinchart
2024-07-22  7:31       ` Leon Romanovsky
2024-07-22  8:53         ` Laurent Pinchart
2024-07-22 10:44           ` Leon Romanovsky
2024-07-22 11:10             ` Laurent Pinchart
2024-07-22 13:28               ` Leon Romanovsky
2024-07-22 14:13                 ` Laurent Pinchart
2024-07-22 14:43                   ` Jason Gunthorpe
2024-07-22 10:42       ` Ricardo Ribalda Delgado
2024-07-22 11:18         ` Laurent Pinchart
2024-07-22 11:56           ` Ricardo Ribalda Delgado
2024-07-25 20:01             ` Laurent Pinchart
2024-07-26  8:04               ` Ricardo Ribalda Delgado
2024-07-26 10:59                 ` Laurent Pinchart
2024-07-26 15:40                   ` Ricardo Ribalda Delgado
2024-07-28 17:18                     ` Laurent Pinchart
2024-07-29  9:58                       ` Ricardo Ribalda Delgado
2024-07-29 10:31                         ` Laurent Pinchart
2024-07-31 11:54                         ` Sakari Ailus
2024-07-31 13:15                           ` Daniel Vetter
2024-08-02 15:07                             ` Laurent Pinchart
2024-08-13 10:17                             ` Tomasz Figa
2024-08-13 10:26                               ` Laurent Pinchart
2024-08-13 10:33                                 ` Tomasz Figa
2024-08-13 10:58                                   ` Laurent Pinchart
2024-07-11 13:50   ` Jason Gunthorpe
2024-07-11 15:16     ` James Bottomley
2024-07-11 16:29       ` Jason Gunthorpe
2024-07-23 11:20 ` Jiri Kosina
2024-07-23 11:36   ` James Bottomley
2024-07-23 23:22     ` Jiri Kosina
2024-07-24 20:12       ` James Bottomley
2024-07-24 20:00     ` Laurent Pinchart [this message]
2024-07-24 20:37       ` James Bottomley
2024-07-24 21:10         ` Steven Rostedt
2024-07-25 19:31         ` Laurent Pinchart
2024-07-25 19:43           ` Jason Gunthorpe
2024-07-25 20:07             ` Laurent Pinchart
2024-07-25 23:39               ` Jason Gunthorpe
2024-07-26  8:04               ` Ricardo Ribalda Delgado
2024-07-26 12:49                 ` Laurent Pinchart
2024-07-26 13:11                   ` Jason Gunthorpe
2024-07-26 14:22                     ` Laurent Pinchart
2024-07-26 15:43                       ` Ricardo Ribalda Delgado
2024-07-28 15:25                         ` Laurent Pinchart
2024-07-29  9:57                           ` Ricardo Ribalda Delgado
2024-07-29 14:20                       ` Jason Gunthorpe
2024-07-26  8:03           ` Ricardo Ribalda Delgado
2024-07-26 13:22             ` Laurent Pinchart
2024-07-26 15:44               ` Ricardo Ribalda Delgado
2024-07-28 17:02                 ` Laurent Pinchart
2024-07-26 16:49           ` James Bottomley
2024-07-28 16:44             ` Laurent Pinchart
2024-07-26 17:33         ` Daniel Vetter
2024-07-29 14:10           ` Jason Gunthorpe
2024-07-25  9:26       ` Ricardo Ribalda Delgado
2024-07-25 10:51         ` Wolfram Sang
2024-07-25 12:23         ` Leon Romanovsky
2024-07-25 13:02           ` Ricardo Ribalda Delgado
2024-07-25 13:20             ` Leon Romanovsky
2024-07-25 13:29               ` Mark Brown
2024-07-25 14:18                 ` Leon Romanovsky
2024-07-25 14:22                   ` James Bottomley
2024-07-25 17:37                     ` Leon Romanovsky
2024-07-26 13:58                       ` James Bottomley
2024-07-25 19:42               ` Laurent Pinchart
2024-07-26  8:02                 ` Ricardo Ribalda Delgado
2024-07-26 13:11                   ` Laurent Pinchart
2024-07-26 15:40                     ` Ricardo Ribalda Delgado
2024-07-28 11:23                       ` Laurent Pinchart
2024-07-29  9:56                         ` Ricardo Ribalda Delgado
2024-07-29 10:38                           ` Laurent Pinchart
2024-07-26 16:01                     ` James Bottomley
2024-07-26 17:56                       ` Laurent Pinchart
2024-07-25 13:44             ` Steven Rostedt
2024-07-26 14:27 ` Laurent Pinchart
2024-07-26 15:34   ` Steven Rostedt
2024-07-28 16:03     ` Laurent Pinchart
2024-07-27  0:16   ` Dan Williams
2024-07-28 11:18     ` Laurent Pinchart
2024-07-28 15:16       ` Greg KH
2024-07-28 15:34         ` Laurent Pinchart
2024-07-28 15:49         ` James Bottomley
2024-07-29  6:10           ` Greg KH
2024-07-31 12:33             ` James Bottomley
2024-07-31 12:45               ` Laurent Pinchart
2024-08-01 14:41               ` Jason Gunthorpe
2024-08-07  0:06                 ` Dan Williams
2024-08-07  0:13                   ` James Bottomley
2024-08-16 11:12                   ` Hannes Reinecke
2024-07-29 14:56           ` Jakub Kicinski
2024-07-29 15:16             ` Greg KH
2024-07-29 15:29             ` Jason Gunthorpe
2024-07-29 12:45 ` Jonathan Cameron
2024-07-29 13:38   ` Borislav Petkov
2024-07-29 14:29     ` Jonathan Cameron
2024-07-29 14:58       ` Jason Gunthorpe
2024-07-30 13:19         ` Borislav Petkov
2024-08-01 14:23           ` Jason Gunthorpe
2024-07-29 15:42   ` Jason Gunthorpe
2024-07-29 22:37     ` Dan Williams
2024-07-30  7:13       ` Daniel Vetter
2024-08-01 14:22         ` Jason Gunthorpe
2024-08-06  7:14           ` Daniel Vetter
2024-08-06 13:04             ` Jason Gunthorpe

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=20240724200012.GA23293@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dan.j.williams@intel.com \
    --cc=jgg@nvidia.com \
    --cc=jikos@kernel.org \
    --cc=ksummit@lists.linux.dev \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@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