<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/regset.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-15T05:27:46+00:00</updated>
<entry>
<title>regset: Add explicit core note name in struct user_regset</title>
<updated>2025-07-15T05:27:46+00:00</updated>
<author>
<name>Dave Martin</name>
<email>Dave.Martin@arm.com</email>
</author>
<published>2025-07-01T13:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=85a7f9cbf8a83cfe0aca04053a832206c4ad1272'/>
<id>urn:sha1:85a7f9cbf8a83cfe0aca04053a832206c4ad1272</id>
<content type='text'>
There is currently hard-coded logic spread around the tree for
determining the note name for regset notes emitted in coredumps.

Now that the names are declared explicitly in &lt;uapi/elf.h&gt;, this can be
simplified.

In preparation for getting rid of the special-case logic, add an
explicit core_note_name field in struct user_regset for specifying the
note name explicitly.  To help avoid mistakes, a convenience macro
USER_REGSET_NOTE_TYPE() is provided to set .core_note_type and
.core_note_name based on the note type.

When dumping core, use the new field to set the note name, if the
regset specifies it.

Signed-off-by: Dave Martin &lt;Dave.Martin@arm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Kees Cook &lt;kees@kernel.org&gt;
Cc: Akihiko Odaki &lt;akihiko.odaki@daynix.com&gt;
Acked-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt; # s390
Reviewed-by: Akihiko Odaki &lt;odaki@rsg.ci.i.u-tokyo.ac.jp&gt;
Link: https://lore.kernel.org/r/20250701135616.29630-3-Dave.Martin@arm.com
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>regset: Fix kerneldoc for struct regset_get() in user_regset</title>
<updated>2025-07-15T05:27:46+00:00</updated>
<author>
<name>Dave Martin</name>
<email>Dave.Martin@arm.com</email>
</author>
<published>2025-07-01T13:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6fd9e1aa078490ed6e79307465269629fcb43018'/>
<id>urn:sha1:6fd9e1aa078490ed6e79307465269629fcb43018</id>
<content type='text'>
Commit 7717cb9bdd04 ("regset: new method and helpers for it") added a
new interface -&gt;regset_get() for struct user_regset, and commit
1e6986c9db21 ("regset: kill -&gt;get()") got rid of the old interface.

The kerneldoc comment block was never updated to take account of this
change, though.

Update it.

No functional change.

Signed-off-by: Dave Martin &lt;Dave.Martin@arm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Kees Cook &lt;kees@kernel.org&gt;
Cc: Akihiko Odaki &lt;akihiko.odaki@daynix.com&gt;
Reviewed-by: Akihiko Odaki &lt;odaki@rsg.ci.i.u-tokyo.ac.jp&gt;
Link: https://lore.kernel.org/r/20250701135616.29630-2-Dave.Martin@arm.com
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>regset: make user_regset_copyin_ignore() *void*</title>
<updated>2022-11-15T22:30:41+00:00</updated>
<author>
<name>Sergey Shtylyov</name>
<email>s.shtylyov@omp.ru</email>
</author>
<published>2022-10-14T21:22:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=597d77d29c5cc50b52bbbbd48c49a0237481a9df'/>
<id>urn:sha1:597d77d29c5cc50b52bbbbd48c49a0237481a9df</id>
<content type='text'>
user_regset_copyin_ignore() apparently cannot fail and so always returns 0.
Let's make this function return *void* instead of *int*...

Link: https://lkml.kernel.org/r/20221014212235.10770-14-s.shtylyov@omp.ru
Signed-off-by: Sergey Shtylyov &lt;s.shtylyov@omp.ru&gt;
Cc: Brian Cain &lt;bcain@quicinc.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Dinh Nguyen &lt;dinguyen@kernel.org&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Jonas Bonn &lt;jonas@southpole.se&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Rich Felker &lt;dalias@libc.org&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Stafford Horne &lt;shorne@gmail.com&gt;
Cc: Stefan Kristiansson &lt;stefan.kristiansson@saunalahti.fi&gt;
Cc: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yoshinori Sato &lt;ysato@users.osdn.me&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>powerpc/ptrace: Simplify gpr_get()/tm_cgpr_get()</title>
<updated>2020-11-26T11:05:42+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2020-11-19T16:02:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=640586f8af356096e084d69a9909d217852bde48'/>
<id>urn:sha1:640586f8af356096e084d69a9909d217852bde48</id>
<content type='text'>
gpr_get() does membuf_write() twice to override pt_regs-&gt;msr in
between. We can call membuf_write() once and change -&gt;msr in the
kernel buffer, this simplifies the code and the next fix.

The patch adds a new simple helper, membuf_at(offs), it returns the
new membuf which can be safely used after membuf_write().

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
[mpe: Fixup some minor whitespace issues noticed by Christophe]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20201119160221.GA5188@redhat.com
</content>
</entry>
<entry>
<title>regset: kill user_regset_copyout{,_zero}()</title>
<updated>2020-07-27T18:31:13+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-06-17T17:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce327e1c54119179066d6f3573a28001febc9265'/>
<id>urn:sha1:ce327e1c54119179066d6f3573a28001febc9265</id>
<content type='text'>
no callers left

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>regset(): kill -&gt;get_size()</title>
<updated>2020-07-27T18:31:13+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-06-17T13:57:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c522401e0656b51e6a65ec112489cb078801aa9c'/>
<id>urn:sha1:c522401e0656b51e6a65ec112489cb078801aa9c</id>
<content type='text'>
not used anymore

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>regset: kill -&gt;get()</title>
<updated>2020-07-27T18:31:12+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-06-16T19:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1e6986c9db21265bac1435a344b4446c51a3f4d8'/>
<id>urn:sha1:1e6986c9db21265bac1435a344b4446c51a3f4d8</id>
<content type='text'>
no instances left

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>regset: new method and helpers for it</title>
<updated>2020-07-27T18:31:07+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-02-21T01:48:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7717cb9bdd0421faa432a4e0d499fdba6e2394c8'/>
<id>urn:sha1:7717cb9bdd0421faa432a4e0d499fdba6e2394c8</id>
<content type='text'>
-&gt;regset_get() takes task+regset+buffer, returns the amount of free space
left in the buffer on success and -E... on error.

buffer is represented as struct membuf - a pair of (kernel) pointer
and amount of space left

Primitives for writing to such:
	* membuf_write(buf, data, size)
	* membuf_zero(buf, size)
	* membuf_store(buf, value)

These are implemented as inlines (in case of membuf_store - a macro).
All writes are sequential; they become no-ops when there's no space
left.  Return value of all primitives is the amount of space left
after the operation, so they can be used as return values of -&gt;regset_get().

Example of use:

// stores pt_regs of task + 64 bytes worth of zeroes + 32bit PID of task
int foo_get(struct task_struct *task, const struct regset *regset,
	    struct membuf to)
{
	membuf_write(&amp;to, task_pt_regs(task), sizeof(struct pt_regs));
	membuf_zero(&amp;to, 64);
	return membuf_store(&amp;to, (u32)task_tgid_vnr(task));
}

regset_get()/regset_get_alloc() taught to use that thing if present.
By the end of the series all users of -&gt;get() will be converted;
then -&gt;get() and -&gt;get_size() can go.

Note that unlike -&gt;get() this thing always starts at offset 0 and,
since it only writes to kernel buffer, can't fail on copyout.
It can, of course, fail for other reasons, but those tend to
be less numerous.

The caller guarantees that the buffer size won't be bigger than
regset-&gt;n * regset-&gt;size.  That simplifies life for quite a few
instances.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>copy_regset_to_user(): do all copyout at once.</title>
<updated>2020-07-27T18:31:07+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-02-17T17:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc12d7968f9c9540494deb1285854b18ca4465ec'/>
<id>urn:sha1:dc12d7968f9c9540494deb1285854b18ca4465ec</id>
<content type='text'>
Turn copy_regset_to_user() into regset_get_alloc() + copy_to_user().
Now all -&gt;get() calls have a kernel buffer as destination.

Note that we'd already eliminated the callers of copy_regset_to_user()
with non-zero offset; now that argument is simply unused.

Uninlined, while we are at it.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>introduction of regset -&gt;get() wrappers, switching ELF coredumps to those</title>
<updated>2020-07-27T18:24:50+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2020-06-01T23:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b4e9c9549f62329d2412f899635fddc5212b9cd4'/>
<id>urn:sha1:b4e9c9549f62329d2412f899635fddc5212b9cd4</id>
<content type='text'>
Two new helpers: given a process and regset, dump into a buffer.
regset_get() takes a buffer and size, regset_get_alloc() takes size
and allocates a buffer.

Return value in both cases is the amount of data actually dumped in
case of success or -E...  on error.

In both cases the size is capped by regset-&gt;n * regset-&gt;size, so
-&gt;get() is called with offset 0 and size no more than what regset
expects.

binfmt_elf.c callers of -&gt;get() are switched to using those; the other
caller (copy_regset_to_user()) will need some preparations to switch.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
