summaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw
AgeCommit message (Collapse)AuthorFilesLines
2016-05-17pc-bios/s390-ccw: Get device address via diag 308/6Alexander Yarygin4-13/+95
To IPL from a device, pc-bios receives from qemu a device address via general register 7. The better way to do it is to use diag308/6 instruction which returns so called "IplParameterBlock". IplParameterBlock contains the device address for IPL and additional parameters that can be used by pc-bios. This patch allows pc-bios to get device address via diag308/6 and doesn't use gr7 passed boot information anymore. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.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: enable virtio-scsiEugene (jno) Dvurechenski4-39/+116
Make the code added before to work. 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 virtio-scsi implementationEugene (jno) Dvurechenski2-0/+414
Add virtio-scsi.[ch] with primary implementation of virtio-scsi. 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 scsi definitionsEugene (jno) Dvurechenski1-0/+184
Add scsi.h to provide basic definitions for SCSI. 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 simplified virtio callEugene (jno) Dvurechenski2-0/+26
Add virtio_run(VirtioCmd) call to use simple declarative approach. 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: make provisions for different backendsEugene (jno) Dvurechenski4-44/+106
Add dispatching code to make room for non virtio-blk boot devices. 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 vdev object to store all device detailsEugene (jno) Dvurechenski2-83/+116
Add VDev "object" as a container for all device-related items. The default object is static. Leverage dependency on many different device-related globals. Make them syntactically visible. 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: update virtio implementation to allow up to 3 vringsEugene (jno) Dvurechenski4-56/+90
Add ability to work with up to 3 vrings, which is required for virtio-scsi implementation. Implement the optional cookie to speed up processing of virtio notifications. Reviewed-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>
2016-03-23pc-bios/s390-ccw: qemuize typesEugene (jno) Dvurechenski4-95/+116
Turn [the most of] existing declarations from struct type_name { ... }; into struct TypeName { ... }; typedef struct TypeName TypeName; and make use of them. Also switch u{8,16,32,64} to uint{8,16,32,64}_t. 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>
2016-03-23pc-bios/s390-ccw: add utility functions and "export" some othersEugene (jno) Dvurechenski3-19/+40
Add several utility functions, make IPL_check and IPL_assert generally available, etc. 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>
2016-03-23pc-bios/s390-ccw: virtio_panic -> panicEugene (jno) Dvurechenski5-14/+14
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) Dvurechenski2-0/+13
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-12-01pc-bios/s390-ccw: build for z900Christian Borntraeger1-1/+1
Newer distributions have an architecture level set to z9, z196 or similar - also as default option for the compiler. We should build the bios for z900 to allow it to run with all 64bit CPUs. This will become more important as soon as QEMU/KVM does support CPU models. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-By: Sascha Silbe <silbe@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 Samoylov2-0/+97
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 Samoylov2-1/+18
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 Samoylov4-0/+306
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-11-11pc-bios/s390-ccw: Always adjust virtio sector countMaxim Samoylov1-6/+1
Let's always adjust the sector number to be read using the current virtio block size value. This prepares for the implementation of IPL from ISO-9660 media. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-10-02pc-bios/s390-ccw: avoid floating point operationsChristian Borntraeger1-1/+2
Some gcc versions (e.g. Fedora 22 gcc 5.1.1) seem to use floating point registers for spilling and filling of general purpose registers. As the BIOS does not activate the AFP register setting of CR0 this can cause data exception program checks. Disallow floating point in the BIOS as a simple solution. Signed-off-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> Message-Id: <1443689387-34473-2-git-send-email-jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2015-09-07pc-bios/s390-ccw: Device detection in higher subchannel setsAlexander Yarygin1-25/+41
If no bootdevice was specified, we try to autodetect a suitable IPL device. Current code only searched in subchannel set 0; extend this search to higher subchannel sets as well. Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-06-30s390-ccw.img: Consume service interruptsChristian Borntraeger3-0/+34
We have to consume the outstanding service interrupt after each service call, otherwise a correct implementation will return CC=2 on subsequent service calls. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-06-15s390/bios: build with -fdelete-null-pointer-checksAurelien Jarno1-1/+1
Starting with version 4.9, GCC assumes it can't safely dereference null pointers, and uses this for some optimizations. On s390, the lowcore memory is located at address 0, so this assumption is wrong and breaks the s390-ccw firmware. Pass -fdelete-null-pointer-checks to avoid that. Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Message-Id: <1434363843-14576-1-git-send-email-aurelien@aurel32.net> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2015-03-11s390/bios: Make the s390-ccw.img relocatableThomas Huth1-5/+6
The current bios sits at location 0x7e00000 in the guest RAM and thus prevents loading of bigger ramdisks. By making the image relocatable we can move it to the end of the RAM so that it is getting out of the way. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Message-Id: <1425895973-15239-3-git-send-email-thuth@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> [Fixup build failure on 32 bit hosts]
2015-03-10s390-ccw.img: Reinitialize guessing on rebootChristian Borntraeger1-0/+1
guessed_disk_nature is a static zero variable. As the QEMU ELF loader does not zero the BSS section, lets do it explicitely here. This fixes reboot for some corner cases (like FCP flash devices with logical_block_size=512, physical_block_size=4096) Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Tested-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-Id: <1425310029-53396-3-git-send-email-borntraeger@de.ibm.com>
2015-03-10s390-ccw.img: Allow bigger ramdisk sizes or offsetsChristian Borntraeger3-2/+4
The s390-ccw bios creates the the virtqueue at 100MB. For big ramdisks or offsets (via zipl) this gets overwritten. As a quick band-aid, lets move the virtqueue into the bss section, which is at 0x7f00000. As the bios code (text) is at 0x7e00000 we can now handle ramdisk which are ~27MB bigger. Long term we want to make the s390-ccw bios position independent and load of at the end of memory. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-Id: <1425310029-53396-2-git-send-email-borntraeger@de.ibm.com>
2015-02-03pc-bios/s390-ccw: fix sparse warningsChristian Borntraeger5-5/+7
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) Dvurechenski2-24/+30
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) Dvurechenski3-22/+22
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-09-01pc-bios/s390-ccw: handle more ECKD DASD block sizesEugene (jno) Dvurechenski1-3/+24
Using dasdfmt(8) to format a DASD allows to choose a block size. There are four supported values: 512, 1024, 2048, and 4096 bytes per block. Each block size leads to selection of new count of sectors per track. The head count remains always the same: 15. This empiric knowledge is used to detect ECKD DASD to IPL from. 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> 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: support all virtio block sizeEugene (jno) Dvurechenski1-6/+8
The block size value may be given "as is" OR as a base value and a shift count (exponent). So, we have to use calculation to get the proper number in the code. The main expression reads as (blk_cfg.blk_size << blk_cfg.physical_block_exp) E.g., various combinations between blk_size=1/physical_block_exp=12 and blk_size=4096/physical_block_exp=0 are valid for 4K blocks. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.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-07-08pc-bios/s390-ccw: store proper subsystem information wordChristian Borntraeger3-1/+19
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) Dvurechenski2-7/+92
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: Add fill_hex_val func to provide better msgsEugene (jno) Dvurechenski1-5/+11
Factor out helper function for dumping a hex value into a buffer. 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) Dvurechenski3-66/+31
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) Dvurechenski2-14/+84
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) Dvurechenski4-11/+147
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) Dvurechenski2-51/+269
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) Dvurechenski5-43/+46
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>
2014-06-23pc-bios/s390-ccw: virtio_load_direct() can't load max number of sectorsDavid Hildenbrand1-1/+1
The number of sectors to read is given by the last 16 bit of rec_list2. 1 is added in order to get to the real number of sectors to read (0x0000 -> read 1 block). For now, the maximum number (0xffff) led to 0 sectors being read. This fixes a bug where a large initrd (62MB) could not be ipled anymore. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@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-02-27s390-ccw.img: Fix sporadic errors with ccw boot image - initialize cssChristian Borntraeger1-2/+1
We have to set the cssid to 0, otherwise the stsch code will return an operand exception without the m bit. In the same way we should set m=0. This case was triggered in some cases during reboot, if for some reason the location of blk_schid.cssid contains 1 and m was 0. Turns out that the qemu elf loader does not zero out the bss section on reboot. The symptom was an dump of the old kernel with several areas overwritten. The bootloader does not register a program check handler, so bios exception jumped back into the old kernel. Lets just use a local struct with a designed initializer. That will guarantee that all other subelements are initialized to 0. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-02-27s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idxChristian Borntraeger1-0/+1
The current code does not initialize next_idx in the virtio ring. As the ccw bios will always use guest memory at a fixed location, this queue might != 0 after a reboot. Lets make the initialization explicit. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2013-09-20s390/ipl: Fix waiting for virtio processingCornelia Huck2-3/+5
The guest side must not manipulate the index for the used buffers. Instead, remember the state of the used buffer locally and wait until it has moved. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>