[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 30/32] lcall/lret arch specific accel hooks
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 30/32] lcall/lret arch specific accel hooks |
Date: |
Thu, 23 Oct 2008 12:19:14 -0200 |
provide arch specific hooks for far calls in op_helper.c
Signed-off-by: Glauber Costa <address@hidden>
---
kqemu.c | 10 ++++++++++
target-i386/accel86.h | 16 ++++++++++++++++
target-i386/op_helper.c | 14 ++------------
3 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/kqemu.c b/kqemu.c
index 1934aa5..7b87a58 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -1205,11 +1205,21 @@ static void kqemu_syscall_return(CPUState *env)
}
}
+static void kqemu_long_exit_loop(CPUState *env)
+{
+ if (kqemu_kernel_flags_ok(env)) {
+ env->exception_index = -1;
+ cpu_loop_exit();
+ }
+}
+
QEMUAccel86 kqemu_accel86 = {
.get_msr = kqemu_get_msr,
.set_msr = kqemu_set_msr,
.interrupt_return = kqemu_interrupt_return,
.syscall_return = kqemu_syscall_return,
+ .long_call = kqemu_long_exit_loop,
+ .long_ret = kqemu_long_exit_loop,
};
QEMUAccel kqemu_accel = {
diff --git a/target-i386/accel86.h b/target-i386/accel86.h
index 1624a64..a7ba39b 100644
--- a/target-i386/accel86.h
+++ b/target-i386/accel86.h
@@ -8,6 +8,8 @@ typedef struct QEMUAccel86 {
int (*set_msr)(int msr, uint64_t value);
void (*interrupt_return)(CPUState *env);
void (*syscall_return)(CPUState *env);
+ void (*long_call)(CPUState *env);
+ void (*long_ret)(CPUState *env);
} QEMUAccel86;
#define accel86_call_func ((QEMUAccel86 *)(current_accel->arch))
@@ -40,5 +42,19 @@ static inline void accel_syscall_return(CPUState *env)
accel86_call_func->syscall_return(env);
}
+static inline void accel_long_call(CPUState *env)
+{
+ if (!current_accel->arch)
+ return;
+ accel86_call_func->syscall_return(env);
+}
+
+static inline void accel_long_ret(CPUState *env)
+{
+ if (!current_accel->arch)
+ return;
+ accel86_call_func->syscall_return(env);
+}
+
#endif
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index a831a4d..addd42a 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -2617,12 +2617,7 @@ void helper_lcall_protected(int new_cs, target_ulong
new_eip,
SET_ESP(sp, sp_mask);
EIP = offset;
}
-#ifdef USE_KQEMU
- if (kqemu_is_ok(env)) {
- env->exception_index = -1;
- cpu_loop_exit();
- }
-#endif
+ accel_long_call(env);
}
/* real and vm86 mode iret */
@@ -2918,12 +2913,7 @@ void helper_iret_protected(int shift, int next_eip)
void helper_lret_protected(int shift, int addend)
{
helper_ret_protected(shift, 0, addend);
-#ifdef USE_KQEMU
- if (kqemu_is_ok(env)) {
- env->exception_index = -1;
- cpu_loop_exit();
- }
-#endif
+ accel_long_ret(env);
}
void helper_sysenter(void)
--
1.5.5.1
- [Qemu-devel] [PATCH 20/32] accel_trace_io, (continued)
- [Qemu-devel] [PATCH 20/32] accel_trace_io, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 27/32] arch-specific hooks for accelerator, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 31/32] remove kqemu_is_ok tests., Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 30/32] lcall/lret arch specific accel hooks,
Glauber Costa <=
- [Qemu-devel] [PATCH 25/32] provide accel hook for cpu_exec, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 32/32] clean up kqemu code, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 29/32] sysret/sysexit arch specific accelerator, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 28/32] iret arch specific accelerator, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 19/32] add hook to cpu_register_physical_memory, Glauber Costa, 2008/10/23
- [Qemu-devel] Re: [PATCH 0/32] New shot at accelerators, Jan Kiszka, 2008/10/23
- [Qemu-devel] Re: [PATCH 0/32] New shot at accelerators, Anthony Liguori, 2008/10/23