aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-27target-or32: Add float instruction helpersJia Liu3-1/+335
Add OpenRISC float instruction helpers. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27target-or32: Add int instruction helpersJia Liu3-1/+85
Add OpenRISC int instruction helpers. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27target-or32: Add exception supportJia Liu5-2/+89
Add OpenRISC exception support. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27target-or32: Add interrupt supportJia Liu6-2/+151
Add OpenRISC interrupt support. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27target-or32: Add MMU supportJia Liu3-2/+303
Add OpenRISC MMU support. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27target-or32: Add target stubs and QOM cpuJia Liu16-2/+817
Add OpenRISC target stubs, QOM cpu and basic machine. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27virtio-scsi: enable MSI-X supportPaolo Bonzini1-2/+4
While virtio-scsi does support multiqueue, the default number of interrupt vectors is not enough to actually enable usage of multiple queues in the driver; this is because with only 2 vectors the driver will not be able to use a separate interrupt for each request queue. Derive the desired number of vectors from the number of request queues. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27virtio-scsi: add ioeventfd supportPaolo Bonzini1-0/+1
Probably due to bad merge months ago, virtio-scsi-pci did not have ioeventfd support. Fix this and enable it by default, as is the case for other virtio-pci devices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27virtio-scsi: report parameter change eventsPaolo Bonzini1-0/+16
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27virtio-scsi: do not report dropped events after resetPaolo Bonzini1-0/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27virtio-scsi: Report missed eventsPaolo Bonzini1-18/+36
When an event is reported but no buffers are present in the event vq, we can set a flag and report a dummy event as soon as one is added. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27virtio-scsi: Implement hotplug support for virtio-scsiCong Meng1-2/+70
Implement the hotplug() and hot_unplug() interfaces in virtio-scsi, by signal the virtio_scsi.ko in guest kernel via event virtual queue. The counterpart patch of virtio_scsi.ko will be sent soon in another thread. Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com> Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com> [ Add memset, fix LUN field, placate checkpatch - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi: report parameter changes to HBA driversPaolo Bonzini3-0/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi-disk: report resized disk via sense codesPaolo Bonzini3-2/+29
Linux will not use these, but a very similar mechanism will be used to report the condition via virtio-scsi events. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi: establish precedence levels for unit attentionPaolo Bonzini4-3/+55
When a device is resized, we will report a unit attention condition for CAPACITY DATA HAS CHANGED. However, we should ensure that this condition does not override a more important unit attention condition. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi: introduce hotplug() and hot_unplug() interfaces for SCSI busCong Meng2-1/+18
Add two interfaces hotplug() and hot_unplug() to scsi bus info. The scsi bus can implement these two interfaces to signal the HBA driver of guest kernel to add/remove the scsi device in question. Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com> Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com> [ Fixed braces and indentation - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi: add tracepoint for scsi_req_cancelPaolo Bonzini2-0/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27scsi-disk: removable hard disks support load/ejectPaolo Bonzini1-1/+1
Support for the LOEJ bit of the START/STOP UNIT command right now is limited to CD-ROMs. This is wrong, since removable hard disks (in the real world: SD card readers) also support it in pretty much the same way. Without the LOEJ bit, START/STOP UNIT does nothing for all devices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: Fail medium writes with proper sense for readonly LUNsRonnie Sahlberg3-3/+19
Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this error for any WRITE*/WRITE_VERIFY* calls if the device is readonly=on, i.e. write-protected Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: improve the lba-out-of-range tests for read/write/verifyRonnie Sahlberg1-2/+4
Improve the tests for the LBA to cover more cases. For the 16 byte opcodes, the lba is a uint64, so we need to check is to make sure that we do not wrap. For example if an opcode would specify the LBA:0xffffffffffffffff and LEN:2 then lba+len would wrap to 1. Also verify that ALL requested blocks are available, not just the first one. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: rd/wr/vr-protect !=0 is an errorRonnie Sahlberg1-0/+9
The QEMU SCSI emulation does not support protection information, so any READ/WRITE/VERIFY commands that has the protect bits set to non-zero should fail with ILLEGAL_REQUEST/INVALID_FIELD_IN_CDB From SCSI SBC : If the logical unit does not support protection information, then the device server should terminate the command with CHECK CONDITION status with the sense key set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN CDB. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> [ Rebase after scsi_dma_reqops introduction - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: support toggling the write cachePaolo Bonzini1-4/+10
Finally, this uses the "plumbing" in the previous patch to add support for toggling the WCE bit of the caching mode page. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: parse MODE SELECT commands and parametersPaolo Bonzini3-11/+169
This adds the bulk of the parsing code for MODE SELECT, including breaking out changes to different mode pages, and checking that only changeable values are modified. In order to report errors correctly two passes are made through the parameters; the first only looks for errors, the second actually applies the changes to the mode page. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: fix changeable values for MODE_PAGE_R_W_ERRORPaolo Bonzini1-0/+3
The changeable values were not all-zeros for this mode page, fix it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: adjust offsets in MODE SENSE by 2Paolo Bonzini1-66/+74
This will make offsets the same when implementing MODE SELECT. This is because MODE SELECT has to deal with both 2-byte and 4-byte headers. Unfortunately, this means that the offsets are now off by two compared to the descriptions in the SCSI specs, which include the header. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: support emulated TO_DEV requestsPaolo Bonzini1-8/+28
This adds the implementation of write_data for the emulated command case. The first time through it asks for more data, the second time it finishes the processing of the command. MODE SELECT and MODE SELECT(10) can now be re-enabled, but they will not do much. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: separate read_data/write_data implementation for emulate_reqopsPaolo Bonzini1-11/+25
The previous patch only separated the send_command callback. Use different implementations also for read_data and write_data. The latter is still unreachable, so it aborts for now. read_data passes the data buffer that was prepared and completes the command. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: split scsi-disk reqopsPaolo Bonzini1-68/+123
Only checks for present medium were still done in scsi_send_command for emulated commands. So move those to scsi_disk_emulate_command and return different SCSIReqOps depending on the kind of command. Checks for present medium can be done unconditionally for the scsi_disk_dma_reqops case. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: move all non-DMA commands to scsi_disk_emulate_commandPaolo Bonzini1-86/+66
We want to use separate SCSIReqOps for emulated commands needing an allocated buffer vs. those that are zerocopy when the HBA supports S/G lists. Ensure that all of the former are in scsi_disk_emulate_command. Commands that do not have any parameters are more similar to emulated commands, so also move them, even if they do I/O. Finally, MODE SELECT and MODE SELECT(10) are broken because we do not yet support passing parameter data _to_ emulated commands, so disable them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: make discard asynchronousPaolo Bonzini1-12/+10
By making discard asynchronous, we can reuse all the error handling code that is used for other commands. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-disk: let the user customize vendor and product nameDmitry Fleytman1-10/+21
This patch adds two new properties vendor and product to SCSI disks. These options let the user customize the inquiry data returned by the disk. Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com> Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com> [ Use vendor and product property names, avoid "if" statements. - PB ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26cutils: add strpadcpy()Dmitry Fleytman2-0/+8
Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com> Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26scsi-block: remove properties that are not relevant for passthroughPaolo Bonzini1-1/+1
scsi-block is a passthrough device and does not allow customization of vendor, product, removable, DPOFUA, block size or any other piece of information. Thus, drop DEFINE_SCSI_DISK_PROPERTIES() from the list of qdev properties. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26lsi: avoid redundant tests of s->current != NULLPaolo Bonzini1-2/+3
Simplify the code by checking against req->hba_private directly, and asserting that it is non-NULL before a command is completed or canceled. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26lsi: introduce lsi_request_freePaolo Bonzini1-15/+16
Split the common bits of lsi_request_cancelled and lsi_command_complete out to a new function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26lsi: use qdev_reset_allPaolo Bonzini1-12/+3
By first resetting the devices, lsi_soft_reset will find the queue already cleared so there is no need to do that forcibly (which may also leak SCSIRequests, and/or worse due to dangling references to the lsi_request in the hba_private field). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26megasas: fix misuse of scsi_req_abortPaolo Bonzini1-1/+1
scsi_req_abort is for terminating a command with a non-zero status. The ABORT task management function is invoked by scsi_req_cancel. In fact, ABORTED_COMMAND is a sense key, not a SAM status code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-26megasas: Replace trace_megasas_dcmd_dump_frame()Hannes Reinecke2-30/+11
trace_megasas_dcmd_dump_frame() takes 9 arguments, which is rather much. Plus the trace infrastructure doesn't support it. As we can get the information via other means it's pointless to have it in the driver, so rather use some proper trace point here and remove the old one. Signed-off-by: Hannes Reinecke <hare@suse.de> Cc: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-24qemu-nbd: add --cache and --aio optionsPaolo Bonzini1-2/+40
Add two options to tune the I/O implementation of qemu-nbd, matching the possibilities given by the QEMU -drive option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-24qemu-nbd: reorganize help messagePaolo Bonzini1-11/+22
This patch separates qemu-nbd's options in logical groups, thus making the help message easier to read. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-23Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori60-771/+1352
* stefanha/net: remove unused QemuOpts parameter from net init functions convert net_init_bridge() to NetClientOptions convert net_init_tap() to NetClientOptions convert net_init_vde() to NetClientOptions convert net_init_socket() to NetClientOptions convert net_init_slirp() to NetClientOptions convert net_init_dump() to NetClientOptions convert net_init_nic() to NetClientOptions convert net_client_init() to OptsVisitor hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated) qapi schema: add Netdev types qapi schema: remove trailing whitespace qapi: introduce OptsVisitor expose QemuOpt and QemuOpts struct definitions to interested parties qapi: introduce "size" type qapi: generate C types for fixed-width integers qapi: add test case for deallocating traversal of incomplete structure qapi: fix error propagation MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi
2012-07-23Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori9-85/+83
* stefanha/trivial-patches: Fix some more Qemus in documentation and help text qdev: Fix Open Firmware comment cpus.c: Make all_cpu_threads_idle() static Use macro QEMU_PACKED for new packed structures Recognize PCID feature powerpc pci: fixed packing of ranges[]
2012-07-23Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori11-16/+456
* pmaydell/arm-devs.for-upstream: exynos4210: add Exynos4210 i2c implementation hw/exynos4210_rtc.c: remove unnecessary code hw/exynos4210_rtc.c: Fix calculating for value of year hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard hw/arm_boot.c: Support DTBs which use 64 bit addresses device_tree: Add support for reading device tree properties hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct hw/arm_boot.c: Make ram_size a uint64_t hw/pl011.c: Avoid crash on read when no chr backend present
2012-07-23Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori6-196/+340
* stefanha/tracing: Update simpletrace.py for new log format Simpletrace v2: Support multiple arguments, strings. monitor: remove unused do_info_trace trace: added ability to comment out events in the list
2012-07-23Change ram_save_block to return -1 if there are no more changesOrit Wasserman1-6/+20
It will return 0 if the page is unmodifed. Signed-off-by: Orit Wasserman <owasserm@redhat.com>
2012-07-23remove unused QemuOpts parameter from net init functionsLaszlo Ersek12-38/+32
v1->v2: - unchanged v2->v3: - keep "qemu-option.h" included in "net/slirp.h" Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_bridge() to NetClientOptionsLaszlo Ersek1-11/+12
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_tap() to NetClientOptionsLaszlo Ersek8-70/+71
Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_vde() to NetClientOptionsLaszlo Ersek1-10/+7
v1->v2: - NetdevVdeOptions::port and ::mode are of type uint16. Remove superfluous range checks. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23convert net_init_socket() to NetClientOptionsLaszlo Ersek1-76/+43
I "reverse engineered" the following permissions between the -socket sub-options: fd listen connect mcast udp | localaddr fd x . . . . | . listen . x . . . | . connect . . x . . | . mcast . . . x . | x udp . . . . x | x -------------------------------------------+ localaddr . . . x x x I transformed the code accordingly. The real fix would be to embed "fd", "listen", "connect", "mcast" and "udp" in a separate union. However OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as union discriminator. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>