Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727623 > unrolled thread
| Started by | Borislav Petkov <bp@suse.de> |
|---|---|
| First post | 2017-09-06 18:00 +0200 |
| Last post | 2017-09-06 21:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| From | Borislav Petkov <bp@suse.de> |
|---|---|
| Date | 2017-09-06 18:00 +0200 |
| Subject | Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util functions to a new insn-eval file |
| Message-ID | <umKUa-3Qp-21@gated-at.bofh.it> |
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 <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.
> 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>
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
[toc] | [next] | [standalone]
| From | Ricardo Neri <ricardo.neri-calderon@linux.intel.com> |
|---|---|
| Date | 2017-09-06 21:30 +0200 |
| Subject | Re: [PATCH v8 08/28] x86/mpx, x86/insn: Relocate insn util functions to a new insn-eval file |
| Message-ID | <umObo-69u-19@gated-at.bofh.it> |
| In reply to | #1727623 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web