History | View | Annotate | Download (61.3 kB)
pci: interrupt pin documentation update
Fix up some erroneous comments in code:interrupt pins are named A-D, theinterrupt pin register is always readonlyand isn't zeroed out on reset.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw: Trim superfluous #include "block_int.h"
Including it in device models is unclean, including it without areason adds insult to injury.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
lsi53c895a: avoid a warning from clang analyzer
Avoid this warning from clang analyzer by deleting the variable:/src/qemu/hw/lsi53c895a.c:895:5: warning: Value stored to 'id' is never read id = (current_tag >> 8) & 0xf;
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: pass cdb already to scsi_req_new
Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue.Passing it to scsi_req_new will let scsi_req_new dispatch common requeststhrough different reqops.
Moving the memcpy to scsi_req_new is a hack that will go away as...
pci: rename pci_register_bar_region() to pci_register_bar()
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: convert to memory API
An optimization that fast-pathed DMA reads from the SCRIPTS memorywas removed int the process. Likely it breaks with iommus anyway.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
Correct spelling of licensed
Correct typos of "licenced" to "licensed".
Reviewed-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the commandfrom the driver. So we should make that explicit byreplacing 'tag' with a driver-defined pointer 'hba_private'.This saves the lookup for driver handling several commands...
Merge remote-tracking branch 'mst/for_anthony' into staging
Conflicts: hw/usb-uhci.c
lsi: Fix unused-but-set-variable warning
This warning is new in gcc 4.6.
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
hw/lsi53c895a.c: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
scsi: split command_complete callback in two
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: rename arguments to the new callbacks
scsi: do not call send_command directly
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
lsi: extract lsi_find_by_tag
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: introduce scsi_req_cancel
This is for when the request must be dropped in the void,but still memory should be freed. To this end, the devicesregister a second callback in SCSIBusOps.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
lsi53c895a: Rename 'sense' to 'status'
The 'sense' field in the HBA status structure is misnamed, as itactually carries the SCSI status. Rename it.
Signed-off-by: Hannes Reinecke <hare@suse.de>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
hda-intel: convert to pci_register_bar_simple() (partial)
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
lsi53c895a: add support for ABORT messages
If these messages are not handled correctly the guest driver may hang.
Always mandatory:- ABORT- BUS DEVICE RESET
Mandatory if tagged queuing is implemented (which disks usually do):- ABORT TAG- CLEAR QUEUE...
lsi53c895a: Update dnad when skipping MSGOUT bytes
Update not only dbc but also dnad when skipping bytes during the MSGOUTphase. Previously only dbc was updated which is probably wrong andcould lead to bogus message codes being read.
Tested on Linux and Windows Server 2003....
lsi53c895a: fix endianness issues
lsi_ram_read*() and lsi_ram_write*() are not consistent, one usesleXX_to_cpu() the other uses nothing. As the comment above the RAMdeclaration says: "Script ram is stored as 32-bit words in hostbyteorder.", remove the leXX_to_cpu() calls....
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
pci: Replace unneeded type casts in calls of pci_register_bar
There is no need for these type casts (as other existingcode shows). So re-write the first argument withouttype cast (and remove a related TODO comment).
Cc: Michael S. Tsirkin <mst@redhat.com>...
lsi53c895a: avoid a write only variable
Compiling with GCC 4.6.0 20100925 produced a warning:/src/qemu/hw/lsi53c895a.c: In function 'lsi_do_msgout':/src/qemu/hw/lsi53c895a.c:848:9: error: variable 'len' set but not used [-Werror=unused-but-set-variable]...
scsi: fix and improve debug prints
Some of them are not compile clean.
Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: Fix SCSI bus reset
When the controller raises the SCSI reset line, we have to perform therequested reset on all disks attached to the controller's bus. Moreover,reset is edge triggered, so avoid repeating it if the line was alreadyhigh.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callers
None of its callers checks for failure. scsi_hot_add() can crashbecause of that:
(qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1scsi-generic: scsi generic interface too oldSegmentation fault (core dumped)...
lsi53c895a: fix Phase Mismatch Jump
lsi_bad_phase has a bug in the choice of pmjad1/pmjad2. This doesnot matter with Linux guests because it uses just one routine forboth, but it breaks Windows 64-bit guests. This is the textfrom the spec:
"[The PMJCTL] bit controls which decision mechanism is used...
lsi: Fix value overflow in request tag processing
This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrongpatch version): We need to mask the tag value properly to obtain itsdevice ID.
lsi: Handle removal of selected devices
We must not store references to selected devices as they may behot-removed. Instead, look up the device based on its tag right beforeusing it. If the device disappeared, throw an interrupt and disconnect.
lsi: Purge message queue on reset
Declare the input message queue empty and initialize the related statemachine properly on controller reset. This fixes unrecoverable errorswhen the controller was reset during ongoing requests.
lsi: Adjust some register reset values
According to the LSI spec, the reset value of dcmd, dstat, and ctest2were wrong, and sdid as well as ssid require zero initialization. Thereare surely more discrepancies, this is just another increment.
lsi: Purge request queue on soft reset
Avoid keeping zombie requests across controller reset by purging thequeue and also dropping the currently active request.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi: Properly initialize controller state on reset
The LSI controller was lacking a system reset handler. Simply invoke theexisting soft reset handler in this case. This also allows to drop itsexplicit invocation during init.
lsi: fix segfault in lsi_command_complete
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
lsi: use QTAILQ for lsi_queue
Replace the funky array logic for queued commands with standardqemu list functions. Also rename lsi_queue to lsi_request.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi: have lsi_request for the whole life time of the request.
Right now lsi_request is allocated when a request is queued and releasedwhen a request is unqueued. With this patch applied the lsi_request iskept for the whole lifetime of the scsi request....
lsi: move current_dev into lsi_request
lsi: move dma_len+dma_buf into lsi_request
lsi: pass lsi_request to lsi_reselect
All callers of lsi_reselect have a lsi_request struct at hand anyway.So just pass it directly instead of having lsi_reselect search for itusing the tag.
Merge remote branch 'mst/for_anthony' into staging
Fix Sparse warning: dubious: !x & y
lsi: symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
Fix compile error when LSI_DEBUG is defined
This patch fixes the follow error when LSI_DEBUG is set.
CC libhw64/lsi53c895a.occ1: warnings being treated as errorsqemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc':qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'...
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: Use alternative address when already reselected
See SCRIPTS, 3.2.17 SELECT.
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: Implement IRQ on reselection
The critical part of this change is how to deal with simultaneaousgeneration of interrupts. The only (normal) case when this happens inthe emulation is near simultaneous reselection + selection. If selectioncomes first, there is no problem, since the target attempting...
lsi53c895a: Whitespace and typo fixes
lsi53c895a: Add support for LSI53C700 Family Compatibility bit
lsi53c895a: Fix message code of DISCONNECT
See SCSI-2, 6.5 Message system description/message codes.
lsi53c895a: Fix SDID in SELECT ID command
See SCRIPTS Programming Guide, 3.2.17 SELECT.
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
scsi: move scsi.h -> esp.h
scsi: move scsi-disk.h -> scsi.h
lsi_scsi: port to vmstate
hotplug: fix "pci_add storage if=scsi"
Explicitly add the drive to the bus of the newly created scsi adapterinstead of hoping that scsi_bus_legacy_handle_cmdline() picks it upcorrectly.
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
switch scsi bus to inplace allocation.
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
lsi53c895a: remove pointless cast from void *
lsi53c895a: use DO_UPCAST to cast from PCIDevice
lsi53c895a: rename PCIDevice field from pci_dev to dev (consistence)
lsi53c895a: LSIState is a DeviceHost
Go figure.
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Make CPURead/WriteFunc structure 'const'
Add save/restore support to the LSI logic SCSI device model.
This patch requires "Handle BH's queued by AIO completions inqemu_aio_flush()" to work reliably. The combination of those twopatches survived 300+ migrations with heavy IO load running in the...
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
lsi53c895a: Implement write access to DMA Byte Counter
Adds CASE_SET_REG24 and fixes the following errors:
lsi_scsi: error: Unhandled writeb 0x24 = 0x0lsi_scsi: error: Unhandled writeb 0x25 = 0x0
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: Implement Scratch Byte Register
Fixes the following errors:
lsi_scsi: error: Unhandled writeb 0x3a = 0x0lsi_scsi: error: readb 0x3a
lsi53c895a: Implement read and write access to DMA Next Address
lsi_scsi: error: Unhandled writeb 0x28 = 0x0lsi_scsi: error: Unhandled writeb 0x29 = 0x0lsi_scsi: error: Unhandled writeb 0x2a = 0x0lsi_scsi: error: Unhandled writeb 0x2b = 0x0...
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Compile fdc, escc and SCSI controllers only once
LSI SCSI qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Replace gcc variadic macro extension with C99 version
lsi: add ISTAT1 register read (Ryan Harper)
SLES10 SP2 installer complains when probing a scsi disk and exits qemuwhen failing to read one of the registers.
lsi_scsi: error: readb 0x15
--Ryan HarperSoftware Engineer; Linux Technology CenterIBM Corp., Austin, Tx...
qemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6605 c046a42c-6fe2-441c-8c8c-71466251a162
qemu: record devfn on block driver instance (Marcelo Tosatti)
Record PCIDev on the BlockDriverState structure to locate for releaseon hot-removal.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
Add and use #defines for PCI device classes
This patch adds and uses #defines for PCI device classes and subclases,using a new pci_config_set_class() function, similar to the recentlyadded pci_config_set_vendor_id() and pci_config_set_device_id().
Change since v1: fixed compilation of hw/sun4u.c...
Define PCI vendor and device IDs in pci.h (Stuart Brady)
This patch defines PCI vendor and device IDs in pci.h (matching thosefrom Linux's pci_ids.h), and uses those definitions where appropriate.
Change from v1: Introduces pci_config_set_vendor_id() / pci_config_set_device_id()...
LSI53C895A: Introduce CASE_GET_REG24
CASE_GET_REG32 is already defined in lsi53c895a.c; introduce CASE_GET_REG24.
(Sebastian Herbszt)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6311 c046a42c-6fe2-441c-8c8c-71466251a162
Remove unnecessary trailing newlines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
Add 64-bit Block Move support (Direct & Table Indirect) (Ryan Harper)
This patch adds support for 64-bit Block Move instructions. There are multiplemodes for 64-bit Block moves, direct, indirect, and table indirect. This patchimplements Direct and Table indirect moves which are needed by 64-bit windows...
LSI53C895A: Rename dmbs register to dbms (Ryan Harper)
Register name should be: Dynamic Block Move Selector (dbms) according to page 215 of the LSI 53C895A Technical Manual1.
1. http://www.lsi.com/DistributionSystem/AssetDocument/files/docs/techdocs/storage_stand_prod/SCSIControllers/lsi53c895a_tech_manual.pdf...
LSI53C895A: Handle empty SCRIPTS opcode (Justin Chevrier)
Basically after each DMA transfer the Openserver driver would issue anempty (0) SCRIPTS opcode. As the opcode is essentially a NOP it has nosecond DWORD and therefore the DSP should only be incremented by 4 bytes...
LSI53C895A: Remove current_dma_len hack
Signed-off-by: Justin Chevrier <address@hidden>Acked-by: Ryan Harper <ryanh@us.ibm.com>Acked-by: Chris Wright <chrisw@sous-sol.org>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5901 c046a42c-6fe2-441c-8c8c-71466251a162
Fix typo when using TARGET_FMT_plx and LSI_DEBUG (Ryan Harper)
TARGET_FMT_plx includes a % for you. This fixes the following warning whencompiling with LSI_DEBUG enabled.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
Add 40-bit DMA support to LSI scsi emulation (Ryan Harper)
This patch fixes Linux machines configured with > 4G of ram and using aSCSI device.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5750 c046a42c-6fe2-441c-8c8c-71466251a162