alistair23-linux/arch
Ricardo Neri 536b815388 x86/insn-eval: Add utility function to identify string instructions
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.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: ricardo.neri@intel.com
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Qiaowei Ren <qiaowei.ren@intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Chen Yucong <slaoub@gmail.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Garnier <thgarnie@google.com>
Link: https://lkml.kernel.org/r/1509135945-13762-13-git-send-email-ricardo.neri-calderon@linux.intel.com
2017-11-01 21:50:11 +01:00
..
alpha pci-v4.14-fixes-6 2017-10-28 10:53:24 -07:00
arc ARC: unbork module link errors with !CONFIG_ARC_HAS_LLSC 2017-10-11 17:07:44 -07:00
arm xen: fixes for 4.14-rc7 2017-10-27 20:41:05 -07:00
arm64 Allwinner fixes for 4.14 2017-10-20 22:24:48 +02:00
blackfin
c6x arch: remove unused *_segments() macros/functions 2017-09-22 12:59:52 -10:00
cris
frv arch: remove unused *_segments() macros/functions 2017-09-22 12:59:52 -10:00
h8300
hexagon
ia64 Merge branch 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2017-09-14 17:37:26 -07:00
m32r m32r: fix build failure 2017-10-03 17:54:26 -07:00
m68k
metag arch: remove unused *_segments() macros/functions 2017-09-22 12:59:52 -10:00
microblaze arch: change default endian for microblaze 2017-09-25 15:31:26 +02:00
mips MIPS: math-emu: Remove pr_err() calls from fpu_emu() 2017-10-09 16:33:34 +02:00
mn10300 arch: remove unused *_segments() macros/functions 2017-09-22 12:59:52 -10:00
nios2 nios2 update for v4.14-rc1 2017-09-15 12:47:21 -07:00
openrisc OpenRISC patches for 4.14 2017-09-13 11:52:18 -07:00
parisc parisc: Fix detection of nonsynchronous cr16 cycle counters 2017-10-19 09:21:24 +02:00
powerpc Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2017-10-19 14:42:09 +02:00
s390 s390/kvm: fix detection of guest machine checks 2017-10-25 07:59:30 +02:00
score
sh sh: sh7269: remove nonexistent GPIO_PH[0-7] to fix pinctrl registration 2017-10-03 17:54:24 -07:00
sparc Revert commit 1a8b6d76dc ("net:add one common config...") 2017-10-09 07:43:06 -07:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2017-09-22 13:02:54 -10:00
um um/time: Fixup namespace collision 2017-09-29 10:07:44 +02:00
unicore32
x86 x86/insn-eval: Add utility function to identify string instructions 2017-11-01 21:50:11 +01:00
xtensa arch: remove unused *_segments() macros/functions 2017-09-22 12:59:52 -10:00
.gitignore
Kconfig Revert commit 1a8b6d76dc ("net:add one common config...") 2017-10-09 07:43:06 -07:00