diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2025-04-03 21:39:54 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-04-17 18:23:26 +0200 |
commit | 94a159f3dc737d00749cc930adaec112abe07b3c (patch) | |
tree | f813b1d3d7832cbdd55b1b6f18556cd43499c0d6 | |
parent | f6b5f71f04529d3f56b35f91badac9f5e7e225ca (diff) | |
download | qemu-94a159f3dc737d00749cc930adaec112abe07b3c.zip qemu-94a159f3dc737d00749cc930adaec112abe07b3c.tar.gz qemu-94a159f3dc737d00749cc930adaec112abe07b3c.tar.bz2 |
target/i386/hvf: fix lflags_to_rflags
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>
-rw-r--r-- | target/i386/hvf/x86_flags.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/target/i386/hvf/x86_flags.c b/target/i386/hvf/x86_flags.c index 03d6de5..fedc70a 100644 --- a/target/i386/hvf/x86_flags.c +++ b/target/i386/hvf/x86_flags.c @@ -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; |