[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161582326531.398.2798335970710554814.tip-bot2@tip-bot2>
Date: Mon, 15 Mar 2021 15:47:45 -0000
From: "tip-bot2 for Borislav Petkov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Borislav Petkov <bp@...e.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/core] x86/tools/insn_decoder_test: Convert to insn_decode()
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 0c925c61dae18ee3cb93a61cc9dd9562a066034d
Gitweb: https://git.kernel.org/tip/0c925c61dae18ee3cb93a61cc9dd9562a066034d
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Fri, 20 Nov 2020 15:01:20 +01:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 15 Mar 2021 12:09:09 +01:00
x86/tools/insn_decoder_test: Convert to insn_decode()
Simplify code, no functional changes.
Signed-off-by: Borislav Petkov <bp@...e.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-17-bp@alien8.de
---
arch/x86/tools/insn_decoder_test.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/x86/tools/insn_decoder_test.c b/arch/x86/tools/insn_decoder_test.c
index 34eda63..472540a 100644
--- a/arch/x86/tools/insn_decoder_test.c
+++ b/arch/x86/tools/insn_decoder_test.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
while (fgets(line, BUFSIZE, stdin)) {
char copy[BUFSIZE], *s, *tab1, *tab2;
- int nb = 0;
+ int nb = 0, ret;
unsigned int b;
if (line[0] == '<') {
@@ -148,10 +148,12 @@ int main(int argc, char **argv)
} else
break;
}
+
/* Decode an instruction */
- insn_init(&insn, insn_buff, sizeof(insn_buff), x86_64);
- insn_get_length(&insn);
- if (insn.length != nb) {
+ ret = insn_decode(&insn, insn_buff, sizeof(insn_buff),
+ x86_64 ? INSN_MODE_64 : INSN_MODE_32);
+
+ if (ret < 0 || insn.length != nb) {
warnings++;
pr_warn("Found an x86 instruction decoder bug, "
"please report this.\n", sym);
Powered by blists - more mailing lists