From: Randy Dunlap <randy.dunlap@oracle.com>
To: Ossama Othman <ossama.othman@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Intel Restricted Access Region Handler
Date: Mon, 15 Mar 2010 10:22:41 -0700 [thread overview]
Message-ID: <4B9E6CE1.3070202@oracle.com> (raw)
In-Reply-To: <1268558064-7973-1-git-send-email-ossama.othman@intel.com>
On 03/14/10 01:14, Ossama Othman wrote:
> The Intel Restricted Access Region Handler provides a buffer allocation
> mechanism to RAR users. Since the intended usage model is to lock out
> CPU access to RAR (the CPU will not be able to access RAR memory), this
> driver does not access RAR memory, and merely keeps track of what areas
> of RAR memory are in use. It has it's own simple allocator that does
> not rely on existing kernel allocators (SLAB, etc) since those
> allocators are too tightly coupled with the paging mechanism, which isn't
> needed for the intended RAR use cases.
>
> An mmap() implementation is provided for debugging purposes to simplify
> RAR memory access from the user space. However, it will effectively be
> a no-op when RAR access control is enabled since the CPU will not be
> able to access RAR.
>
> This driver should not be confused with the rar_register driver. That
> driver exposes an interface to access RAR registers on the Moorestown
> platform. The RAR handler driver relies on the rar_register driver for
> low level RAR register reads and writes.
>
> Signed-off-by: Ossama Othman <ossama.othman@intel.com>
> ---
> drivers/staging/Kconfig | 2 +
> drivers/staging/Makefile | 1 +
> drivers/staging/memrar/Kconfig | 15 +
> drivers/staging/memrar/Makefile | 2 +
> drivers/staging/memrar/memrar.h | 160 +++++
> drivers/staging/memrar/memrar_allocator.c | 432 +++++++++++++
> drivers/staging/memrar/memrar_allocator.h | 141 +++++
> drivers/staging/memrar/memrar_handler.c | 948 +++++++++++++++++++++++++++++
> 8 files changed, 1701 insertions(+), 0 deletions(-)
> create mode 100644 drivers/staging/memrar/Kconfig
> create mode 100644 drivers/staging/memrar/Makefile
> create mode 100644 drivers/staging/memrar/memrar.h
> create mode 100644 drivers/staging/memrar/memrar_allocator.c
> create mode 100644 drivers/staging/memrar/memrar_allocator.h
> create mode 100644 drivers/staging/memrar/memrar_handler.c
>
> diff --git a/drivers/staging/memrar/Makefile b/drivers/staging/memrar/Makefile
> new file mode 100644
> index 0000000..a3336c0
> --- /dev/null
> +++ b/drivers/staging/memrar/Makefile
> @@ -0,0 +1,2 @@
> +obj-$(CONFIG_MRST_RAR_HANDLER) += memrar.o
> +memrar-y := memrar_allocator.o memrar_handler.o
> diff --git a/drivers/staging/memrar/memrar.h b/drivers/staging/memrar/memrar.h
> new file mode 100644
> index 0000000..7a09e7d
> --- /dev/null
> +++ b/drivers/staging/memrar/memrar.h
> @@ -0,0 +1,160 @@
> +/*
> + * RAR Handler (/dev/memrar) internal driver API.
> + * Copyright (C) 2009 Intel Corporation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of version 2 of the GNU General
> + * Public License as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be
> + * useful, but WITHOUT ANY WARRANTY; without even the implied
> + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
> + * PURPOSE. See the GNU General Public License for more details.
> + * You should have received a copy of the GNU General Public
> + * License along with this program; if not, write to the Free
> + * Software Foundation, Inc., 59 Temple Place - Suite 330,
> + * Boston, MA 02111-1307, USA.
> + * The full GNU General Public License is included in this
> + * distribution in the file called COPYING.
> + */
> +
> +
> +#ifndef _MEMRAR_H
> +#define _MEMRAR_H
> +
> +#include <linux/ioctl.h>
> +#include <linux/types.h>
> +
> +
> +/*
> + * @struct RAR_stat
> + *
> + * @brief This structure is used for @c RAR_HANDLER_STAT ioctl and for
> + * @c RAR_get_stat() user space wrapper function.
> + */
Don't use doxygen or whatever that is in the Linux kernel.
Use kernel-doc notation as described in Documentation/kernel-doc-nano-HOWTO.txt.
In many places/multiple files.
> +struct RAR_stat {
> + /* Type of RAR memory (e.g., audio vs. video) */
> + __u32 type;
> +
> + /*
> + * Total size of RAR memory region.
> + */
> + __u32 capacity;
> +
> + /* Size of the largest reservable block. */
> + __u32 largest_block_size;
> +};
Thanks.
--
~Randy
next prev parent reply other threads:[~2010-03-15 17:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-14 9:14 [PATCH] Intel Restricted Access Region Handler Ossama Othman
2010-03-14 9:08 ` Othman, Ossama
2010-03-14 18:10 ` Greg KH
2010-03-15 23:16 ` Othman, Ossama
2010-03-15 23:45 ` Greg KH
2010-03-19 21:32 ` Andrew Morton
2010-03-19 21:40 ` Greg KH
2010-03-19 22:53 ` Othman, Ossama
2010-03-19 22:56 ` Greg KH
2010-03-26 22:11 ` [PATCH] staging: Initial memrar ABI document Ossama Othman
2010-03-15 23:23 ` [PATCH] staging: Intel Restricted Access Region Handler Ossama Othman
2010-03-15 17:22 ` Randy Dunlap [this message]
2010-03-15 17:26 ` [PATCH] " Othman, Ossama
2010-03-15 17:47 ` Alan Cox
2010-03-15 18:29 ` Randy Dunlap
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=4B9E6CE1.3070202@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ossama.othman@intel.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