On Fri, Aug 18, 2017 at 05:27:49PM -0700, Ricardo Neri wrote:
> Other kernel submodules can benefit from using the utility functions
> defined in mpx.c to obtain the addresses and values of operands contained
> in the general purpose registers. An instance of this is the emulation code
> used for instructions protected by the Intel User-Mode Instruction
> Prevention feature.
> 
> Thus, these functions are relocated to a new insn-eval.c file. The reason
> to not relocate these utilities into insn.c is that the latter solely
> analyses instructions given by a struct insn without any knowledge of the
> meaning of the values of instruction operands. This new utility insn-
> eval.c aims to be used to resolve and userspace linear addresses based on
                                   ^
                                   |

something's missing there - "kernel" maybe?

> the contents of the instruction operands as well as the contents of pt_regs
> structure.
> 
> These utilities come with a separate header. This is to avoid taking insn.c
> out of sync from the instructions decoders under tools/obj and tools/perf.
> This also avoids adding cumbersome #ifdef's for the #include'd files
> required to decode instructions in a kernel context.
> 
> Functions are simply relocated. There are not functional or indentation
> changes.

That text below you don't need to have in the commit message. Patch
handling and other modalities are usually put after the "---" and before
the diffstat below...

> The checkpatch script issues the following warning with this
> commit:
> 
> WARNING: Avoid crashing the kernel - try using WARN_ON & recovery code
> rather than BUG() or BUG_ON()
> +               BUG();
> 
> This warning will be fixed in a subsequent patch.
> 
> Cc: Borislav Petkov <[email protected]>
> Cc: Andy Lutomirski <[email protected]>
> Cc: Dave Hansen <[email protected]>
> Cc: Adam Buchbinder <[email protected]>
> Cc: Colin Ian King <[email protected]>
> Cc: Lorenzo Stoakes <[email protected]>
> Cc: Qiaowei Ren <[email protected]>
> Cc: Arnaldo Carvalho de Melo <[email protected]>
> Cc: Masami Hiramatsu <[email protected]>
> Cc: Adrian Hunter <[email protected]>
> Cc: Kees Cook <[email protected]>
> Cc: Thomas Garnier <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: Dmitry Vyukov <[email protected]>
> Cc: Ravi V. Shankar <[email protected]>
> Cc: [email protected]
> Signed-off-by: Ricardo Neri <[email protected]>
> ---

<--- ... here. Put such notes here.

>  arch/x86/include/asm/insn-eval.h |  16 ++++
>  arch/x86/lib/Makefile            |   2 +-
>  arch/x86/lib/insn-eval.c         | 163 
> +++++++++++++++++++++++++++++++++++++++
>  arch/x86/mm/mpx.c                | 156 +------------------------------------
>  4 files changed, 182 insertions(+), 155 deletions(-)
>  create mode 100644 arch/x86/include/asm/insn-eval.h
>  create mode 100644 arch/x86/lib/insn-eval.c

Reviewed-by: Borislav Petkov <[email protected]>

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 

Reply via email to