Skip to content
  • Thomas Huth's avatar
    5afec76f
    tests/boot-sector: Fix the bad s390x assembler code · 5afec76f
    Thomas Huth authored
    
    
    There are currently two bugs in s390x_code[]: First, the initial jump
    uses the wrong offset, so it was jumping to 0x10014 instead of 0x10010.
    Second, LHI only loads the lower 32-bit of the register.
    
    Everything worked fine as long as the s390-ccw bios code was jumping
    here with r3 containing zeroes in the uppermost 48 bit - which just
    happened to be the case so far by accident. But we can not rely on this
    fact, and indeed one of the recent suggested patches to jump2ipl.c cause
    the newer GCCs to put different values into r3. In that case the code
    from s390x_code[] crashes very ungracefully.
    
    Thus let's make sure to jump to the right instruction, and use LGHI
    instead of LHI to make sure that we always zero out the upper bits
    of the register.
    
    Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20191217150642.27946-1-thuth@redhat.com>
    Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
    5afec76f
    tests/boot-sector: Fix the bad s390x assembler code
    Thomas Huth authored
    
    
    There are currently two bugs in s390x_code[]: First, the initial jump
    uses the wrong offset, so it was jumping to 0x10014 instead of 0x10010.
    Second, LHI only loads the lower 32-bit of the register.
    
    Everything worked fine as long as the s390-ccw bios code was jumping
    here with r3 containing zeroes in the uppermost 48 bit - which just
    happened to be the case so far by accident. But we can not rely on this
    fact, and indeed one of the recent suggested patches to jump2ipl.c cause
    the newer GCCs to put different values into r3. In that case the code
    from s390x_code[] crashes very ungracefully.
    
    Thus let's make sure to jump to the right instruction, and use LGHI
    instead of LHI to make sure that we always zero out the upper bits
    of the register.
    
    Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
    Message-Id: <20191217150642.27946-1-thuth@redhat.com>
    Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
Loading