qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF
@ 2019-05-13 17:30 Sonicadvance1
  2019-05-13 17:31 ` [Qemu-devel] [Bug 1828867] " Sonicadvance1
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sonicadvance1 @ 2019-05-13 17:30 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
On hardware the REX prefix doesn't effect behaviour of these instructions at all.
QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

I've attached a patch that is super terrible just so I can work around
the issue locally and to sort of show off how it is to be "fixed"

** Affects: qemu
     Importance: Undecided
         Status: New

** Patch added: "Terrible terrible patch"
   https://bugs.launchpad.net/bugs/1828867/+attachment/5263494/+files/lahf_sahf.diff

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  New

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

* [Qemu-devel] [Bug 1828867] Re: QEmu translation is incorrect when using REX in combination with LAHF/SAHF
  2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
@ 2019-05-13 17:31 ` Sonicadvance1
  2019-05-13 20:24 ` Alex Bennée
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sonicadvance1 @ 2019-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel

Here's also a basic test that can be run on hardware and have rflags and
rsp inspected after each instruction just to see how hardware doesn't
effect it.

** Attachment added: "a.cpp"
   https://bugs.launchpad.net/qemu/+bug/1828867/+attachment/5263495/+files/a.cpp

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  New

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

* [Qemu-devel] [Bug 1828867] Re: QEmu translation is incorrect when using REX in combination with LAHF/SAHF
  2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
  2019-05-13 17:31 ` [Qemu-devel] [Bug 1828867] " Sonicadvance1
@ 2019-05-13 20:24 ` Alex Bennée
  2021-04-22  6:15 ` Thomas Huth
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2019-05-13 20:24 UTC (permalink / raw)
  To: qemu-devel

** Tags added: tcg testcase x86

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  New

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

* [Bug 1828867] Re: QEmu translation is incorrect when using REX in combination with LAHF/SAHF
  2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
  2019-05-13 17:31 ` [Qemu-devel] [Bug 1828867] " Sonicadvance1
  2019-05-13 20:24 ` Alex Bennée
@ 2021-04-22  6:15 ` Thomas Huth
  2021-04-22  6:46 ` Ryan Houdek
  2021-05-04 15:46 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2021-04-22  6:15 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently considering to move its bug tracking to
another system. For this we need to know which bugs are still valid
and which could be closed already. Thus we are setting older bugs to
"Incomplete" now.

If you still think this bug report here is valid, then please switch
the state back to "New" within the next 60 days, otherwise this report
will be marked as "Expired". Or please mark it as "Fix Released" if
the problem has been solved with a newer version of QEMU already.

Thank you and sorry for the inconvenience.

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  Incomplete

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

* [Bug 1828867] Re: QEmu translation is incorrect when using REX in combination with LAHF/SAHF
  2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
                   ` (2 preceding siblings ...)
  2021-04-22  6:15 ` Thomas Huth
@ 2021-04-22  6:46 ` Ryan Houdek
  2021-05-04 15:46 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: Ryan Houdek @ 2021-04-22  6:46 UTC (permalink / raw)
  To: qemu-devel

This is still relevant.

** Changed in: qemu
       Status: Incomplete => New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  New

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

* [Bug 1828867] Re: QEmu translation is incorrect when using REX in combination with LAHF/SAHF
  2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
                   ` (3 preceding siblings ...)
  2021-04-22  6:46 ` Ryan Houdek
@ 2021-05-04 15:46 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2021-05-04 15:46 UTC (permalink / raw)
  To: qemu-devel

This is an automated cleanup. This bug report has been moved to QEMU's
new bug tracker on gitlab.com and thus gets marked as 'expired' now.
Please continue with the discussion here:

 https://gitlab.com/qemu-project/qemu/-/issues/130


** Changed in: qemu
       Status: New => Expired

** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #130
   https://gitlab.com/qemu-project/qemu/-/issues/130

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1828867

Title:
  QEmu translation is incorrect when using REX in combination with
  LAHF/SAHF

Status in QEMU:
  Expired

Bug description:
  When translating code that is using LAHF and SAHF in combination with the REX prefix then qemu translates incorrectly.
  These two instructions only ever use the AH register. Contrary to other instructions where if you use REX + high bit offsets then it'll pull in rsp and a few other registers.
  On hardware the REX prefix doesn't effect behaviour of these instructions at all.
  QEMU incorrectly selects RSP as the register of choice here due to this combination of REX + AH register usage.

  I've attached a patch that is super terrible just so I can work around
  the issue locally and to sort of show off how it is to be "fixed"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1828867/+subscriptions


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

end of thread, other threads:[~2021-05-04 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 17:30 [Qemu-devel] [Bug 1828867] [NEW] QEmu translation is incorrect when using REX in combination with LAHF/SAHF Sonicadvance1
2019-05-13 17:31 ` [Qemu-devel] [Bug 1828867] " Sonicadvance1
2019-05-13 20:24 ` Alex Bennée
2021-04-22  6:15 ` Thomas Huth
2021-04-22  6:46 ` Ryan Houdek
2021-05-04 15:46 ` Thomas Huth

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).