summaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw
AgeCommit message (Collapse)AuthorFilesLines
2017-10-30s390-ccw: print carriage return with new linesCollin L. Walling1-3/+21
The sclp console in the s390 bios writes raw data, leading console emulators (such as virsh console) to treat a new line ('\n') as just a new line instead of as a Unix line feed. Because of this, output appears in a "stair case" pattern. Let's print \r\n on every occurrence of a new line in the string passed to write to amend this issue. This is in sync with the guest Linux code in drivers/s390/char/sclp_vt220.c which also does a line feed conversion in the console part of the driver. This fixes the s390-ccw and s390-netboot output like $ virsh start test --console Domain test started Connected to domain test Escape character is ^] Network boot starting... Using MAC address: 02:01:02:03:04:05 Requesting information via DHCP: 010 Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Message-Id: <1509120893-28054-1-git-send-email-walling@linux.vnet.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-09-19s390: set DHCP client architecure id for netbootViktor Mihajlovski1-1/+1
Setting the client architecture DHCP option to 0x001f (s390 Basic) [1] allows the DHCP server to return a s390-specific bootfile if wanted. DHCP servers not configured for the option (or not yet recognizing the option value) will continue to work as they have done before. [1] https://www.iana.org/assignments/dhcpv6-parameters Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Message-Id: <1505126027-1704-1-git-send-email-mihajlov@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-08-30s390-ccw: Fix alignment for CCW1Farhan Ali1-1/+1
The commit 198c0d1f9df8c4 s390x/css: check ccw address validity exposes an alignment issue in ccw bios. According to PoP the CCW must be doubleword aligned. Let's fix this in the bios. Cc: qemu-stable@nongnu.org Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <3ed8b810b6592daee6a775037ce21f850e40647d.1503667215.git.alifm@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-08-15pc-bios/s390-ccw: Use rm command during make cleanEric Farman1-1/+1
This reverts a change that replaced the "rm -f" command with the undefined variable RM (expected to be set by make), and causes the "make clean" command to fail for a s390 target: make[1]: Entering directory '/usr/src/qemu/build/pc-bios/s390-ccw' rm -f *.timestamp *.o *.d *.img *.elf *~ *.a /bin/sh: *.o: command not found Makefile:39: recipe for target 'clean' failed make[1]: *** [clean] Error 127 make[1]: Leaving directory '/usr/src/qemu/build/pc-bios/s390-ccw' Makefile:489: recipe for target 'clean' failed make: *** [clean] Error 1 Fixes: 3e4415a751d2 ("pc-bios/s390-ccw: Add core files for the network bootloading program") Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170814204450.24118-2-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-07-14pc-bios/s390-ccw: Link libnet into the netboot image and do the TFTP loadThomas Huth2-1/+238
Most of the code has been taken from SLOF's netload.c file. Now we can finally load an image via TFTP and execute the downloaded kernel. Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-12-git-send-email-thuth@redhat.com> Tested-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Add virtio-net driver codeThomas Huth4-3/+151
The driver provides the recv() and send() functions which will be required by SLOF's libnet code for receiving and sending packets. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-11-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Add core files for the network bootloading programThomas Huth3-2/+192
This is just a preparation for the next steps: Add a makefile and a stripped down copy of pc-bios/s390-ccw/main.c as a basis for the network bootloader program, linked against the libc from SLOF already (which we will need for SLOF's libnet). The networking code is not included yet. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-10-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Add code for virtio feature negotiationThomas Huth3-6/+20
The upcoming virtio-net driver needs to negotiate some features, so we need the possibility to do this in the core virtio code. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-8-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Remove unused structs from virtio.hThomas Huth1-27/+0
Looks like they have never been used, so let's simply remove them. Acked-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-7-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Move byteswap functions to a separate headerThomas Huth3-26/+31
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: Add a write() function for stdioThomas Huth1-2/+14
The stdio functions from the SLOF libc need a write() function for printing text to stdout/stderr. Let's implement this function by refactoring the code from sclp_print(). Acked-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-5-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Move virtio-block related functions into a separate fileThomas Huth6-274/+311
The netboot code is going to link against the code from virtio.c, too, so we've got to move the virtio-block and -scsi related code out of the way. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-4-git-send-email-thuth@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-07-14pc-bios/s390-ccw: Move ebc2asc to sclp.cThomas Huth2-11/+11
We will later need this array in a file that we will link to the netboot code, too. Since there is some ebcdic conversion done in sclp_get_loadparm_ascii(), the sclp.c file seems to be a good candidate. Acked-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1499863793-18627-3-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 Huth7-37/+51
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-06-06pc-bios/s390-ccw: use STRIP variable in MakefileGreg Kurz1-1/+3
The docker-run-test-build@debian-s390x-cross target fails with: strip --strip-unneeded s390-ccw.elf -o s390-ccw.img strip: Unable to recognise the format of the input file `s390-ccw.elf' The configure script defines a STRIP makefile variable whose default value is ${cross_prefix}strip. Let's use it. We default to using the non-prefixed strip command in case --enable-debug or --disable-strip was passed to configure during a regular build. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <149623617700.4947.12490877660892961664.stgit@bahia.lan> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Build a reasonable max_sectors limitEric Farman2-0/+11
Now that we've read all the possible limits that have been defined for a virtio-scsi controller and the disk we're booting from, it's possible that we are STILL going to exceed the limits of the host device. For example, a "-device scsi-generic" device does not support the Block Limits VPD page. So, let's fallback to something that seems to work for most boot configurations if larger values were specified (including if nothing was explicitly specified, and we took default values). Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-8-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Get Block Limits VPD device dataEric Farman3-1/+35
The "Block Limits" Inquiry VPD page is optional for any SCSI device, but if it's supported it provides a hint of the maximum I/O transfer length for this particular device. If this page is supported by the disk, let's issue that Inquiry and use the minimum of it and the SCSI controller limit. That will cover this scenario: qemu-system-s390x ... -device virtio-scsi-ccw,id=scsi0,max_sectors=32768 ... -drive file=/dev/sda,if=none,id=drive0,format=raw ... -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0, drive=drive0,id=disk0,max_io_size=1048576 controller: 32768 sectors x 512 bytes/sector = 16777216 bytes disk: 1048576 bytes Now that we have a limit for a virtio-scsi disk, compare that with the limit for the virtio-scsi controller when we actually build the I/O. The minimum of these two limits should be the one we use. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-7-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Get list of supported VPD pagesEric Farman2-0/+27
The "Supported Pages" Inquiry EVPD page is mandatory for all SCSI devices, and is used as a gateway for what VPD pages the device actually supports. Let's issue this Inquiry, and dump that list with the debug facility. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-6-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Refactor scsi_inquiry functionEric Farman2-2/+14
If we want to issue any of the SCSI Inquiry EVPD pages, which we do, we could use this function to issue both types of commands with a little bit of refactoring. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-5-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Break up virtio-scsi read into multiplesEric Farman2-5/+22
A virtio-scsi request that goes through the host sd driver and exceeds the maximum transfer size is automatically broken up for us. But the equivalent request going to the sg driver presumes that any length requirements have already been honored. Let's use the max_sectors field on the virtio-scsi controller device, and break up all requests (both sd and sg) to avoid this problem. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-4-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Move SCSI block factor to outer readEric Farman1-6/+8
Simple refactoring so that the blk_factor adjustment is moved into virtio_scsi_read_many routine, in preparation for another change. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Message-Id: <20170510155359.32727-3-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-19pc-bios/s390-ccw: Remove duplicate blk_factor adjustmentEric Farman1-1/+1
When using virtio-scsi, we multiply the READ(10) data_size by a block factor twice when building the I/O. This is fine, since it's only 1 for SCSI disks, but let's clean it up. Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <20170510155359.32727-2-farman@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@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 Ali2-6/+12
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-05-02pc-bios/s390-ccw: provide a function to interpret LOADPARM valueFarhan Ali2-1/+27
The LOADPARM value is fetched from SCP Read Info, but it's applied only at the phase of bootmap interpretation. So let's read the LOARPARM value and store it. Also provide a parsing function to detect numbers in the LOADPARM which can be used during bootmap interpretation. Remove a stray whitespace. 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> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-02pc-bios/s390-ccw: get LOADPARM stored in SCP Read InfoFarhan Ali4-2/+17
Obtain the loadparm value stored in SCP Read Info by performing a SCLP Read Info request. Rename sclp-ascii.c to sclp.c to reflect the changed scope of the file. 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: Make ebcdic/ascii conversion publicEugene (jno) Dvurechenski3-22/+24
Make the ebcdic_to_ascii function public to the rest of the "bios" code, as the volume label is no more the single thing to be converted. 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 Ali5-8/+25
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-10-06rules.mak: quiet-command: Split command name and args to printPeter Maydell1-2/+2
The quiet-command make rule currently takes two arguments: the command and arguments to run, and a string to print if the V flag is not set (ie we are not being verbose). By convention, the string printed is of the form " NAME some args". Unfortunately to get nicely lined up output all the strings have to agree about what column the arguments should start in, which means that if we add a new quiet-command usage which wants a slightly longer CMD name then we either put up with misalignment or change every quiet-command string. Split the quiet-mode string into two, the "NAME" and the "same args" part, and use printf(1) to format the string automatically. This means we only need to change one place if we want to support a longer maximum name. In particular, we can now print 7-character names lined up properly (they are needed for the OSX "SETTOOL" invocation). Change all the uses of quiet-command to the new syntax. (Any which are missed or inadvertently reintroduced via later merges will result in slightly misformatted quiet output rather than disaster.) A few places in the pc-bios/ makefiles are updated to use "BUILD", "SIGN" and "STRIP" rather than "Building", "Signing" and "Stripping" for consistency and to keep them below 7 characters. Module .mo links now print "LD" rather than the nonstandard "LD -r". Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1475598441-27908-1-git-send-email-peter.maydell@linaro.org
2016-09-28pc-bios/s390-ccw: enable subchannel for IPL I/O devicesDong Jia Shi1-1/+2
IPL should cause the IPL I/O device to become enabled. So when handling the IPL program, we should set the E (Enable) bit. However, virtio-ccw does not know whether it's dealing with an IPL device or not. Since trying to perform I/O on a disabled device doesn't make any sense, let's just always enable it. At the same time we can remove the SCSW_FCTL_START_FUNC flag as it is ignored for msch anyway and did not enable the device as intended. Reported-by: Farhan Ali <alifm@linux.vnet.ibm.com> Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> [remove superfluous flag] Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2016-08-16pc-bios/s390-ccw.img: Fix buildChristian Borntraeger1-2/+4
Since commit a9c87304b76d ("build-sys: fix building with make CFLAGS=.. argument") pc-bios/s390-ccw.img build might fail with --- snip --- main.o: In function `virtio_setup': qemu/pc-bios/s390-ccw/main.c:117: undefined reference to `__stack_chk_fail' --- snip --- Changing the CFLAGS to QEMU_CFLAGS does the trick. We also need to add -fno-strict-aliasing as this was filtered out. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <1471258997-5811-1-git-send-email-borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-07-11pc-bios/s390-ccw: Pass selected SCSI device to IPLEugene (jno) Dvurechenski4-0/+37
There is ,bootindex=%d argument to specify the lookup order of boot devices. If a bootindex assigned to the device, then IPL Parameter Info Block is created for that device when it is IPLed from. If it is a mere SCSI device (not FCP), then IPIB is created with a special SCSI type and its fields are used to store SCSI address of the device. This new ipl block is private to qemu for now. If the device to IPL from is specified this way, then SCSI bus lookup is bypassed and prescribed devices uses the address specified. Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
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>