public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Simon Que <sque@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ben Chan <benchan@chromium.org>,
	Chun-Ta Lin <itspeter@chromium.org>,
	Zhongze Hu <frankhu@chromium.org>, Joe Perches <joe@perches.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Rob Springer <rspringer@google.com>,
	John Joseph <jnjoseph@google.com>,
	linux-fpga@kernel.org
Subject: Re: [PATCH v7] drivers/staging: Gasket driver framework + Apex driver
Date: Sat, 30 Jun 2018 15:07:46 +0100	[thread overview]
Message-ID: <20180630150746.38d69e92@alans-desktop> (raw)
In-Reply-To: <20180630024938.107529-1-sque@chromium.org>

> The Gasket (Google ASIC Software, Kernel Extensions, and Tools) kernel
> framework is a generic, flexible system that supports thin kernel
> drivers. Gasket kernel drivers are expected to handle opening and
> closing devices, mmap'ing BAR space as requested, a small selection of
> ioctls, and handling page table translation (covered below). Any other
> functions should be handled by userspace code.

So it seems to me that we shouldn't have one random layer for Google
ASIC, another chunk of code for FPGA and so on. This all really ought to
be unified including where possible making things meaningfully self
describe.

You also don't seem to consider partitioning of an ASIC, eg if it
implements a serial port abstraction for debug that ought to routed to
the kernel, nor how to handle an ASIC that provides services to multiple
consumers ?

> One of the core assumptions of the Gasket framework is that precisely
> one process is allowed to have an open write handle to the device node
> at any given time. (That process may, once it has one write handle, open

Why ? That's a very un-Linuxlike and un-Unixlike model. It's more like
Windows and with all the problems we know that model causes.

> any number of additional write handles.) This is accomplished by
> tracking open and close data for each driver instance.

What if I want to have multiple threads not sharing an mm, or pass an
ASIC by handle to another instance - eg if I have a master process
assigning resources wanting to pass a handle into a container ?

And what about fd passing ?

It seems completely weird to try and do this given I can (given
permissions) equally just ptrace the person with it open and use ptrace
as a multiplexor ???


Also how about pointers to a real world use case example and user space ?

Alan

      parent reply	other threads:[~2018-06-30 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-30  2:49 [PATCH v7] drivers/staging: Gasket driver framework + Apex driver Simon Que
2018-06-30  3:21 ` Joe Perches
2018-06-30 14:07 ` Alan Cox [this message]

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=20180630150746.38d69e92@alans-desktop \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=benchan@chromium.org \
    --cc=frankhu@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=itspeter@chromium.org \
    --cc=jnjoseph@google.com \
    --cc=joe@perches.com \
    --cc=linux-fpga@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rspringer@google.com \
    --cc=sque@chromium.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