qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/3] target-i386: fix memory operations in he


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH v2 3/3] target-i386: fix memory operations in helpers
Date: Wed, 17 Jun 2015 15:27:58 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-06-17 15:42, Pavel Dovgalyuk wrote:
> This patch passes TB return address into softmmu functions that are
> invoked from target helpers. This allows correct PC and icount recovering
> while handling MMU faults.
> 
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
>  target-i386/cc_helper.c   |    2 
>  target-i386/cpu.h         |    5 
>  target-i386/excp_helper.c |   23 +
>  target-i386/fpu_helper.c  |  146 +++++----
>  target-i386/helper.c      |    4 
>  target-i386/int_helper.c  |   32 +-
>  target-i386/mem_helper.c  |   39 +-
>  target-i386/misc_helper.c |   12 -
>  target-i386/ops_sse.h     |    2 
>  target-i386/seg_helper.c  |  712 
> +++++++++++++++++++++++----------------------
>  target-i386/svm_helper.c  |    4 
>  target-i386/translate.c   |   25 --
>  12 files changed, 506 insertions(+), 500 deletions(-)

[ snip ]

> diff --git a/target-i386/excp_helper.c b/target-i386/excp_helper.c
> index 99fca84..48be348 100644
> --- a/target-i386/excp_helper.c
> +++ b/target-i386/excp_helper.c
> @@ -108,6 +109,10 @@ static void QEMU_NORETURN raise_interrupt2(CPUX86State 
> *env, int intno,
>      env->error_code = error_code;
>      env->exception_is_int = is_int;
>      env->exception_next_eip = env->eip + next_eip_addend;
> +    if (retaddr) {
> +        /* now we have a real cpu fault */
> +        cpu_restore_state(cs, retaddr);
> +    }
>      cpu_loop_exit(cs);
>  }

If we have to add this pattern to all targets, it's probably better to
add a cpu_loop_exit function which takes a return address in argument to
the core code. This also has the advantage that we know that all code
has been converted once cpu_loop_exit can be removed.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]