On Wed, 5 Feb 2020 13:21:26 -0500 "Jason J. Herne" <jjhe...@linux.ibm.com> wrote:
> 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. s/of/to/ > > The problem was introduced by: > 5c6f0d5f46a77d77 "pc-bios/s390x: Fix reset psw mask". So, what introduced the problem was turning two 32 bit values into a 64 bit value? > > 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 <fran...@linux.ibm.com> > Signed-off-by: Jason J. Herne <jjhe...@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; > I'm wondering if we have more stuff like that lurking in the bios.