[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 02/10] cpu-exec: introduce loop exit with restore
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [PATCH v6 02/10] cpu-exec: introduce loop exit with restore function |
Date: |
Tue, 07 Jul 2015 16:31:09 +0300 |
User-agent: |
StGit/0.16 |
This patch introduces loop exit function, which also
restores guest CPU state according to the value of host
program counter.
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Aurelien Jarno <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
cpu-exec.c | 9 +++++++++
include/exec/exec-all.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 2ffeb6e..cad1563 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -133,6 +133,15 @@ void cpu_loop_exit(CPUState *cpu)
siglongjmp(cpu->jmp_env, 1);
}
+void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
+{
+ if (pc) {
+ cpu_restore_state(cpu, pc);
+ }
+ cpu->current_tb = NULL;
+ siglongjmp(cpu->jmp_env, 1);
+}
+
/* exit the current TB from a signal handler. The host registers are
restored in a state compatible with the CPU emulator
*/
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 2573e8c..0d038ba 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -90,6 +90,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
int cflags);
void cpu_exec_init(CPUArchState *env);
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
+void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
#if !defined(CONFIG_USER_ONLY)
bool qemu_in_vcpu_thread(void);
- [Qemu-devel] [PATCH v6 09/10] target-i386: exception handling for other helper functions, (continued)
- [Qemu-devel] [PATCH v6 09/10] target-i386: exception handling for other helper functions, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 10/10] target-ppc: exceptions handling in icount mode, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 06/10] target-i386: exception handling for div instructions, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 05/10] target-i386: exception handling for FPU instructions, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 07/10] target-i386: exception handling for memory helpers, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 04/10] target-i386: introduce new raise_exception functions, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 03/10] target-mips: improve exception handling, Pavel Dovgalyuk, 2015/07/07
- [Qemu-devel] [PATCH v6 02/10] cpu-exec: introduce loop exit with restore function,
Pavel Dovgalyuk <=