Skip to content

Commit a556bd8

Browse files
J3m3Jonathan Corbet
authored andcommitted
docs: align with scripts/syscall.tbl migration
Update the documentation to reflect the migration of the following architectures to the centralized syscall table format: arc, arm64, csky, hexagon, loongarch, nios2, openrisc, riscv As of commit 3db80c9 ("riscv: convert to generic syscall table"), these architectures no longer rely on include/uapi/asm-generic/unistd.h. Instead, syscall table headers (syscall_table_{32,64}.h) are generated by scripts/syscalltbl.sh based on entries in scripts/syscall.tbl, with ABIs specified in arch/*/kernel/Makefile.syscalls. For the convenience of developers working with older kernel versions, the original documentation is fully retained, with new sections added to cover the scripts/syscall.tbl approach. Verified with `make htmldocs`. Signed-off-by: Jesung Yang <[email protected]> Link: https://lore.kernel.org/lkml/[email protected] Signed-off-by: Jonathan Corbet <[email protected]> Message-ID: <[email protected]>
1 parent 54538c2 commit a556bd8

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

Documentation/process/adding-syscalls.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,52 @@ To summarize, you need a commit that includes:
248248
- fallback stub in ``kernel/sys_ni.c``
249249

250250

251+
.. _syscall_generic_6_11:
252+
253+
Since 6.11
254+
~~~~~~~~~~
255+
256+
Starting with kernel version 6.11, general system call implementation for the
257+
following architectures no longer requires modifications to
258+
``include/uapi/asm-generic/unistd.h``:
259+
260+
- arc
261+
- arm64
262+
- csky
263+
- hexagon
264+
- loongarch
265+
- nios2
266+
- openrisc
267+
- riscv
268+
269+
Instead, you need to update ``scripts/syscall.tbl`` and, if applicable, adjust
270+
``arch/*/kernel/Makefile.syscalls``.
271+
272+
As ``scripts/syscall.tbl`` serves as a common syscall table across multiple
273+
architectures, a new entry is required in this table::
274+
275+
468 common xyzzy sys_xyzzy
276+
277+
Note that adding an entry to ``scripts/syscall.tbl`` with the "common" ABI
278+
also affects all architectures that share this table. For more limited or
279+
architecture-specific changes, consider using an architecture-specific ABI or
280+
defining a new one.
281+
282+
If a new ABI, say ``xyz``, is introduced, the corresponding updates should be
283+
made to ``arch/*/kernel/Makefile.syscalls`` as well::
284+
285+
syscall_abis_{32,64} += xyz (...)
286+
287+
To summarize, you need a commit that includes:
288+
289+
- ``CONFIG`` option for the new function, normally in ``init/Kconfig``
290+
- ``SYSCALL_DEFINEn(xyzzy, ...)`` for the entry point
291+
- corresponding prototype in ``include/linux/syscalls.h``
292+
- new entry in ``scripts/syscall.tbl``
293+
- (if needed) Makefile updates in ``arch/*/kernel/Makefile.syscalls``
294+
- fallback stub in ``kernel/sys_ni.c``
295+
296+
251297
x86 System Call Implementation
252298
------------------------------
253299

@@ -353,6 +399,41 @@ To summarize, you need:
353399
``include/uapi/asm-generic/unistd.h``
354400

355401

402+
Since 6.11
403+
~~~~~~~~~~
404+
405+
This applies to all the architectures listed in :ref:`Since 6.11<syscall_generic_6_11>`
406+
under "Generic System Call Implementation", except arm64. See
407+
:ref:`Compatibility System Calls (arm64)<compat_arm64>` for more information.
408+
409+
You need to extend the entry in ``scripts/syscall.tbl`` with an extra column
410+
to indicate that a 32-bit userspace program running on a 64-bit kernel should
411+
hit the compat entry point::
412+
413+
468 common xyzzy sys_xyzzy compat_sys_xyzzy
414+
415+
To summarize, you need:
416+
417+
- ``COMPAT_SYSCALL_DEFINEn(xyzzy, ...)`` for the compat entry point
418+
- corresponding prototype in ``include/linux/compat.h``
419+
- modification of the entry in ``scripts/syscall.tbl`` to include an extra
420+
"compat" column
421+
- (if needed) 32-bit mapping struct in ``include/linux/compat.h``
422+
423+
424+
.. _compat_arm64:
425+
426+
Compatibility System Calls (arm64)
427+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
428+
429+
On arm64, there is a dedicated syscall table for compatibility system calls
430+
targeting 32-bit (AArch32) userspace: ``arch/arm64/tools/syscall_32.tbl``.
431+
You need to add an additional line to this table specifying the compat
432+
entry point::
433+
434+
468 common xyzzy sys_xyzzy compat_sys_xyzzy
435+
436+
356437
Compatibility System Calls (x86)
357438
--------------------------------
358439

@@ -575,3 +656,6 @@ References and Sources
575656
- Recommendation from Linus Torvalds that x32 system calls should prefer
576657
compatibility with 64-bit versions rather than 32-bit versions:
577658
https://lore.kernel.org/r/CA+55aFxfmwfB7jbbrXxa=K7VBYPfAvmu3XOkGrLbB1UFjX1+Ew@mail.gmail.com
659+
- Patch series revising system call table infrastructure to use
660+
scripts/syscall.tbl across multiple architectures:
661+
https://lore.kernel.org/lkml/[email protected]

0 commit comments

Comments
 (0)