Re: [PATCH v10 08/15] x86/vsyscall: Reorganize the page fault emulation code

Sohil Mehta
2025-10-07T22:52:08Z

On 10/7/2025 12:53 PM, Edgecombe, Rick P wrote:

> But I'm looking at this applied. The following patches (which don't include that
> hunk), add another call site:
>
> bool emulate_vsyscall_gp(struct pt_regs *regs)
> {
> if (!cpu_feature_enabled(X86_FEATURE_LASS))
> return false;
>
> /* Emulate only if the RIP points to the vsyscall address */
> if (!is_vsyscall_vaddr(regs->ip))
> return false;
>
> return __emulate_vsyscall(regs, regs->ip);
> }
>
> If indeed we should add a check, it should probably go in one of the later
> patches and not this one.

We already check CS before calling emulate_vsyscall_gp().

if (user_mode(regs)) {

...
if (emulate_vsyscall_gp(regs))
goto exit;

...
}