<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/x86/entry/syscall_32.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/x86/entry/syscall_32.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/x86/entry/syscall_32.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-05-20T13:03:59Z</updated>
<entry>
<title>x86/syscalls: Stop filling syscall arrays with *_sys_ni_syscall</title>
<updated>2021-05-20T13:03:59Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-05-17T07:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=44fe4895f47cbe9f4692e1d3cdc2ef8352f4d88e'/>
<id>urn:sha1:44fe4895f47cbe9f4692e1d3cdc2ef8352f4d88e</id>
<content type='text'>
This is a follow-up cleanup after switching to the generic syscalltbl.sh.

The old x86 specific script skipped non-existing syscalls. So, the
generated syscalls_64.h, for example, had a big hole in the syscall numbers
335-423 range. That is why there exists [0 ... __NR_*_syscall_max] =
&amp;__*_sys_ni_cyscall.

The new script, scripts/syscalltbl.sh automatically fills holes
with __SYSCALL(&lt;nr&gt;, sys_ni_syscall), hence such ugly code can
go away. The designated initializers, '[nr] =' are also unneeded.

Also, there is no need to give __NR_*_syscall_max+1 because the array
size is implied by the number of syscalls in the generated headers.
Hence, there is no need to include &lt;asm/unistd.h&gt;, either.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210517073815.97426-4-masahiroy@kernel.org

</content>
</entry>
<entry>
<title>x86/syscalls: Switch to generic syscalltbl.sh</title>
<updated>2021-05-20T13:03:58Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-05-17T07:38:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6218d0f6b8dece1f2e82f0a47a0e6b8ecb631ef6'/>
<id>urn:sha1:6218d0f6b8dece1f2e82f0a47a0e6b8ecb631ef6</id>
<content type='text'>
Many architectures duplicate similar shell scripts.

Convert x86 and UML to use scripts/syscalltbl.sh. The generic script
generates seperate headers for x86/64 and x86/x32 syscalls, while the x86
specific script coalesced them into one. Adjust the code accordingly.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20210517073815.97426-3-masahiroy@kernel.org
</content>
</entry>
<entry>
<title>x86/entry: Drop asmlinkage from syscalls</title>
<updated>2020-03-21T15:03:25Z</updated>
<author>
<name>Brian Gerst</name>
<email>brgerst@gmail.com</email>
</author>
<published>2020-03-13T19:51:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0f78ff17112d8b3469b805ff4ea9780cc1e5c93b'/>
<id>urn:sha1:0f78ff17112d8b3469b805ff4ea9780cc1e5c93b</id>
<content type='text'>
asmlinkage is no longer required since the syscall ABI is now fully under
x86 architecture control.  This makes the 32-bit native syscalls a bit more
effecient by passing in regs via EAX instead of on the stack.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Reviewed-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Link: https://lkml.kernel.org/r/20200313195144.164260-18-brgerst@gmail.com

</content>
</entry>
<entry>
<title>x86/entry/32: Enable pt_regs based syscalls</title>
<updated>2020-03-21T15:03:24Z</updated>
<author>
<name>Brian Gerst</name>
<email>brgerst@gmail.com</email>
</author>
<published>2020-03-13T19:51:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=25c619e59b395a8c970d339f9c714302738e350e'/>
<id>urn:sha1:25c619e59b395a8c970d339f9c714302738e350e</id>
<content type='text'>
Enable pt_regs based syscalls for 32-bit.  This makes the 32-bit native
kernel consistent with the 64-bit kernel, and improves the syscall
interface by not needing to push all 6 potential arguments onto the stack.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Link: https://lkml.kernel.org/r/20200313195144.164260-17-brgerst@gmail.com

</content>
</entry>
<entry>
<title>x86/entry: Remove ABI prefixes from functions in syscall tables</title>
<updated>2020-03-21T15:03:23Z</updated>
<author>
<name>Brian Gerst</name>
<email>brgerst@gmail.com</email>
</author>
<published>2020-03-13T19:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=cab56d3484d4bb8b21e4d9500392ac1ce99af026'/>
<id>urn:sha1:cab56d3484d4bb8b21e4d9500392ac1ce99af026</id>
<content type='text'>
Move the ABI prefixes to the __SYSCALL_[abi]() macros.  This allows removal
of the need to strip the prefix for UML.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/20200313195144.164260-13-brgerst@gmail.com

</content>
</entry>
<entry>
<title>x86/entry: Remove syscall qualifier support</title>
<updated>2020-03-21T15:03:22Z</updated>
<author>
<name>Brian Gerst</name>
<email>brgerst@gmail.com</email>
</author>
<published>2020-03-13T19:51:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b5592e5c0d8682e0e82b42c91fd7265c3cce19e1'/>
<id>urn:sha1:b5592e5c0d8682e0e82b42c91fd7265c3cce19e1</id>
<content type='text'>
Syscall qualifier support is no longer needed.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Link: https://lkml.kernel.org/r/20200313195144.164260-11-brgerst@gmail.com

</content>
</entry>
<entry>
<title>x86/entry: Move max syscall number calculation to syscallhdr.sh</title>
<updated>2020-03-21T15:03:21Z</updated>
<author>
<name>Brian Gerst</name>
<email>brgerst@gmail.com</email>
</author>
<published>2020-03-13T19:51:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0872098804b5f44bab91f80b6df55df32894fee3'/>
<id>urn:sha1:0872098804b5f44bab91f80b6df55df32894fee3</id>
<content type='text'>
Instead of using an array in asm-offsets to calculate the max syscall
number, calculate it when writing out the syscall headers.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/20200313195144.164260-9-brgerst@gmail.com

</content>
</entry>
<entry>
<title>syscalls/x86: Use the correct function type for sys_ni_syscall</title>
<updated>2019-10-11T10:49:18Z</updated>
<author>
<name>Sami Tolvanen</name>
<email>samitolvanen@google.com</email>
</author>
<published>2019-10-08T22:40:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f48f01a92cca09e86d46c91d8edf9d5a71c61727'/>
<id>urn:sha1:f48f01a92cca09e86d46c91d8edf9d5a71c61727</id>
<content type='text'>
Use the correct function type for sys_ni_syscall() in system
call tables to fix indirect call mismatches with Control-Flow
Integrity (CFI) checking.

Signed-off-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Acked-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: H . Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/20191008224049.115427-5-samitolvanen@google.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>syscalls/x86: Unconditionally enable 'struct pt_regs' based syscalls on x86_64</title>
<updated>2018-04-05T14:59:38Z</updated>
<author>
<name>Dominik Brodowski</name>
<email>linux@dominikbrodowski.net</email>
</author>
<published>2018-04-05T09:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f8781c4a226319fe60e652118b90cf094ccfe747'/>
<id>urn:sha1:f8781c4a226319fe60e652118b90cf094ccfe747</id>
<content type='text'>
Removing CONFIG_SYSCALL_PTREGS from arch/x86/Kconfig and simply selecting
ARCH_HAS_SYSCALL_WRAPPER unconditionally on x86-64 allows us to simplify
several codepaths.

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20180405095307.3730-7-linux@dominikbrodowski.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32</title>
<updated>2018-04-05T14:59:38Z</updated>
<author>
<name>Dominik Brodowski</name>
<email>linux@dominikbrodowski.net</email>
</author>
<published>2018-04-05T09:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ebeb8c82ffaf94435806ff0b686fffd41dd410b5'/>
<id>urn:sha1:ebeb8c82ffaf94435806ff0b686fffd41dd410b5</id>
<content type='text'>
Extend ARCH_HAS_SYSCALL_WRAPPER for i386 emulation and for x32 on 64-bit
x86.

For x32, all we need to do is to create an additional stub for each
compat syscall which decodes the parameters in x86-64 ordering, e.g.:

	asmlinkage long __compat_sys_x32_xyzzy(struct pt_regs *regs)
	{
		return c_SyS_xyzzy(regs-&gt;di, regs-&gt;si, regs-&gt;dx);
	}

For i386 emulation, we need to teach compat_sys_*() to take struct
pt_regs as its only argument, e.g.:

	asmlinkage long __compat_sys_ia32_xyzzy(struct pt_regs *regs)
	{
		return c_SyS_xyzzy(regs-&gt;bx, regs-&gt;cx, regs-&gt;dx);
	}

In addition, we need to create additional stubs for common syscalls
(that is, for syscalls which have the same parameters on 32-bit and
64-bit), e.g.:

	asmlinkage long __sys_ia32_xyzzy(struct pt_regs *regs)
	{
		return c_sys_xyzzy(regs-&gt;bx, regs-&gt;cx, regs-&gt;dx);
	}

This approach avoids leaking random user-provided register content down
the call chain.

This patch is based on an original proof-of-concept

 | From: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
 | Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;

and was split up and heavily modified by me, in particular to base it on
ARCH_HAS_SYSCALL_WRAPPER.

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20180405095307.3730-6-linux@dominikbrodowski.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
</feed>
