diff options
| author | Tom Lendacky <thomas.lendacky@amd.com> | 2026-02-26 14:41:12 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-25 11:05:59 +0100 |
| commit | fc3454a20bef8c624146b5c4f428cda0d39c56a0 (patch) | |
| tree | b0b8364cdd867a188a21ab0da3e27f7c7dcb32c6 /arch | |
| parent | 03c29d6d3719c78e839eeaa8f2ce6c40f521fad9 (diff) | |
| download | linux-fc3454a20bef8c624146b5c4f428cda0d39c56a0.tar.gz linux-fc3454a20bef8c624146b5c4f428cda0d39c56a0.tar.bz2 linux-fc3454a20bef8c624146b5c4f428cda0d39c56a0.zip | |
x86/sev: Check for MWAITX and MONITORX opcodes in the #VC handler
[ Upstream commit e70316d17f6ab49a6038ffd115397fd68f8c7be8 ]
The MWAITX and MONITORX instructions generate the same #VC error code as
the MWAIT and MONITOR instructions, respectively. Update the #VC handler
opcode checking to also support the MWAITX and MONITORX opcodes.
Fixes: e3ef461af35a ("x86/sev: Harden #VC instruction emulation somewhat")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/453d5a7cfb4b9fe818b6fb67f93ae25468bc9e23.1713793161.git.thomas.lendacky@amd.com
Signed-off-by: Wenshan Lan <jetlan9@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/x86/kernel/sev-shared.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c index 1dbf114b3365..caa3de2dcd0a 100644 --- a/arch/x86/kernel/sev-shared.c +++ b/arch/x86/kernel/sev-shared.c @@ -1237,12 +1237,14 @@ static enum es_result vc_check_opcode_bytes(struct es_em_ctxt *ctxt, break; case SVM_EXIT_MONITOR: - if (opcode == 0x010f && modrm == 0xc8) + /* MONITOR and MONITORX instructions generate the same error code */ + if (opcode == 0x010f && (modrm == 0xc8 || modrm == 0xfa)) return ES_OK; break; case SVM_EXIT_MWAIT: - if (opcode == 0x010f && modrm == 0xc9) + /* MWAIT and MWAITX instructions generate the same error code */ + if (opcode == 0x010f && (modrm == 0xc9 || modrm == 0xfb)) return ES_OK; break; |
