lkml.org 
[lkml]   [2017]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/18] x86/asm/64: Split the iret-to-user and iret-to-kernel paths
From
Date
On 10/26/2017 01:26 AM, Andy Lutomirski wrote:
> +GLOBAL(restore_regs_and_return_to_usermode)
> +#ifdef CONFIG_DEBUG_ENTRY
> + testl $3, CS(%rsp)
> + jnz 1f
> + ud2

A nit from the mere mortals in the audience: Could we start commenting
or make a constant for the user segment bits in CS?

Also, it would be nice to explain what's going on here. Maybe:

/*
* We think we are returning to the kernel. Check the
* registers we are about to restore and if we appear to
* be returning to userspace, do something that will cause
* a fault and hopefully an oops report.
*/

Otherwise, I really like this change. It's really hard to figure out
what the context is in the entry assembly in a lot of cases. It's a
place where code reuse actually makes things harder to follow.

\
 
 \ /
  Last update: 2017-10-28 20:19    [W:0.295 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site