qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pc-bios/s390x: Pack ResetInfo struct
@ 2020-02-05 18:21 Jason J. Herne
  2020-02-06  9:55 ` Cornelia Huck
  2020-02-06 10:09 ` Christian Borntraeger
  0 siblings, 2 replies; 15+ messages in thread
From: Jason J. Herne @ 2020-02-05 18:21 UTC (permalink / raw)
  To: qemu-devel, qemu-s390x, cohuck, borntraeger

This fixes vfio-ccw when booting non-Linux operating systems. Without this
struct being packed, a few extra bytes of low core memory get overwritten when
we  assign a value to memory address 0 in jump_to_IPL_2. This is enough to
cause some non-Linux OSes of fail when booting.

The problem was introduced by:
5c6f0d5f46a77d77 "pc-bios/s390x: Fix reset psw mask".

The fix is to pack the struct thereby removing the 4 bytes of padding that get
added at the end, likely to allow an array of these structs to naturally align
on an 8-byte boundary.

Fixes: 5c6f0d5f46a7 ("pc-bios/s390x: Fix reset psw mask")
CC: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
---
 pc-bios/s390-ccw/jump2ipl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c
index da13c43cc0..1e9eaa037f 100644
--- a/pc-bios/s390-ccw/jump2ipl.c
+++ b/pc-bios/s390-ccw/jump2ipl.c
@@ -18,7 +18,7 @@
 typedef struct ResetInfo {
     uint64_t ipl_psw;
     uint32_t ipl_continue;
-} ResetInfo;
+} __attribute__((packed)) ResetInfo;
 
 static ResetInfo save;
 
-- 
2.21.1



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

end of thread, other threads:[~2020-09-01 13:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 18:21 [PATCH] pc-bios/s390x: Pack ResetInfo struct Jason J. Herne
2020-02-06  9:55 ` Cornelia Huck
2020-02-06 10:09 ` Christian Borntraeger
2020-02-06 11:00   ` Thomas Huth
2020-02-07 11:28     ` Christian Borntraeger
2020-02-07 14:02       ` Jason J. Herne
2020-08-27 10:07         ` Thomas Huth
2020-09-01 13:02           ` Jason J. Herne
2020-02-13 18:02   ` Jason J. Herne
2020-02-13 18:24     ` Christian Borntraeger
2020-02-25 10:23       ` Jason J. Herne
2020-02-25 11:13         ` Christian Borntraeger
2020-02-25 12:58           ` Jason J. Herne
2020-02-25 15:00             ` Christian Borntraeger
2020-02-25 15:05               ` Christian Borntraeger

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