Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727685

Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util functions to a new insn-eval file

From Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util functions to a new insn-eval file
Date 2017-09-06 21:30 +0200
Message-ID <umObo-69u-19@gated-at.bofh.it> (permalink)
References <ufZOh-2z5-3@gated-at.bofh.it> <ufZOi-2z5-19@gated-at.bofh.it> <umKUa-3Qp-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2017-09-06 at 17:54 +0200, Borislav Petkov wrote:
> 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?

I have updated this line to read "This new utility insn-eval.c aims to
be used to resolve userspace linear addresses based on the contents of
the instruction operands as well as the contents of pt_regs structure."

> 
> > 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 <bp@suse.de>
> > Cc: Andy Lutomirski <luto@kernel.org>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
> > Cc: Colin Ian King <colin.king@canonical.com>
> > Cc: Lorenzo Stoakes <lstoakes@gmail.com>
> > Cc: Qiaowei Ren <qiaowei.ren@intel.com>
> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Masami Hiramatsu <mhiramat@kernel.org>
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: Thomas Garnier <thgarnie@google.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Dmitry Vyukov <dvyukov@google.com>
> > Cc: Ravi V. Shankar <ravi.v.shankar@intel.com>
> > Cc: x86@kernel.org
> > Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
> > ---
> 
> <--- ... here. Put such notes here.

Thanks for explaining this to me. I will move the note about the warning
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 <bp@suse.de>

Thanks you!

BR,
Ricardo

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util functions  to a new insn-eval file Borislav Petkov <bp@suse.de> - 2017-09-06 18:00 +0200
  Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util  functions to a new insn-eval file Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-09-06 21:30 +0200

csiph-web