s390: enable detection of kernel version from bzImage
authorVasily Gorbik <gor@linux.ibm.com>
Mon, 15 Jul 2019 13:30:33 +0000 (15:30 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 23 Jul 2019 08:43:50 +0000 (10:43 +0200)
commit6abe28197024f732f1e298b1a593505282505857
tree51afb04f173a15ee3bb2f26b4ac1d8e268914da1
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b
s390: enable detection of kernel version from bzImage

Extend "parmarea" to include an offset of the version string, which is
stored as 8-byte big endian value.

To retrieve version string from bzImage reliably, one should check the
presence of "S390EP" ascii string at 0x10008 (available since v3.2),
then read the version string offset from 0x10428 (which has been 0
since v3.2 up to now). The string is null terminated.

Could be retrieved with the following "file" command magic (requires
file v5.34):
8 string \x02\x00\x00\x18\x60\x00\x00\x50\x02\x00\x00\x68\x60\x00\x00\x50\x40\x40\x40\x40\x40\x40\x40\x40 Linux S390
>0x10008       string          S390EP
>>0x10428      bequad          >0
>>>(0x10428.Q) string          >\0             \b, version %s

Reported-by: Petr Tesarik <ptesarik@suse.com>
Suggested-by: Petr Tesarik <ptesarik@suse.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/boot/Makefile
arch/s390/boot/boot.h
arch/s390/boot/head.S
arch/s390/boot/version.c [new file with mode: 0644]
arch/s390/include/asm/setup.h