查阅内核代码,发现entry_SYSCALL_64_after_hwframe是从entry_SYSCALL_64开始执行的代码中的标号。因为从entry_SYSCALL_64到entry_SYSCALL_64_after_hwframe的过程中并没有类似于call这样的调用指令,这么说系统调用的入口是从netry_SYSCALL_64开始的。 继续用qemu打个断点看看,毕竟可以看到entry_SYSCALL_64_safe_stack...
内核SYSCALL 入口代码在entry_64.S中: //arch/x86/entry/entry_64.S ENTRY(entry_SYSCALL_64) UNWIND_HINT_EMPTY /* Interrupts are off on entry. */ swapgs // 将用户栈偏移保存到 per-cpu 变量 rsp_scratch 中 movq %rsp, PER_CPU_VAR(rsp_scratch) // 切换到进程内核栈 movqPER_CPU_VAR(cpu_cu...
* after the swapgs, so that it can do the swapgs * for the guest and jump here on syscall.*/ GLOBAL(system_call_after_swapgs) movq%rsp,PER_CPU_VAR(old_rsp) movqPER_CPU_VAR(kernel_stack),%rsp /* * No need to follow this irqs off/on section - it's straight ...
syscall_64.c thunk_32.S thunk_64.S events hyperv ia32 include kernel kvm lib math-emu mm net oprofile pci platform power purgatory ras realmode tools um video xen .gitignore Kbuild Kconfig Kconfig.cpu Kconfig.debug Makefile Makefile.um ...
(unsigned long); + } + + /* Reset the lowest_stack value for the next syscall */ + current->thread.lowest_stack = current_top_of_stack() - 256; +} + diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index b0ccd48..0c87813 100644 --- a/...
此时可以确定系统调用的代码的确是从entry_SYSCALL_64开始执行的。 接下来分析代码。 swapgs指令 swapgs 首先执行的是swapgs指令,该指令的描述是: When FS and GS segment overrides are used in 64-bit mode, their respective base addresses are used in the linear address calculation: (FS or GS).base + ...
此时可以确定系统调用的代码的确是从entry_SYSCALL_64开始执行的。 接下来分析代码。 swapgs指令 swapgs 首先执行的是swapgs指令,该指令的描述是: When FS and GS segment overrides are used in 64-bit mode, their respective base addresses are used in the linear address calculation: (FS or GS).base + ...