[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161582326836.398.15024721671802967704.tip-bot2@tip-bot2>
Date: Mon, 15 Mar 2021 15:47:48 -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/boot/compressed/sev-es: Convert to insn_decode()
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 514ef77607b9ff184c11b88e8f100bc27f07460d
Gitweb: https://git.kernel.org/tip/514ef77607b9ff184c11b88e8f100bc27f07460d
Author: Borislav Petkov <bp@...e.de>
AuthorDate: Thu, 05 Nov 2020 17:53:20 +01:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 15 Mar 2021 11:18:35 +01:00
x86/boot/compressed/sev-es: Convert to insn_decode()
Other than simplifying the code there should be no functional changes
resulting from this.
Signed-off-by: Borislav Petkov <bp@...e.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-7-bp@alien8.de
---
arch/x86/boot/compressed/sev-es.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/x86/boot/compressed/sev-es.c b/arch/x86/boot/compressed/sev-es.c
index 27826c2..801c626 100644
--- a/arch/x86/boot/compressed/sev-es.c
+++ b/arch/x86/boot/compressed/sev-es.c
@@ -78,16 +78,15 @@ static inline void sev_es_wr_ghcb_msr(u64 val)
static enum es_result vc_decode_insn(struct es_em_ctxt *ctxt)
{
char buffer[MAX_INSN_SIZE];
- enum es_result ret;
+ int ret;
memcpy(buffer, (unsigned char *)ctxt->regs->ip, MAX_INSN_SIZE);
- insn_init(&ctxt->insn, buffer, MAX_INSN_SIZE, 1);
- insn_get_length(&ctxt->insn);
+ ret = insn_decode(&ctxt->insn, buffer, MAX_INSN_SIZE, INSN_MODE_64);
+ if (ret < 0)
+ return ES_DECODE_FAILED;
- ret = ctxt->insn.immediate.got ? ES_OK : ES_DECODE_FAILED;
-
- return ret;
+ return ES_OK;
}
static enum es_result vc_write_mem(struct es_em_ctxt *ctxt,
Powered by blists - more mailing lists