mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
Decode Xen and KVM's emulate-prefix signature by x86 insn decoder. It is called "prefix" but actually not x86 instruction prefix, so this adds insn.emulate_prefix_size field instead of reusing insn.prefixes. If x86 decoder finds a special sequence of instructions of XEN_EMULATE_PREFIX and 'ud2a; .ascii "kvm"', it just counts the length, set insn.emulate_prefix_size and fold it with the next instruction. In other words, the signature and the next instruction is treated as a single instruction. Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Cc: Juergen Gross <[email protected]> Cc: [email protected] Cc: Boris Ostrovsky <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Andrew Cooper <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: [email protected] Cc: Randy Dunlap <[email protected]> Link: https://lkml.kernel.org/r/156777564986.25081.4964537658500952557.stgit@devnote2
53 lines
1.1 KiB
Bash
Executable File
53 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
FILES='
|
|
arch/x86/include/asm/inat_types.h
|
|
arch/x86/include/asm/orc_types.h
|
|
arch/x86/include/asm/emulate_prefix.h
|
|
arch/x86/lib/x86-opcode-map.txt
|
|
arch/x86/tools/gen-insn-attr-x86.awk
|
|
'
|
|
|
|
check_2 () {
|
|
file1=$1
|
|
file2=$2
|
|
|
|
shift
|
|
shift
|
|
|
|
cmd="diff $* $file1 $file2 > /dev/null"
|
|
|
|
test -f $file2 && {
|
|
eval $cmd || {
|
|
echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
|
|
echo diff -u $file1 $file2
|
|
}
|
|
}
|
|
}
|
|
|
|
check () {
|
|
file=$1
|
|
|
|
shift
|
|
|
|
check_2 tools/$file $file $*
|
|
}
|
|
|
|
if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
|
|
exit 0
|
|
fi
|
|
|
|
cd ../..
|
|
|
|
for i in $FILES; do
|
|
check $i
|
|
done
|
|
|
|
check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
|
|
check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
|
|
check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
|
|
check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'
|
|
|
|
cd -
|