[PATCH] helper_syscall x86_64: clear exception_is_int

Douglas Crosher posted 1 patch 3 years, 7 months ago
Failed in applying to current master (apply log)
target/i386/seg_helper.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] helper_syscall x86_64: clear exception_is_int
Posted by Douglas Crosher 3 years, 7 months ago

The exception_is_int flag may be set on entry to helper_syscall,
e.g. after a prior interrupt that has returned, and processing
EXCP_SYSCALL as an interrupt causes it to fail so clear this flag.

Signed-off-by: Douglas Crosher <dtc-ubuntu@scieneer.com>
---
  target/i386/seg_helper.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c
index b96de068ca..be88938c2a 100644
--- a/target/i386/seg_helper.c
+++ b/target/i386/seg_helper.c
@@ -975,6 +975,7 @@ void helper_syscall(CPUX86State *env, int 
next_eip_addend)
      CPUState *cs = env_cpu(env);

      cs->exception_index = EXCP_SYSCALL;
+    env->exception_is_int = 0;
      env->exception_next_eip = env->eip + next_eip_addend;
      cpu_loop_exit(cs);
  }
-- 
2.25.4


Re: [PATCH] helper_syscall x86_64: clear exception_is_int
Posted by Paolo Bonzini 3 years, 7 months ago
On 22/09/20 06:17, Douglas Crosher wrote:
> 
> The exception_is_int flag may be set on entry to helper_syscall,
> e.g. after a prior interrupt that has returned, and processing
> EXCP_SYSCALL as an interrupt causes it to fail so clear this flag.
> 
> Signed-off-by: Douglas Crosher <dtc-ubuntu@scieneer.com>
> ---
>  target/i386/seg_helper.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c
> index b96de068ca..be88938c2a 100644
> --- a/target/i386/seg_helper.c
> +++ b/target/i386/seg_helper.c
> @@ -975,6 +975,7 @@ void helper_syscall(CPUX86State *env, int
> next_eip_addend)
>      CPUState *cs = env_cpu(env);
> 
>      cs->exception_index = EXCP_SYSCALL;
> +    env->exception_is_int = 0;
>      env->exception_next_eip = env->eip + next_eip_addend;
>      cpu_loop_exit(cs);
>  }

Queued, thanks.

Paolo