]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
target/i386/hvf: fix lflags_to_rflags
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Apr 2025 19:39:54 +0000 (21:39 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Apr 2025 16:23:26 +0000 (18:23 +0200)
Clear the flags before adding in the ones computed from lflags.

Cc: Wei Liu <liuwe@linux.microsoft.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/hvf/x86_flags.c

index 03d6de5efc3ef86364f83180831eec115f6a78fe..fedc70a1b803a8fe17054f6d76874848f7a48c81 100644 (file)
@@ -293,6 +293,7 @@ void set_SF(CPUX86State *env, bool val)
 
 void lflags_to_rflags(CPUX86State *env)
 {
+    env->eflags &= ~(CC_C|CC_P|CC_A|CC_Z|CC_S|CC_O);
     env->eflags |= get_CF(env) ? CC_C : 0;
     env->eflags |= get_PF(env) ? CC_P : 0;
     env->eflags |= get_AF(env) ? CC_A : 0;