move_pages on x64
move individual pages of a process to another node
sys_move_pages(pid_t pid, unsigned long nr_pages, const void * *pages, const int *nodes, int *status, int flags)
| number | 279 (0x117) |
|---|---|
| abi | 64 |
| entry point | sys_move_pages |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | move_pages(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 279, the syscall number |
rdi | pid_t pid |
rsi | unsigned long nr_pages |
rdx | const void * *pages |
r10 | const int *nodes |
r8 | int *status |
r9 | 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 317
- arm64 239
- arm 344
- riscv64 239
- ia32 317
- x32 1073742357
- loongarch64 239
- ppc64 301
- ppc 301
- s390x 310
- mips64 5267
- mipsn32 6271
- mipso32 4308
- alpha 472
- arc 239
- cris 317, removed in 4.17
- csky 239
- frv 317, removed in 4.17
- hexagon 239
- ia64 1276, removed in 6.7
- m32r 317, removed in 4.17
- m68k 310
- metag 239, removed in 4.17
- microblaze 317
- mn10300 318, removed in 4.17
- nds32 239, removed in 5.18
- nios2 239
- openrisc 239
- parisc 295
- score 239, removed in 4.17
- sh 317
- sparc 307
- sparc64 307
- tilegx 239, removed in 4.17
- tilepro 239, removed in 4.17
- xtensa 267
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/move_pages