All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary
@ 2018-08-07  1:44 Fabian Hemmer
  2018-08-07 20:26 ` [Qemu-devel] [Bug 1785734] " Richard Henderson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabian Hemmer @ 2018-08-07  1:44 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

In TCG mode, when a 16-byte write instruction (such as movdqu) is
executed at a page boundary and causes a page fault, a partial write is
executed in the first page. See the attached code for an example.

Tested on the qemu-3.0.0-rc1 release.

% gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
[snip]
page fault: addr=0x70001000 err=0x7
*(0x70000ff8+ 0) = aa
*(0x70000ff8+ 1) = aa
*(0x70000ff8+ 2) = aa
*(0x70000ff8+ 3) = aa
*(0x70000ff8+ 4) = aa
*(0x70000ff8+ 5) = aa
*(0x70000ff8+ 6) = aa
*(0x70000ff8+ 7) = aa
*(0x70000ff8+ 8) = 55
*(0x70000ff8+ 9) = 55
*(0x70000ff8+10) = 55
*(0x70000ff8+11) = 55
*(0x70000ff8+12) = 55
*(0x70000ff8+13) = 55
*(0x70000ff8+14) = 55
*(0x70000ff8+15) = 55

[snip]
page fault: addr=0x70001000 err=0x6
*(0x70000ff8+ 0) = 77
*(0x70000ff8+ 1) = 66
*(0x70000ff8+ 2) = 55
*(0x70000ff8+ 3) = 44
*(0x70000ff8+ 4) = 33
*(0x70000ff8+ 5) = 22
*(0x70000ff8+ 6) = 11
*(0x70000ff8+ 7) = 0
*(0x70000ff8+ 8) = 55
*(0x70000ff8+ 9) = 55
*(0x70000ff8+10) = 55
*(0x70000ff8+11) = 55
*(0x70000ff8+12) = 55
*(0x70000ff8+13) = 55
*(0x70000ff8+14) = 55
*(0x70000ff8+15) = 55

** Affects: qemu
     Importance: Undecided
         Status: New

** Attachment added: "qemu-bug2.c"
   https://bugs.launchpad.net/bugs/1785734/+attachment/5172358/+files/qemu-bug2.c

** Description changed:

  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write is
  executed in the first page. See the attached code for an example.
  
  Tested on the qemu-3.0.0-rc1 release.
  
- 
  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
- *(0x70000ff8+ 0) = aa
- *(0x70000ff8+ 1) = aa
- *(0x70000ff8+ 2) = aa
- *(0x70000ff8+ 3) = aa
- *(0x70000ff8+ 4) = aa
- *(0x70000ff8+ 5) = aa
- *(0x70000ff8+ 6) = aa
- *(0x70000ff8+ 7) = aa
- *(0x70000ff8+ 8) = 55
- *(0x70000ff8+ 9) = 55
- *(0x70000ff8+10) = 55
- *(0x70000ff8+11) = 55
- *(0x70000ff8+12) = 55
- *(0x70000ff8+13) = 55
- *(0x70000ff8+14) = 55
- *(0x70000ff8+15) = 55
+ [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55
  
- *(0x70000ff8+ 0) = aa
- *(0x70000ff8+ 1) = aa
- *(0x70000ff8+ 2) = aa
- *(0x70000ff8+ 3) = aa
- *(0x70000ff8+ 4) = aa
- *(0x70000ff8+ 5) = aa
- *(0x70000ff8+ 6) = aa
- *(0x70000ff8+ 7) = aa
- *(0x70000ff8+ 8) = 55
- *(0x70000ff8+ 9) = 55
- *(0x70000ff8+10) = 55
- *(0x70000ff8+11) = 55
- *(0x70000ff8+12) = 55
- *(0x70000ff8+13) = 55
- *(0x70000ff8+14) = 55
- *(0x70000ff8+15) = 55
+ [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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

Title:
  movdqu partial write at page boundary

Status in QEMU:
  New

Bug description:
  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write
  is executed in the first page. See the attached code for an example.

  Tested on the qemu-3.0.0-rc1 release.

  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
  [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

  [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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

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

* [Qemu-devel] [Bug 1785734] Re: movdqu partial write at page boundary
  2018-08-07  1:44 [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary Fabian Hemmer
@ 2018-08-07 20:26 ` Richard Henderson
  2018-08-07 22:26 ` pranith
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2018-08-07 20:26 UTC (permalink / raw)
  To: qemu-devel

This is a part of a class of related problems for qemu linux-user, in
that any non-atomic store is not validated before initiating a partial
write.

For instance, qemu-x86_64, built for arm32, would show this same partial
store problem for any 64-bit write crossing a page boundary because we
are forced by the limits of the host to split the store into two 32-bit
pieces.

While we could probably fix this specific case fairly easily, because it
is implemented with an external helper in the first place, we would need
some new infrastructure to handle the more general problem.  Exactly
what form that should take would need some thought and discussion.

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

Title:
  movdqu partial write at page boundary

Status in QEMU:
  New

Bug description:
  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write
  is executed in the first page. See the attached code for an example.

  Tested on the qemu-3.0.0-rc1 release.

  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
  [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

  [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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

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

* [Qemu-devel] [Bug 1785734] Re: movdqu partial write at page boundary
  2018-08-07  1:44 [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary Fabian Hemmer
  2018-08-07 20:26 ` [Qemu-devel] [Bug 1785734] " Richard Henderson
@ 2018-08-07 22:26 ` pranith
  2021-05-11  5:13 ` Thomas Huth
  2021-07-11  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: pranith @ 2018-08-07 22:26 UTC (permalink / raw)
  To: qemu-devel

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

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

Title:
  movdqu partial write at page boundary

Status in QEMU:
  Confirmed

Bug description:
  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write
  is executed in the first page. See the attached code for an example.

  Tested on the qemu-3.0.0-rc1 release.

  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
  [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

  [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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

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

* [Bug 1785734] Re: movdqu partial write at page boundary
  2018-08-07  1:44 [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary Fabian Hemmer
  2018-08-07 20:26 ` [Qemu-devel] [Bug 1785734] " Richard Henderson
  2018-08-07 22:26 ` pranith
@ 2021-05-11  5:13 ` Thomas Huth
  2021-07-11  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2021-05-11  5:13 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently moving 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 the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

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

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" or "Confirmed" within the next 60 days (other-
wise it will get closed as "Expired"). We will then eventually migrate
the ticket automatically to the new system (but you won't be the reporter
of the bug in the new system and thus you won't get notified on changes
anymore).

Thank you and sorry for the inconvenience.


** Changed in: qemu
       Status: Confirmed => 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/1785734

Title:
  movdqu partial write at page boundary

Status in QEMU:
  Incomplete

Bug description:
  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write
  is executed in the first page. See the attached code for an example.

  Tested on the qemu-3.0.0-rc1 release.

  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
  [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

  [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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


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

* [Bug 1785734] Re: movdqu partial write at page boundary
  2018-08-07  1:44 [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary Fabian Hemmer
                   ` (2 preceding siblings ...)
  2021-05-11  5:13 ` Thomas Huth
@ 2021-07-11  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Launchpad Bug Tracker @ 2021-07-11  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

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

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

Title:
  movdqu partial write at page boundary

Status in QEMU:
  Expired

Bug description:
  In TCG mode, when a 16-byte write instruction (such as movdqu) is
  executed at a page boundary and causes a page fault, a partial write
  is executed in the first page. See the attached code for an example.

  Tested on the qemu-3.0.0-rc1 release.

  % gcc -m32 qemu-bug2.c && ./a.out && echo && qemu-i386 ./a.out
  [snip]
  page fault: addr=0x70001000 err=0x7
  *(0x70000ff8+ 0) = aa
  *(0x70000ff8+ 1) = aa
  *(0x70000ff8+ 2) = aa
  *(0x70000ff8+ 3) = aa
  *(0x70000ff8+ 4) = aa
  *(0x70000ff8+ 5) = aa
  *(0x70000ff8+ 6) = aa
  *(0x70000ff8+ 7) = aa
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

  [snip]
  page fault: addr=0x70001000 err=0x6
  *(0x70000ff8+ 0) = 77
  *(0x70000ff8+ 1) = 66
  *(0x70000ff8+ 2) = 55
  *(0x70000ff8+ 3) = 44
  *(0x70000ff8+ 4) = 33
  *(0x70000ff8+ 5) = 22
  *(0x70000ff8+ 6) = 11
  *(0x70000ff8+ 7) = 0
  *(0x70000ff8+ 8) = 55
  *(0x70000ff8+ 9) = 55
  *(0x70000ff8+10) = 55
  *(0x70000ff8+11) = 55
  *(0x70000ff8+12) = 55
  *(0x70000ff8+13) = 55
  *(0x70000ff8+14) = 55
  *(0x70000ff8+15) = 55

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


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

end of thread, other threads:[~2021-07-11  4:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07  1:44 [Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary Fabian Hemmer
2018-08-07 20:26 ` [Qemu-devel] [Bug 1785734] " Richard Henderson
2018-08-07 22:26 ` pranith
2021-05-11  5:13 ` Thomas Huth
2021-07-11  4:17 ` Launchpad Bug Tracker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.