summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author项小羽 <[email protected]>2022-07-15 09:20:57 +0000
committer项小羽 <[email protected]>2022-07-15 09:20:57 +0000
commit19c38fdbf2f27cc2bcb18aadb27037f0363d9c69 (patch)
treea4be51d6117c871ee9533b644ea6ff78ad7374cd
parent8077f13cc8d37d229ced48755084563ec94b94c6 (diff)
modify clui instruction implement
-rw-r--r--target/i386/helper.h3
-rw-r--r--target/i386/tcg/seg_helper.c11
-rw-r--r--target/i386/tcg/translate.c10
3 files changed, 13 insertions, 11 deletions
diff --git a/target/i386/helper.h b/target/i386/helper.h
index efe43bac93..782ac9b430 100644
--- a/target/i386/helper.h
+++ b/target/i386/helper.h
@@ -235,4 +235,5 @@ DEF_HELPER_1(rdrand, tl, env)
DEF_HELPER_2(senduipi, void, env ,int) // 改
DEF_HELPER_1(rrnzero, void, env)
DEF_HELPER_1(uiret, void, env)
-DEF_HELPER_1(stui, void, env) \ No newline at end of file
+DEF_HELPER_1(stui, void, env)
+DEF_HELPER_1(clui, void, env) \ No newline at end of file
diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c
index 229fb5b50a..ddb8525c62 100644
--- a/target/i386/tcg/seg_helper.c
+++ b/target/i386/tcg/seg_helper.c
@@ -888,9 +888,10 @@ static bool uif_enable(CPUX86State *env){
void helper_stui(CPUX86State *env){
switch_uif(env, true);
- // DeviceState *dev = cpu_get_current_apic();
- // int id = get_apic_id(dev);
- // qemu_log("xxxx apic id is %d\n", id);
+}
+
+void helper_clui(CPUX86State *env){
+ switch_uif(env, false);
}
@@ -936,8 +937,8 @@ void helper_uiret(CPUX86State *env){
}
static void helper_clear_eoi(CPUX86State *env){
- DeviceState *dev = cpu_get_current_apic();
- apic_clear_eoi(dev);
+ DeviceState *dev = cpu_get_current_apic();
+ apic_clear_eoi(dev);
}
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 86da40b7f5..a3b425c637 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -7712,8 +7712,8 @@ static inline void gen_op_ld_v(DisasContext *s, int idx, TCGv t0, TCGv a0)
gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1);
break;
case 0xee: /* rdpkru */
- if(prefixes & PREFIX_REPZ){
- env->uintr_uif = 0;
+ if(prefixes & PREFIX_REPZ){ /* CLUI */
+ gen_helper_clui(cpu_env);
break;
}
if (prefixes & PREFIX_LOCK) {
@@ -7724,19 +7724,19 @@ static inline void gen_op_ld_v(DisasContext *s, int idx, TCGv t0, TCGv a0)
tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], s->tmp1_i64);
break;
case 0xec:
- if (prefixes & PREFIX_REPZ){ // UIRET
+ if (prefixes & PREFIX_REPZ){ /* UIRET */
gen_helper_uiret(cpu_env);
uiret_called = true;
gen_eob(s);
}
break;
case 0xed:
- if (prefixes & PREFIX_REPZ){ // TESTUI
+ if (prefixes & PREFIX_REPZ){ /* TESTUI */
qemu_log("qemu:caught 0xf30f01ed TESTUI\n"); // 改
}
break;
case 0xef: /* wrpkru */
- if(prefixes & PREFIX_REPZ){ // STUI
+ if(prefixes & PREFIX_REPZ){ /* STUI */
gen_helper_stui(cpu_env);
break;
}