userfaultfd on x64
create a file descriptor for handling page faults in user space
sys_userfaultfd(int flags)
| number | 323 (0x143) |
|---|---|
| abi | common |
| kconfig | CONFIG_USERFAULTFD |
| entry point | sys_userfaultfd |
| since | Linux 4.3 |
| man page | userfaultfd(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 323, the syscall number |
rdi | int flags |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 374
- arm64 282
- arm 388
- riscv64 282
- ia32 374
- x32 1073742147
- loongarch64 282
- ppc64 364
- ppc 364
- s390x 355
- mips64 5317
- mipsn32 6321
- mipso32 4357
- alpha 516
- arc 282
- csky 282
- hexagon 282
- ia64 1343, removed in 6.7
- m68k 373
- metag 282, removed in 4.17
- microblaze 389
- nds32 282, removed in 5.18
- nios2 282
- openrisc 282
- parisc 344
- score 282, removed in 4.17
- sh 377
- sparc 352
- sparc64 352
- tilegx 282, removed in 4.17
- tilepro 282, removed in 4.17
- xtensa 342
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/userfaultfd