[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 02/11] cpu-exec: introduce loop exit with res
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH v5 02/11] cpu-exec: introduce loop exit with restore function |
Date: |
Mon, 6 Jul 2015 12:22:56 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On 2015-07-06 11:25, Pavel Dovgalyuk wrote:
> 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 0734af2..0b5449e 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -134,6 +134,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 682cb07..6a0ccb6 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);
Note that this line is not commented in QEMU master, so your patch
doesn't apply cleanly.
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
address@hidden http://www.aurel32.net
- [Qemu-devel] [PATCH v5 00/11] Fix exceptions handling for MIPS, PowerPC, and i386, Pavel Dovgalyuk, 2015/07/06
- [Qemu-devel] [PATCH v5 01/11] softmmu: add helper function to pass through retaddr, Pavel Dovgalyuk, 2015/07/06
- [Qemu-devel] [PATCH v5 02/11] cpu-exec: introduce loop exit with restore function, Pavel Dovgalyuk, 2015/07/06
- Re: [Qemu-devel] [PATCH v5 02/11] cpu-exec: introduce loop exit with restore function,
Aurelien Jarno <=
- [Qemu-devel] [PATCH v5 04/11] target-i386: introduce new raise_exception functions, Pavel Dovgalyuk, 2015/07/06
- [Qemu-devel] [PATCH v5 05/11] target-i386: exception handling for FPU instructions, Pavel Dovgalyuk, 2015/07/06
- Re: [Qemu-devel] [PATCH v5 05/11] target-i386: exception handling for FPU instructions, Aurelien Jarno, 2015/07/06
- [Qemu-devel] [PATCH v5 03/11] target-mips: improve exceptions handling, Pavel Dovgalyuk, 2015/07/06