qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Bug] x86 EFLAGS refresh is not happening correctly
@ 2021-08-05  9:51 Stevie Lavern
  2021-08-05 11:24 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Stevie Lavern @ 2021-08-05  9:51 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2098 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-05 12:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-05  9:51 [Bug] x86 EFLAGS refresh is not happening correctly Stevie Lavern
2021-08-05 11:24 ` Paolo Bonzini
2021-08-05 11:33   ` Paolo Bonzini
2021-08-05 12:47     ` Stevie Lavern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).