[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/10] target/i386: sysret and sysexit are privileged
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 07/10] target/i386: sysret and sysexit are privileged |
Date: |
Tue, 20 Jun 2023 17:16:31 +0200 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 9aec7ec8288..c58f5f24ab3 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -5675,7 +5675,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
/* For Intel SYSEXIT is valid on 64-bit */
if (CODE64(s) && env->cpuid_vendor1 != CPUID_VENDOR_INTEL_1)
goto illegal_op;
- if (!PE(s)) {
+ if (!PE(s) || CPL(s) != 0) {
gen_exception_gpf(s);
} else {
gen_helper_sysexit(cpu_env, tcg_constant_i32(dflag - 1));
@@ -5697,7 +5697,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
gen_eob_worker(s, false, true);
break;
case 0x107: /* sysret */
- if (!PE(s)) {
+ if (!PE(s) || CPL(s) != 0) {
gen_exception_gpf(s);
} else {
gen_helper_sysret(cpu_env, tcg_constant_i32(dflag - 1));
--
2.40.1
- [PATCH v2 00/10] target/i386: add a few simple features, Paolo Bonzini, 2023/06/20
- [PATCH v2 03/10] target/i386: TCG supports RDSEED, Paolo Bonzini, 2023/06/20
- [PATCH v2 04/10] target/i386: TCG supports XSAVEERPTR, Paolo Bonzini, 2023/06/20
- [PATCH v2 05/10] target/i386: TCG supports WBNOINVD, Paolo Bonzini, 2023/06/20
- [PATCH v2 02/10] target/i386: TCG supports 3DNow! prefetch(w), Paolo Bonzini, 2023/06/20
- [PATCH v2 01/10] target/i386: fix INVD vmexit, Paolo Bonzini, 2023/06/20
- [PATCH v2 07/10] target/i386: sysret and sysexit are privileged,
Paolo Bonzini <=
- [PATCH v2 08/10] target/i386: implement 32-bit SYSCALL for linux-user, Paolo Bonzini, 2023/06/20
- [PATCH v2 09/10] target/i386: implement 32-bit SYSENTER for linux-user, Paolo Bonzini, 2023/06/20
- [PATCH v2 06/10] target/i386: Intel only supports SYSCALL in long mode, Paolo Bonzini, 2023/06/20
- [PATCH v2 10/10] target/i386: implement RDPID in TCG, Paolo Bonzini, 2023/06/20