lkml.org 
[lkml]   [2017]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 11/28] x86/insn-eval: Add utility function to identify string instructions
On Fri, Aug 18, 2017 at 05:27:52PM -0700, Ricardo Neri wrote:
> String instructions are special because, in protected mode, the linear
> address is always obtained via the ES segment register in operands that
> use the (E)DI register; the DS segment register in operands that use
> the (E)SI register. Furthermore, segment override prefixes are ignored
> when calculating a linear address involving the (E)DI register; segment
> override prefixes can be used when calculating linear addresses involving
> the (E)SI register.
>
> It follows that linear addresses are calculated differently for the case of
> string instructions. The purpose of this utility function is to identify
> such instructions for callers to determine a linear address correctly.
>
> Note that this function only identifies string instructions; it does not
> determine what segment register to use in the address computation. That is
> left to callers. A subsequent commmit introduces a function to determine
> the segment register to use given the instruction, operands and
> segment override prefixes.
>
> 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: Borislav Petkov <bp@suse.de>
> 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>
> ---
> arch/x86/lib/insn-eval.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)

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)
--

\
 
 \ /
  Last update: 2017-09-08 18:15    [W:0.203 / U:2.300 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site