[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1505413847.8286.11.camel@linux.intel.com>
Date: Thu, 14 Sep 2017 11:30:47 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Borislav Petkov <bp@...e.de>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Brian Gerst <brgerst@...il.com>,
Chris Metcalf <cmetcalf@...lanox.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Huang Rui <ray.huang@....com>, Jiri Slaby <jslaby@...e.cz>,
Jonathan Corbet <corbet@....net>,
"Michael S. Tsirkin" <mst@...hat.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Vlastimil Babka <vbabka@...e.cz>,
Chen Yucong <slaoub@...il.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
x86@...nel.org, Adam Buchbinder <adam.buchbinder@...il.com>,
Colin Ian King <colin.king@...onical.com>,
Lorenzo Stoakes <lstoakes@...il.com>,
Qiaowei Ren <qiaowei.ren@...el.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Kees Cook <keescook@...omium.org>,
Thomas Garnier <thgarnie@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>
Subject: Re: [PATCH v8 11/28] x86/insn-eval: Add utility function to
identify string instructions
On Fri, 2017-09-08 at 15:57 +0200, Borislav Petkov wrote:
> 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@...ux.intel.com>
> > Cc: Adam Buchbinder <adam.buchbinder@...il.com>
> > Cc: Colin Ian King <colin.king@...onical.com>
> > Cc: Lorenzo Stoakes <lstoakes@...il.com>
> > Cc: Qiaowei Ren <qiaowei.ren@...el.com>
> > Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> > Cc: Masami Hiramatsu <mhiramat@...nel.org>
> > Cc: Adrian Hunter <adrian.hunter@...el.com>
> > Cc: Kees Cook <keescook@...omium.org>
> > Cc: Thomas Garnier <thgarnie@...gle.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Borislav Petkov <bp@...e.de>
> > Cc: Dmitry Vyukov <dvyukov@...gle.com>
> > Cc: Ravi V. Shankar <ravi.v.shankar@...el.com>
> > Cc: x86@...nel.org
> > Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
> > ---
> > arch/x86/lib/insn-eval.c | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> Reviewed-by: Borislav Petkov <bp@...e.de>
Thanks for your review!
BR,
Ricardo
Powered by blists - more mailing lists