Re: [PATCH v7 1/4] x86/insn-eval: Add support for 64-bit kernel mode

From: Kirill A. Shutemov
Date: Thu Jan 02 2020 - 02:47:26 EST


On Thu, Dec 19, 2019 at 12:11:47AM +0100, Jann Horn wrote:
> To support evaluating 64-bit kernel mode instructions:
>
> Replace existing checks for user_64bit_mode() with a new helper that
> checks whether code is being executed in either 64-bit kernel mode or
> 64-bit user mode.
>
> Select the GS base depending on whether the instruction is being
> evaluated in kernel mode.
>
> Signed-off-by: Jann Horn <jannh@xxxxxxxxxx>

In most cases you have struct insn around (or can easily pass it down to
the place). Why not use insn->x86_64?

--
Kirill A. Shutemov