aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw/bootmap.c
AgeCommit message (Collapse)AuthorFilesLines
2021-05-09pc-bios/s390-ccw/bootmap: Silence compiler warning from ClangThomas Huth1-1/+1
When compiling the s390-ccw bios with Clang, the compiler complains: pc-bios/s390-ccw/bootmap.c:302:9: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] if (!mbr->dev_type == DEV_TYPE_ECKD) { ^ ~~ The code works (more or less by accident), since dev_type can only be 0 or 1, but it's better of course to use the intended != operator here instead. Fixes: 5dc739f343 ("Allow booting in case the first virtio-blk disk is bad") Message-Id: <20210421163331.358178-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-05-09pc-bios/s390-ccw: don't try to read the next block if end of chunk is reachedMarc Hartmayer1-1/+1
Don't read the block if a null block number is reached, because this means that the end of chunk is reached. Reviewed-by: Collin Walling <walling@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20210416074736.17409-1-mhartmay@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-10-06pc-bios: s390x: Use reset PSW if avaliableJanosch Frank1-2/+4
If a blob provides a reset PSW then we should use it instead of branching to the PSW address and using our own mask. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201006094249.50640-4-frankja@linux.ibm.com> [thuth: Use Elvis operator to shorten long line] Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-10-06pc-bios: s390x: Fix bootmap.c zipl component entry data handlingJanosch Frank1-2/+3
The two main types of zipl component entries are execute and load/data. The last member of the component entry struct therefore denotes either a PSW or an address. Let's make this a bit more clear by introducing a union and cleaning up the code that uses that struct member. The execute type component entries written by zipl contain short PSWs, not addresses. Let's mask them and only pass the address part to jump_to_IPL_code(uint64_t address) because it expects an address as visible by the name of the argument. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201006094249.50640-2-frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-10-06pc-bios/s390-ccw: break loop if a null block number is reachedMarc Hartmayer1-1/+1
Break the loop if `cur_block_nr` is a null block number because this means that the end of chunk is reached. In this case we will try to boot the default entry. Fixes: ba831b25262a ("s390-ccw: read stage2 boot loader data to find menu") Reviewed-by: Collin Walling <walling@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200924085926.21709-3-mhartmay@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-10-06pc-bios/s390-ccw: fix off-by-one errorMarc Hartmayer1-1/+1
This error takes effect when the magic value "zIPL" is located at the end of a block. For example if s2_cur_blk = 0x7fe18000 and the magic value "zIPL" is located at 0x7fe18ffc - 0x7fe18fff. Fixes: ba831b25262a ("s390-ccw: read stage2 boot loader data to find menu") Reviewed-by: Collin Walling <walling@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200924085926.21709-2-mhartmay@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> [thuth: Use "<= ... - 4" instead of "< ... - 3"] Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-10-06pc-bios/s390-ccw: Allow booting in case the first virtio-blk disk is badThomas Huth1-11/+23
If you try to boot with two virtio-blk disks (without bootindex), and only the second one is bootable, the s390-ccw bios currently stops at the first disk and does not continue booting from the second one. This is annoying - and all other major QEMU firmwares succeed to boot from the second disk in this case, so we should do the same in the s390-ccw bios, too. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20200806105349.632-8-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-07-02pc-bios: s390x: Use ebcdic2ascii tableJanosch Frank1-3/+1
Why should we do conversion of a ebcdic value if we have a handy table where we could look up the ascii value instead? Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20200624075226.92728-10-frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-05-08s390-bios: Skip bootmap signature entriesJason J. Herne1-2/+17
Newer versions of zipl have the ability to write signature entries to the boot script for secure boot. We don't yet support secure boot, but we need to skip over signature entries while reading the boot script in order to maintain our ability to boot guest operating systems that have a secure bootloader. Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com> Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Message-Id: <1556543381-12671-1-git-send-email-jjherne@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-05-02pc-bios/s390-ccw/net: Use diag308 to reset machine before jumping to the OSThomas Huth1-62/+1
The netboot firmware so far simply jumped directly into the OS kernel after the download has been completed. This, however, bears the risk that the virtio-net device still might be active in the background and incoming packets are still placed into the buffers - which could destroy memory of the now-running Linux kernel in case it did not take over the device fast enough. Also the SCLP console is not put into a well-defined state here. We should hand over the system in a clean state when jumping into the kernel, so let's use the same mechanism as it's done in the main s390-ccw firmware and reset the machine with diag308 into a clean state before jumping into the OS kernel code. To be able to share the code with the main s390-ccw firmware, the related functions are now extracted from bootmap.c into a new file called jump2ipl.c. Since we now also set the boot device schid at address 184 for the network boot device, this patch also slightly changes the way how we detect the entry points for non-ELF binary images: The code now looks for the "S390EP" magic first and then jumps to 0x10000 in case it has been found. This is necessary for booting from network devices, since the normal kernel code (where the PSW at ddress 0 points to) tries to do a block load from the boot device. This of course fails for a virtio-net device and causes the kernel to abort with a panic-PSW silently. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-05-02pc-bios/s390-ccw: fix non-sequential boot entries (enum)Collin Walling1-5/+7
zIPL boot menu entries can be non-sequential. Let's account for this issue for the s390 enumerated boot menu. Since we can no longer print a range of available entries to the user, we have to present a list of each available entry. An example of this menu: s390-ccw Enumerated Boot Menu. [0] default [1] [2] [7] [8] [9] [11] [12] Please choose: Signed-off-by: Collin Walling <walling@linux.ibm.com> Reported-by: Vasily Gorbik <gor@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-05-02pc-bios/s390-ccw: rename MAX_TABLE_ENTRIES to MAX_BOOT_ENTRIESCollin Walling1-3/+3
The MAX_TABLE_ENTRIES constant has a name that is too generic. As we want to declare a limit for boot menu entries, let's rename it to a more fitting MAX_BOOT_ENTRIES and set its value to 31 (30 boot entries and 1 default entry). Also we move it from bootmap.h to s390-ccw.h to make it available for menu.c in a later patch. Signed-off-by: Collin Walling <walling@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-04-09s390: Do not pass inofficial IPL type to the guestViktor Mihajlovski1-0/+7
IPL over a virtio-scsi device requires special handling not available in the real architecture. For this purpose the IPL type 0xFF has been chosen as means of communication between QEMU and the pc-bios. However, a guest OS could be confused by seeing an unknown IPL type. This change sets the IPL parameter type to 0x02 (CCW) to prevent this. Pre-existing Linux has looked up the IPL parameters only in the case of FCP IPL. This means that the behavior should stay the same even if Linux checks for the IPL type unconditionally. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Message-Id: <1522940844-12336-4-git-send-email-mihajlov@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-03-08pc-bios/s390-ccw: Move string arrays from bootmap header to .c fileThomas Huth1-0/+20
bootmap.h can currently only be included once - otherwise the linker complains about multiple definitions of the "magic" strings. It's a bad style to define string arrays in header files, so let's better move these to the bootmap.c file instead where they are used. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1520317081-5341-1-git-send-email-thuth@redhat.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-02-26s390-ccw: interactive boot menu for scsiCollin L. Walling1-0/+4
Interactive boot menu for scsi. This follows a similar procedure as the interactive menu for eckd dasd. An example follows: s390x Enumerated Boot Menu. 3 entries detected. Select from index 0 to 2. Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> [thuth: Added additional "break;" statement to avoid analyzer warnings] Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-26s390-ccw: read stage2 boot loader data to find menuCollin L. Walling1-5/+89
Read the stage2 boot loader data block-by-block. We scan the current block for the string "zIPL" to detect the start of the boot menu banner. We then load the adjacent blocks (previous block and next block) to account for the possibility of menu data spanning multiple blocks. Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-26s390-ccw: update libcCollin L. Walling1-2/+2
Moved: memcmp from bootmap.h to libc.h (renamed from _memcmp) strlen from sclp.c to libc.h (renamed from _strlen) Added C standard functions: isdigit Added non C-standard function: uitoa atoui Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-26s390-ccw: refactor IPL structsCollin L. Walling1-6/+6
ECKD DASDs have different IPL structures for CDL and LDL formats. The current Ipl1 and Ipl2 structs follow the CDL format, so we prepend "EckdCdl" to them. Boot info for LDL has been moved to a new struct: EckdLdlIpl1. Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Acked-by: Janosch Frank <frankja@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-26s390-ccw: refactor eckd_block_num to use CHSCollin L. Walling1-14/+14
Add new cylinder/head/sector struct. Use it to calculate eckd block numbers instead of a BootMapPointer (which used eckd chs anyway). Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-26s390-ccw: refactor boot map table codeCollin L. Walling1-33/+27
Some ECKD bootmap code was using structs designed for SCSI. Even though this works, it confuses readability. Add a new BootMapTable struct to assist with readability in bootmap entry code. Also: - replace ScsiMbr in ECKD code with appropriate structs - fix read_block messages to reflect BootMapTable - fixup ipl_scsi to use BootMapTable (referred to as Program Table) - defined value for maximum table entries Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2017-07-14pc-bios/s390-ccw: Move byteswap functions to a separate headerThomas Huth1-0/+1
We'll need them in code that is not related to bootmap.h, so they should reside in an independent header. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-6-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Move libc functions to separate headerThomas Huth1-0/+1
The upcoming netboot code will use the libc from SLOF. To be able to still use s390-ccw.h there, the libc related functions in this header have to be moved to a different location. And while we're at it, remove the duplicate memcpy() function from sclp.c. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-2-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-05-02pc-bios/s390-ccw: add boot entry selection to El Torito routineEugene (jno) Dvurechenski1-1/+6
If there is no LOADPARM given or '0' specified, then IPL the first matched entry. Otherwise IPL the matching entry of that number. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-02pc-bios/s390-ccw: add boot entry selection for ECKD DASDFarhan Ali1-5/+11
1. change a bit definition of ScsiMbr to allow an array of pointers 2. add loadparm fetch to boot script processing 3. apply loadparm index to boot entry selection, if any Initial patch from Eugene (jno) Dvurechenski. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-02pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI diskFarhan Ali1-5/+6
Fix SCSI bootmap interpreter to make use of any specified entry of the Program Table using the leftmost numeric value from the LOADPARM, if specified. Initial patch from Eugene (jno) Dvurechenski. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-02-28pc-bios/s390-ccw: Use the ccw bios to start the network bootFarhan Ali1-1/+7
We want to use the ccw bios to start final network boot. To do this we use ccw bios to detect if the boot device is a virtio network device and retrieve the start address of the network boot image. Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-03-23pc-bios/s390-ccw: disambiguation of "No zIPL magic" messageEugene (jno) Dvurechenski1-3/+3
Don't indicate the same error message for different conditions. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-03-23pc-bios/s390-ccw: enhance bootmap detectionEugene (jno) Dvurechenski1-35/+76
Improve the algorithm that tries to guess the disk layout: 1. Use CD-ROMs to read ISO only 2. Make explicit paths for -scsi and -blk virtio Acked-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-03-23pc-bios/s390-ccw: virtio_panic -> panicEugene (jno) Dvurechenski1-4/+4
This function has nothing to do with virtio. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-03-23pc-bios/s390-ccw: add more disk layout checksEugene (jno) Dvurechenski1-0/+4
Experiments showed possibility of few more "misconfigurations" in disk layout. They are reported now. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-03-10pc-bios/s390-ccw: fix old bug in ptr incrementEugene (jno) Dvurechenski1-1/+1
We need to increment by the size of the structure, whereas 'ns' is 'uint8_t *'. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: El Torito 16-bit boot image size field workaroundMaxim Samoylov1-0/+90
Because of El Torito spec flaw boot image size needs to be verified. Boot catalog entry size field has 16-bit width, and specifies size in 512-byte units. Thus, boot image size cannot exceed 32M. We actually search for the file to get the file size. This is done by scanning the ISO directory tree for the ISO block number and reading the file size from the directory entry. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: El Torito s390x boot entry checkMaxim Samoylov1-1/+10
Boot entry is considered compatible if boot image is Linux kernel with matching S390 Linux magic string. Empty boot images with sector_count == 0 are considered broken. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: ISO-9660 El Torito boot implementationMaxim Samoylov1-0/+107
This patch enables boot from media formatted according to ISO-9660 and El Torito bootable CD specification. We try to boot from device as ISO-9660 media when SCSI IPL failed. The first boot catalog entry with bootable flag is used. ISO-9660 media with default 2048-bytes sector size only is supported. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-02-03pc-bios/s390-ccw: fix sparse warningsChristian Borntraeger1-2/+2
Fix some sparse warnings in the s390-ccw bios. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-09-01pc-bios/s390-ccw: Do proper console setupChristian Borntraeger1-5/+5
The final newline/return must happen before we reset the sclp via diag 308. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2014-09-01pc-bios/s390-ccw: IPL from DASD with format variationsEugene (jno) Dvurechenski1-23/+29
There are two known cases of DASD format where signatures are incomplete or absent: 1. result of <dasdfmt -d ldl -L ...> (ECKD_LDL_UNLABELED) 2. CDL with zero keys in IPL1 and IPL2 records Now the code attempts to 1. find zIPL and use SCSI layout 2. find IPL1 and use CDL layout 3. find CMS1 and use LDL layout 3. find LNX1 and use LDL layout 4. find zIPL and use unlabeled LDL layout 5. find zIPL and use CDL layout 6. die in this sequence. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2014-09-01pc-bios/s390-ccw Really big EAV ECKD DASD handlingEugene (jno) Dvurechenski1-16/+15
For EAV ECKD DASD, the cylinder count will have the magic value 0xfffeU. Therefore, use the block number to test for valid eckd addresses instead. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2014-09-01pc-bios/s390-ccw Improve ECKD informational messageEugene (jno) Dvurechenski1-2/+20
Add block size display to ECKD scheme report. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2014-07-08pc-bios/s390-ccw: store proper subsystem information wordChristian Borntraeger1-0/+2
POP chapter 17 requires to store a subsystem information word at 184 during IPL. Furthermore bytes 188-191 should be zero. The bootmap might contain data blocks that are written to the first page. We have to write these values after we processed the bootmap and before the final IPL. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: IPL from LDL/CMS-formatted ECKD DASDEugene (jno) Dvurechenski1-7/+85
Add code that allows us to start from two further ECKD DASD disk layouts: LDL (Linux disk layout) and CMS (cms-formatted disk). Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: IPL from CDL-formatted ECKD DASDEugene (jno) Dvurechenski1-0/+168
Add code that allows us to start from ECKD DASD using the z/OS compatible disk layout (CDL), which is the most common format for ECKD DASD. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: factor out ipl codeEugene (jno) Dvurechenski1-38/+45
Move the scsi-disk specific ipl code from zipl_load() into a new function ipl_scsi(). This makes it easier to add ipl routines for other disk types. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: Unify error handlingEugene (jno) Dvurechenski1-61/+21
Convert to IPL_assert and friends Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: add some utility codeEugene (jno) Dvurechenski1-14/+1
IPL_assert(term,message) is introduced to handle error conditions. ebcdic_to_ascii() to convert chars (mostly to print VOLSERs). read_block() provision for unified block-number handling. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: handle different sector sizesEugene (jno) Dvurechenski1-5/+7
Use the virtio device's configuration to figure out the disk geometry and use a sector size based upon the layout. [CH: s/SECTOR_SIZE/MAX_SECTOR_SIZE/g] Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: cleanup and enhance bootmap defintionsEugene (jno) Dvurechenski1-51/+15
Add declarations to describe structure of different dasd IPL sources (eckd and fba). Move the structure definitions to a new header bootmap.h. While we are at it, change structs to typedefs. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-27pc-bios/s390-ccw: make checkpatch happyEugene (jno) Dvurechenski1-17/+20
Remove tabs, tweak whitespace and comments. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-23pc-bios/s390-ccw: fix for fragmented SCSI bootmapEugene (jno) Dvurechenski1-0/+27
We need to interpret the last entry of the bootmap with zero block count as "continuation pointer". The "last entry" is being detected by pre-filling of the scratch space with known values and respective look-ahead. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-23pc-bios/s390-ccw: do a subsystem reset before running the guestChristian Borntraeger1-8/+47
The loader BIOS has already activated several devices. Let's do a subsystem reset before jumping into the guest. As there is no direct way of doing so, we use diagnose 308 to bring the system in a defined state. This is similar to what kdump on s390 uses. We have to define a small trampoline function that restores the low bytes to whatever the bootmap has written there. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>