summaryrefslogtreecommitdiffstats
path: root/pc-bios/s390-ccw/virtio.c
Commit message (Collapse)AuthorAgeFilesLines
* s390-ccw.img: Reinitialize guessing on rebootChristian Borntraeger2015-03-101-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>
* s390-ccw.img: Allow bigger ramdisk sizes or offsetsChristian Borntraeger2015-03-101-2/+2
| | | | | | | | | | | | | | | | | 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>
* pc-bios/s390-ccw: fix sparse warningsChristian Borntraeger2015-02-031-1/+1
| | | | | | | 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>
* pc-bios/s390-ccw Really big EAV ECKD DASD handlingEugene (jno) Dvurechenski2014-09-011-5/+6
| | | | | | | | | | | | | 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>
* pc-bios/s390-ccw: handle more ECKD DASD block sizesEugene (jno) Dvurechenski2014-09-011-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>
* pc-bios/s390-ccw: support all virtio block sizeEugene (jno) Dvurechenski2014-09-011-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>
* pc-bios/s390-ccw: handle different sector sizesEugene (jno) Dvurechenski2014-06-271-5/+91
| | | | | | | | | | | 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>
* pc-bios/s390-ccw: make checkpatch happyEugene (jno) Dvurechenski2014-06-271-13/+13
| | | | | | | | | 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>
* pc-bios/s390-ccw: virtio_load_direct() can't load max number of sectorsDavid Hildenbrand2014-06-231-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>
* s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idxChristian Borntraeger2014-02-271-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>
* s390/ipl: Fix waiting for virtio processingCornelia Huck2013-09-201-3/+4
| | | | | | | | | 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>
* s390/IPL: Allow boot from other ssid than 0Dominik Dingel2013-07-291-0/+18
| | | | | | | | | | We now take the subchannel set id also into account to find the boot device. If we want to use a subchannel set other than the default set 0, we first need to enable the mss facility. Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* s390/ipl: Fix spurious errors in virtioChristian Borntraeger2013-05-311-0/+5
| | | | | | | | | | | | | | | | With the ccw ipl code sometimes an error message like "virtio: trying to map MMIO memory" or "Guest moved used index from %u to %u" appeared. Turns out that the ccw bios did not zero out the vring, which might cause stale values in avail->idx and friends, especially on reboot. Lets zero out the relevant fields. To activate the patch we need to rebuild s390-ccw.img as well. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1369309901-418-1-git-send-email-borntraeger@de.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* s390-ccw.img: Get queue config from host.Cornelia Huck2013-04-261-3/+7
| | | | | | | Ask the host about the configuration instead of guessing it. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* s390-ccw.img: Rudimentary error checking.Cornelia Huck2013-04-261-6/+15
| | | | | | | Try to handle at least some of the errors that may happen. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* s390-ccw.img: Enhance drain_irqs().Cornelia Huck2013-04-261-2/+11
| | | | | | | | - Use tpi + tsch to get interrupts. - Return an error if the irb indicates problems. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* s390-ccw.img: Fix compile warning in s390 ccw virtio codeChristian Borntraeger2013-04-261-1/+3
| | | | | | | | | | | Lets fix this gcc warning: virtio.c: In function ‘vring_send_buf’: virtio.c:125:35: error: operation on ‘vr->next_idx’ may be undefined [-Werror=sequence-point] Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* S390: ccw firmware: Add virtio device driversAlexander Graf2013-04-261-0/+274
In order to boot, we need to be able to access a virtio-blk device through the CCW bus. Implement support for this. Signed-off-by: Alexander Graf <agraf@suse.de>
OpenPOWER on IntegriCloud