[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/9] x86: avoid AREG0 for SMM helpers
From: |
Blue Swirl |
Subject: |
[Qemu-devel] [PATCH 5/9] x86: avoid AREG0 for SMM helpers |
Date: |
Thu, 21 Jun 2012 20:58:07 +0000 |
Add an explicit CPUX86State parameter instead of relying on AREG0.
Signed-off-by: Blue Swirl <address@hidden>
---
target-i386/Makefile.objs | 1 -
target-i386/helper.h | 2 +-
target-i386/smm_helper.c | 14 ++++----------
target-i386/translate.c | 2 +-
4 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/target-i386/Makefile.objs b/target-i386/Makefile.objs
index 370fde7..f843fe9 100644
--- a/target-i386/Makefile.objs
+++ b/target-i386/Makefile.objs
@@ -6,7 +6,6 @@ obj-$(CONFIG_KVM) += kvm.o hyperv.o
obj-$(CONFIG_LINUX_USER) += ioport-user.o
obj-$(CONFIG_BSD_USER) += ioport-user.o
-$(obj)/smm_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
$(obj)/misc_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
$(obj)/mem_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
$(obj)/seg_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
diff --git a/target-i386/helper.h b/target-i386/helper.h
index 601b8dd..ec7edca 100644
--- a/target-i386/helper.h
+++ b/target-i386/helper.h
@@ -71,7 +71,7 @@ DEF_HELPER_1(set_inhibit_irq, void, env)
DEF_HELPER_1(reset_inhibit_irq, void, env)
DEF_HELPER_2(boundw, void, tl, int)
DEF_HELPER_2(boundl, void, tl, int)
-DEF_HELPER_0(rsm, void)
+DEF_HELPER_1(rsm, void, env)
DEF_HELPER_1(into, void, int)
DEF_HELPER_1(cmpxchg8b, void, tl)
#ifdef TARGET_X86_64
diff --git a/target-i386/smm_helper.c b/target-i386/smm_helper.c
index bc1bfa2..8b04eb2 100644
--- a/target-i386/smm_helper.c
+++ b/target-i386/smm_helper.c
@@ -18,18 +18,17 @@
*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helper.h"
/* SMM support */
#if defined(CONFIG_USER_ONLY)
-void do_smm_enter(CPUX86State *env1)
+void do_smm_enter(CPUX86State *env)
{
}
-void helper_rsm(void)
+void helper_rsm(CPUX86State *env)
{
}
@@ -41,15 +40,11 @@ void helper_rsm(void)
#define SMM_REVISION_ID 0x00020000
#endif
-void do_smm_enter(CPUX86State *env1)
+void do_smm_enter(CPUX86State *env)
{
target_ulong sm_state;
SegmentCache *dt;
int i, offset;
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
qemu_log_mask(CPU_LOG_INT, "SMM: enter\n");
log_cpu_state_mask(CPU_LOG_INT, env, X86_DUMP_CCOP);
@@ -180,10 +175,9 @@ void do_smm_enter(CPUX86State *env1)
cpu_x86_update_cr4(env, 0);
env->dr[7] = 0x00000400;
CC_OP = CC_OP_EFLAGS;
- env = saved_env;
}
-void helper_rsm(void)
+void helper_rsm(CPUX86State *env)
{
target_ulong sm_state;
int i, offset;
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 126a531..2ea52ca 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -7700,7 +7700,7 @@ static target_ulong disas_insn(DisasContext *s,
target_ulong pc_start)
goto illegal_op;
gen_update_cc_op(s);
gen_jmp_im(s->pc - s->cs_base);
- gen_helper_rsm();
+ gen_helper_rsm(cpu_env);
gen_eob(s);
break;
case 0x1b8: /* SSE4.2 popcnt */
--
1.7.2.5
- [Qemu-devel] [PATCH RFT 0/9] x86 AREG0 conversion, part deux, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 2/9] x86: avoid AREG0 for condition code helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 3/9] x86: avoid AREG0 for integer helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 5/9] x86: avoid AREG0 for SMM helpers,
Blue Swirl <=
- [Qemu-devel] [PATCH 6/9] x86: avoid AREG0 for misc helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 4/9] x86: avoid AREG0 for SVM helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 7/9] x86: use wrappers for memory access helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 1/9] x86: avoid AREG0 for FPU helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 8/9] x86: avoid AREG0 in segmentation helpers, Blue Swirl, 2012/06/21
- [Qemu-devel] [PATCH 9/9] x86: switch to AREG0 free mode, Blue Swirl, 2012/06/21