aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/pvscsi.c
Commit message (Collapse)AuthorAgeFilesLines
* geometry: Apply LCHS values for boot devicesSam Eiderman2019-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type: "TRANSLATION_HOST". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com> Message-Id: <20190626123816.8907-6-shmuel.eiderman@oracle.com>
* Revert "geometry: Apply LCHS values for boot devices"Gerd Hoffmann2019-11-181-1/+0
| | | | This reverts commit 9caa19be0e534c687081fbdfcd301406e728c98c.
* geometry: Apply LCHS values for boot devicesSam Eiderman2019-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Boot devices which use overriden LCHS values are: * ata * ahci * scsi * esp * lsi * megasas * mpt * pvscsi * virtio * virtio-blk We use these values in get_translation() and setup_translation() by introducing a new translation type: "TRANSLATION_MACHINE". We treat this translation as TRANSLATION_NONE in fill_ata_edd(), although this does not really matter since now the translation between physical and logical geometry does not exist. Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com> Message-Id: <20190612093704.47175-6-shmuel.eiderman@oracle.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* pvscsi: ring_desc do not have to be page alignedLiran Alon2018-11-271-1/+1
| | | | | | | | | | In contrast to other allocations made by pvscsi_init_rings(), ring_desc is only used internally by SeaBIOS (not passed to device-controller) and there is not restriction which force it to be page aligned. Reviewed-by: Mark Kanda <mark.kanda@oracle.com> Signed-off-by: Liran Alon <liran.alon@oracle.com>
* pvscsi: Scan all 64 possible targetsShmuel Eiderman2018-11-101-1/+1
| | | | | | | | | | | | | The max number of targets per PVSCSI controller is 64, not 7. This can easily be seen in QEMU PVSCSI emulation code (hw/scsi/vmw_pvscsi.c) as PVSCSI_MAX_DEVS, which defines the number of targets, have value of 64. Fixes: 83d60b3c474b ("Add pvscsi boot support") Reviewed-by: Liran Alon <liran.alon@oracle.com> Reviewed-by: Mark Kanda <mark.kanda@oracle.com> Signed-off-by: Shmuel Eiderman <shmuel.eiderman@oracle.com>
* block: Rename disk_op_s->drive_gf to drive_flKevin O'Connor2017-09-271-1/+1
| | | | | | | | | | Now that the drive_s struct does not need to be in the f-segment, rename references to drive_gf in the generic drive code to drive_fl. This is just variable renames - no code changes. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: fix the comment about lun enumerationRoman Kagan2017-05-021-1/+1
| | | | | | | | | | | | | The comment in pvscsi_scan_target (presumably c&p-ed from another driver) reads that REPORTS LUNS should better be used to enumerate the luns on the target. However, according to the Linux driver, the device supports no more than a single lun per target. So adjust the comment to tell exactly that. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* pvscsi: Use high memory for ringsDana Rubin2016-08-051-4/+4
| | | | | | | | | | Avoid using the scarce ZoneLow memory. This limits max number of pvscsi controllers. As driver runs in 32bit mode, use ZoneHigh allocation instead. Signed-off-by: Dana Rubin <dana.rubin@ravellosystems.com> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
* pvscsi: Fix incorrect arguments order in call to memalign_lowDana Rubin2016-08-051-1/+1
| | | | | | | First argument should be 'align' and second 'size'. Signed-off-by: <dana.rubin@ravellosystems.com> Signed-off-by: <shmulik.ladkani@ravellosystems.com>
* scsi: Launch a thread when scanning for drives in the scsi driversKevin O'Connor2016-04-061-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scsi: Always use MAXDESCSIZE when building drive descriptionKevin O'Connor2016-02-031-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pci: Split low-level pci code from higher-level 'struct pci_device' codeKevin O'Connor2016-02-031-1/+1
| | | | | | | | | Split pci.c into pci.c and pcidevice.c. The low-level code that interacts directly with the PCI devices remains in pci.c, while functions dealing with the higher level pci_device cache move to pcidevice.c. Only pci.c is needed in 16bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pci: Implement '%pP' printf handler for 'struct pci_device' pointersKevin O'Connor2016-02-031-6/+2
| | | | | | | Handle '%pP' format descriptions as a pointer to a 'struct pci_device' and display it in bus:device.function (%02x:%02x.%x) format. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Convert to new PCI BAR helper functionsKevin O'Connor2016-02-021-9/+8
| | | | | | | | | Use the pci_enable_x() functions. The pvscsi controller code will now explicitly set PCI_COMMAND_MEMORY instead of assuming it has already been enabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtio: Move standard definitions from virtio-ring.h to standard headersKevin O'Connor2015-10-151-1/+1
| | | | | | | Move PAGE_SHIFT / virt_to_phys() to memmap.h and smp_[rw]mb() to x86.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* blockcmd: Convert cdb_is_read() to scsi_is_read()Kevin O'Connor2015-07-141-1/+1
| | | | | | | Convert the cdb_is_read() function to a new function scsi_is_read() which takes a 'struct disk_op_s' as a paramter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Handle pvscsi drives directly via 'struct disk_op_s' requestsKevin O'Connor2015-07-141-19/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Move pvscsi_fill_req() code into pvscsi_cmd()Kevin O'Connor2015-07-141-24/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.Kevin O'Connor2013-12-271-41/+33
| | | | | | | | | Now that pvscsi runs entirely in 32bit mode, there is no need to use the memory segment access macros. This also fixes up an incorrect memcpy and memset call. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Always run entirely in 32bit mode.Kevin O'Connor2013-12-271-15/+15
| | | | | | | Instead of jumping into 32bit mode to access the PCI config space, run the entire driver in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pvscsi: Don't store reference to struct pci_device.Kevin O'Connor2013-12-271-2/+0
| | | | | | | The pci_device reference isn't used by pvscsi, and it's confusing to keep a long held reference to a short lived object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.Kevin O'Connor2013-10-261-9/+10
| | | | | | | | | | | | The "drive" structure is always malloc'ed and therefore always starts off described as a 32-bit "flat" pointer. Instead of switching to/from 16bit pointers, make all the code use the 32bit pointer. This eliminates the confusing 16/32 bit pointer switches. This patch also removes the "_g" suffixes on local variables in functions that are always called in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add pvscsi boot supportEvgeny Budilovsky2013-10-261-0/+363
Testing was done on windows images (win 2008/2012) taken from esx with vmware tools installed and boot disk configured to use pvscsi. Also I've used linux (ubuntu 12.04) where pvscsi drivers are installed by default and booted it using qemu cmd similar to this: ./x86_64-softmmu/qemu-system-x86_64 -snapshot -device pvscsi,id=pvscsi0 \ -device scsi-disk,bus=pvscsi0.0,drive=drive0 \ -drive id=drive0,if=none,file=ubuntu-12.04.qcow2 \ -bios roms/seabios/out/bios.bin Signed-off-by: Evgeny Budilovsky <evgeny.budilovsky@ravellosystems.com>