qemu-devel
[Top][All Lists]
Advanced

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

[Bug] x86 EFLAGS refresh is not happening correctly


From: Stevie Lavern
Subject: [Bug] x86 EFLAGS refresh is not happening correctly
Date: Thu, 5 Aug 2021 11:51:32 +0200

Hello,

I'm posting this here instead of opening an issue as it is not clear to me if this is a bug or not.

The issue is located in function "cpu_compute_eflags" in target/i386/cpu.h
(https://gitlab.com/qemu-project/qemu/-/blob/master/target/i386/cpu.h#L2071)

This function is exectued in an out of cpu loop context.
It is used to synchronize TCG internal eflags registers (CC_OP, CC_SRC,  etc...) with the CPU eflags field upon loop exit.
It does:
    eflags |= cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK);

Shouldn't it be:
     eflags = cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK);
as eflags is entirely reevaluated by "cpu_cc_compute_all" ?

Thanks,
Kind regards,
Stevie

reply via email to

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