Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread David Woodhouse

On Fri, 2007-12-21 at 00:44 -0800, Roland McGrath wrote:
> > What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
> > just use Author like everyone else?
> 
> This text is the standard that my employer specifies.

I have never heard of this.

-- 
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread Peter Zijlstra

On Fri, 2007-12-21 at 00:44 -0800, Roland McGrath wrote:
> > What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
> > just use Author like everyone else?
> 
> This text is the standard that my employer specifies.

I can't remember seeing anyone else doing this, and there are plenty of
us around.

I usually use:

 *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <[EMAIL PROTECTED]>



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread Roland McGrath
> What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
> just use Author like everyone else?

This text is the standard that my employer specifies.


Thanks,
Roland

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread Roland McGrath
 What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
 just use Author like everyone else?

This text is the standard that my employer specifies.


Thanks,
Roland

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread Peter Zijlstra

On Fri, 2007-12-21 at 00:44 -0800, Roland McGrath wrote:
  What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
  just use Author like everyone else?
 
 This text is the standard that my employer specifies.

I can't remember seeing anyone else doing this, and there are plenty of
us around.

I usually use:

 *  Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra [EMAIL PROTECTED]



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-21 Thread David Woodhouse

On Fri, 2007-12-21 at 00:44 -0800, Roland McGrath wrote:
  What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
  just use Author like everyone else?
 
 This text is the standard that my employer specifies.

I have never heard of this.

-- 
dwmw2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm 01/43] user_regset header

2007-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2007 at 03:53:57AM -0800, Roland McGrath wrote:
> +/*
> + * User-mode machine state access
> + *
> + * Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
> + *
> + * This copyrighted material is made available to anyone wishing to use,
> + * modify, copy, or redistribute it subject to the terms and conditions
> + * of the GNU General Public License v.2.
> + *
> + * Red Hat Author: Roland McGrath.

What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
just use Author like everyone else?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm 01/43] user_regset header

2007-12-20 Thread Roland McGrath
The new header  defines the types struct user_regset and
struct user_regset_view, with some associated declarations.  This new set
of interfaces will become the standard way for arch code to expose
user-mode machine-specific state.  A single set of entry points into arch
code can do all the low-level work in one place to fill the needs of core
dumps, ptrace, and any other user-mode debugging facilities that might come
along in the future.

For existing arch code to adapt to the user_regset interfaces, each arch
can work from the code it already has to support core files and ptrace.
The formats you want for user_regset are the core file formats.  The only
wrinkle in adapting old ptrace implementation code as user_regset get and
set functions is that these functions can be called on current as well as
on another task_struct that is stopped and switched out as for ptrace.
For some kinds of machine state, you may have to load it directly from CPU
registers or otherwise differently for current than for another thread.
(Your core dump support already handles this in elf_core_copy_regs for
current and elf_core_copy_task_regs for other tasks, so just check there.)
The set function should also be made to work on current in case that
entails some special cases, though this was never required before for
ptrace.  Adding this flexibility covers the arch needs to open the door to
more sophisticated new debugging facilities that don't always need to
context-switch to do every little thing.

The copyin/copyout helper functions (in a later patch) relieve the arch
code of most of the cumbersome details of the flexible get/set interfaces.

Signed-off-by: Roland McGrath <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 include/linux/regset.h |  206 
 1 files changed, 206 insertions(+), 0 deletions(-)

diff --git a/include/linux/regset.h b/include/linux/regset.h
new file mode 100644
index 000..85d0fb0
--- /dev/null
+++ b/include/linux/regset.h
@@ -0,0 +1,206 @@
+/*
+ * User-mode machine state access
+ *
+ * Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * Red Hat Author: Roland McGrath.
+ */
+
+#ifndef _LINUX_REGSET_H
+#define _LINUX_REGSET_H1
+
+#include 
+#include 
+struct task_struct;
+struct user_regset;
+
+
+/**
+ * user_regset_active_fn - type of @active function in  user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ *
+ * Return -%ENODEV if not available on the hardware found.
+ * Return %0 if no interesting state in this thread.
+ * Return >%0 number of @size units of interesting state.
+ * Any get call fetching state beyond that number will
+ * see the default initialization state for this data,
+ * so a caller that knows what the default state is need
+ * not copy it all out.
+ * This call is optional; the pointer is %NULL if there
+ * is no inexpensive check to yield a value < @n.
+ */
+typedef int user_regset_active_fn(struct task_struct *target,
+ const struct user_regset *regset);
+
+/**
+ * user_regset_get_fn - type of @get function in  user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ * @pos:   offset into the regset data to access, in bytes
+ * @count: amount of data to copy, in bytes
+ * @kbuf:  if not %NULL, a kernel-space pointer to copy into
+ * @ubuf:  if @kbuf is %NULL, a user-space pointer to copy into
+ *
+ * Fetch register values.  Return %0 on success; -%EIO or -%ENODEV
+ * are usual failure returns.  The @pos and @count values are in
+ * bytes, but must be properly aligned.  If @kbuf is non-null, that
+ * buffer is used and @ubuf is ignored.  If @kbuf is %NULL, then
+ * ubuf gives a userland pointer to access directly, and an -%EFAULT
+ * return value is possible.
+ */
+typedef int user_regset_get_fn(struct task_struct *target,
+  const struct user_regset *regset,
+  unsigned int pos, unsigned int count,
+  void *kbuf, void __user *ubuf);
+
+/**
+ * user_regset_set_fn - type of @set function in  user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ * @pos:   offset into the regset data to access, in bytes
+ * @count: amount of data to copy, in bytes
+ * @kbuf:  if not %NULL, a kernel-space pointer to copy from
+ * @ubuf:  if @kbuf is %NULL, a user-space pointer to copy from
+ *
+ * Store register values.  Return %0 on success; -%EIO or -%ENODEV
+ * are usual failure returns.  The @pos and @count values are in
+ * bytes, but must be properly aligned.  If @kbuf is non-null, that
+ * buffer is used and @ubuf 

[PATCH -mm 01/43] user_regset header

2007-12-20 Thread Roland McGrath
The new header linux/regset.h defines the types struct user_regset and
struct user_regset_view, with some associated declarations.  This new set
of interfaces will become the standard way for arch code to expose
user-mode machine-specific state.  A single set of entry points into arch
code can do all the low-level work in one place to fill the needs of core
dumps, ptrace, and any other user-mode debugging facilities that might come
along in the future.

For existing arch code to adapt to the user_regset interfaces, each arch
can work from the code it already has to support core files and ptrace.
The formats you want for user_regset are the core file formats.  The only
wrinkle in adapting old ptrace implementation code as user_regset get and
set functions is that these functions can be called on current as well as
on another task_struct that is stopped and switched out as for ptrace.
For some kinds of machine state, you may have to load it directly from CPU
registers or otherwise differently for current than for another thread.
(Your core dump support already handles this in elf_core_copy_regs for
current and elf_core_copy_task_regs for other tasks, so just check there.)
The set function should also be made to work on current in case that
entails some special cases, though this was never required before for
ptrace.  Adding this flexibility covers the arch needs to open the door to
more sophisticated new debugging facilities that don't always need to
context-switch to do every little thing.

The copyin/copyout helper functions (in a later patch) relieve the arch
code of most of the cumbersome details of the flexible get/set interfaces.

Signed-off-by: Roland McGrath [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 include/linux/regset.h |  206 
 1 files changed, 206 insertions(+), 0 deletions(-)

diff --git a/include/linux/regset.h b/include/linux/regset.h
new file mode 100644
index 000..85d0fb0
--- /dev/null
+++ b/include/linux/regset.h
@@ -0,0 +1,206 @@
+/*
+ * User-mode machine state access
+ *
+ * Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * Red Hat Author: Roland McGrath.
+ */
+
+#ifndef _LINUX_REGSET_H
+#define _LINUX_REGSET_H1
+
+#include linux/compiler.h
+#include linux/types.h
+struct task_struct;
+struct user_regset;
+
+
+/**
+ * user_regset_active_fn - type of @active function in struct user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ *
+ * Return -%ENODEV if not available on the hardware found.
+ * Return %0 if no interesting state in this thread.
+ * Return %0 number of @size units of interesting state.
+ * Any get call fetching state beyond that number will
+ * see the default initialization state for this data,
+ * so a caller that knows what the default state is need
+ * not copy it all out.
+ * This call is optional; the pointer is %NULL if there
+ * is no inexpensive check to yield a value  @n.
+ */
+typedef int user_regset_active_fn(struct task_struct *target,
+ const struct user_regset *regset);
+
+/**
+ * user_regset_get_fn - type of @get function in struct user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ * @pos:   offset into the regset data to access, in bytes
+ * @count: amount of data to copy, in bytes
+ * @kbuf:  if not %NULL, a kernel-space pointer to copy into
+ * @ubuf:  if @kbuf is %NULL, a user-space pointer to copy into
+ *
+ * Fetch register values.  Return %0 on success; -%EIO or -%ENODEV
+ * are usual failure returns.  The @pos and @count values are in
+ * bytes, but must be properly aligned.  If @kbuf is non-null, that
+ * buffer is used and @ubuf is ignored.  If @kbuf is %NULL, then
+ * ubuf gives a userland pointer to access directly, and an -%EFAULT
+ * return value is possible.
+ */
+typedef int user_regset_get_fn(struct task_struct *target,
+  const struct user_regset *regset,
+  unsigned int pos, unsigned int count,
+  void *kbuf, void __user *ubuf);
+
+/**
+ * user_regset_set_fn - type of @set function in struct user_regset
+ * @target:thread being examined
+ * @regset:regset being examined
+ * @pos:   offset into the regset data to access, in bytes
+ * @count: amount of data to copy, in bytes
+ * @kbuf:  if not %NULL, a kernel-space pointer to copy from
+ * @ubuf:  if @kbuf is %NULL, a user-space pointer to copy from
+ *
+ * Store register values.  Return %0 on success; -%EIO or -%ENODEV
+ * are usual failure returns.  The @pos and @count values are in
+ * bytes, but must be properly aligned.  If 

Re: [PATCH -mm 01/43] user_regset header

2007-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2007 at 03:53:57AM -0800, Roland McGrath wrote:
 +/*
 + * User-mode machine state access
 + *
 + * Copyright (C) 2007 Red Hat, Inc.  All rights reserved.
 + *
 + * This copyrighted material is made available to anyone wishing to use,
 + * modify, copy, or redistribute it subject to the terms and conditions
 + * of the GNU General Public License v.2.
 + *
 + * Red Hat Author: Roland McGrath.

What's a Red Hat Author?  Sorry for the nitpicking, but why don't you
just use Author like everyone else?

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/