From: Arnd Bergmann <arnd@arndb.de>
To: Timur Tabi <timur@freescale.com>
Cc: kumar.gala@freescale.com, benh@kernel.crashing.org,
greg@kroah.com, akpm@kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-console@vger.kernel.org
Subject: Re: [PATCH 7/7] [v2] drivers/misc: introduce Freescale hypervisor management driver
Date: Wed, 1 Jun 2011 23:40:14 +0200 [thread overview]
Message-ID: <201106012340.14237.arnd@arndb.de> (raw)
In-Reply-To: <1306953337-15698-1-git-send-email-timur@freescale.com>
On Wednesday 01 June 2011, Timur Tabi wrote:
> The Freescale hypervisor management driver provides several services to
> drivers and applications related to the Freescale hypervisor:
>
> 1. An ioctl interface for querying and managing partitions
>
> 2. A file interface to reading incoming doorbells
>
> 3. An interrupt handler for shutting down the partition upon receiving the
> shutdown doorbell from a manager partition
>
> 4. An interface for receiving callbacks when a managed partition shuts down.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/misc/Kconfig | 7 +
> drivers/misc/Makefile | 1 +
> drivers/misc/fsl_hypervisor.c | 941 ++++++++++++++++++++++++++++++++++++++++
> include/linux/Kbuild | 1 +
> include/linux/fsl_hypervisor.h | 203 +++++++++
> 5 files changed, 1153 insertions(+), 0 deletions(-)
> create mode 100644 drivers/misc/fsl_hypervisor.c
> create mode 100644 include/linux/fsl_hypervisor.h
I think drivers/misc is not the right place for this, but I'm not completely
sure what is. drivers/firmware would be better at least, but virt/fsl might
also be ok.
> +static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)
> +{
> + struct fsl_hv_ioctl_prop param;
> + char __user *upath, *upropname;
> + void __user *upropval;
> + char *path = NULL, *propname = NULL;
> + void *propval = NULL;
> + int ret = 0;
> +
I'm not convinced that an ioctl interface is the right way to work with
device tree properties. A more natural way would be to export it as
a file system, or maybe as a flattened device tree blob (the latter option
would require changing the hypervisor interface, which might not be
possible).
> +/**
> + * fsl_hv_ioctl: ioctl main entry point
> + */
> +static long fsl_hv_ioctl(struct file *file, unsigned int cmd,
> + unsigned long argaddr)
> +{
> + union fsl_hv_ioctl_param __user *arg =
> + (union fsl_hv_ioctl_param __user *)argaddr;
> + long ret;
> +
For an ioctl, please follow the normal pattern of defining a separate
structure for each case, no union.
You can use a void __user * in the common ioctl function, and pass that
to the typed argument list in the specific functions.
Arnd
next prev parent reply other threads:[~2011-06-01 21:40 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 18:35 [PATCH 7/7] [v2] drivers/misc: introduce Freescale hypervisor management driver Timur Tabi
2011-06-01 19:46 ` Alan Cox
2011-06-01 20:24 ` Timur Tabi
2011-06-01 20:34 ` Alan Cox
2011-06-01 20:54 ` Scott Wood
2011-06-01 21:45 ` Alan Cox
2011-06-01 21:40 ` Arnd Bergmann [this message]
2011-06-01 22:24 ` Scott Wood
2011-06-03 15:28 ` Arnd Bergmann
2011-06-03 16:22 ` Scott Wood
2011-06-06 15:53 ` Arnd Bergmann
2011-06-06 18:15 ` Scott Wood
2011-06-06 19:48 ` Arnd Bergmann
2011-06-02 21:28 ` Timur Tabi
2011-06-03 15:24 ` Arnd Bergmann
2011-06-03 15:28 ` Timur Tabi
2011-06-06 15:42 ` Arnd Bergmann
2011-06-06 15:48 ` Timur Tabi
2011-06-06 16:03 ` Arnd Bergmann
2011-06-06 16:09 ` Timur Tabi
2011-06-06 16:24 ` Arnd Bergmann
2011-06-06 16:27 ` Timur Tabi
2011-06-06 21:01 ` Chris Metcalf
2011-06-06 21:23 ` Konrad Rzeszutek Wilk
2011-06-06 23:04 ` Chris Metcalf
2011-06-07 7:08 ` Arnd Bergmann
2011-06-07 16:49 ` Chris Metcalf
2011-06-07 19:16 ` Arnd Bergmann
2011-06-07 19:20 ` Timur Tabi
2011-06-07 19:34 ` Arnd Bergmann
2011-06-03 14:44 ` Timur Tabi
2011-06-03 15:17 ` Arnd Bergmann
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=201106012340.14237.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=kumar.gala@freescale.com \
--cc=linux-console@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=timur@freescale.com \
/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;
as well as URLs for NNTP newsgroup(s).