summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* block: add a transfer rate for floppy typesHervé Poussineau2012-02-292-2/+4
| | | | | | | | Floppies must be read at a specific transfer rate, depending of its own format. Update floppy description table to include required transfer rate. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* fdc: add CCR (Configuration Control Register) write registerHervé Poussineau2012-02-291-0/+22
| | | | | | | | | | | DIR and CCR registers share the same address ; DIR is read-only while CCR is write-only CCR register is used to change media transfer rate, which will be checked in following changes. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* fdc: handle read-only floppies (abort early on write commands)Hervé Poussineau2012-02-291-0/+11
| | | | | | | A real floppy doesn't attempt to write to read-only media either. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* fdc: most control commands do not generate interruptsHervé Poussineau2012-02-291-6/+6
| | | | | | | | In fact, only three control commands generate an interrupt: read_id, recalibrate and seek Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* fdc: set busy bit when starting a commandHervé Poussineau2012-02-291-1/+1
| | | | | | | This bit must be active while a command is currently executed. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* fdc: take side count into accountHervé Poussineau2012-02-291-6/+11
| | | | | | | | | | | | | | | | Floppies can be simple or double-sided. However, current code was only taking the common case into account (ie 2 sides). This repairs single-sided floppies, which where totally broken before this patch : for track > 0, wrong sector number was calculated, and data was read/written at wrong place on underlying device. Fortunately, only some 360 kB floppies are single-sided, so this bug was probably not seen much. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote-tracking branch 'aneesh/for-upstream' into stagingAnthony Liguori2012-02-271-3/+5
|\ | | | | | | | | | | * aneesh/for-upstream: hw/9pfs: Endian fixes for virtfs ./configure: add option for disabling VirtFS
| * hw/9pfs: Endian fixes for virtfsBenjamin Herrenschmidt2012-02-241-3/+5
| | | | | | | | | | | | | | | | | | | | This patch fixes several endian bugs in virtfs. Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
* | nic: zap obsolote romloading bits from ne2k + pcnetGerd Hoffmann2012-02-242-16/+2
| | | | | | | | | | | | | | | | | | | | | | These days one just needs to specify the romfile in PCiDeviceInfo and everything magically works. It also allows to disable pxe rom loading via "romfile=<emptystring>" like it is possible for all other nics. [ v2: rebased & adapted to qom changes ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | optimize screendump for the common non-switch caseGerd Hoffmann2012-02-247-17/+26
| | | | | | | | | | | | | | | | | | switch console only if needed, also pass down whenever the console was switched or not because a displaysurface redraw is only needed in case the console was switched. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Remove screendump dummy functions.Gerd Hoffmann2012-02-242-12/+2
| | | | | | | | | | | | | | | | | | The code in console.c verifies whenever a screen_dump function pointer is present before calling it, so there is no need to supply an dummy function. Remove them. Also report an error to notify the user that he didn't got a screenshot. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | vga: simplify screendumpGerd Hoffmann2012-02-241-35/+1
| | | | | | | | | | | | | | | | The displaychangelistener isn't needed at all, we can simply save the image when vga_hw_update is done instead of hooking into the update process. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | suspend: make acpi timer wakeup the guest.Gerd Hoffmann2012-02-241-0/+8
| | | | | | | | | | | | | | | | Make the acpi timer wake up the guest. Guests can enable/disable this via acpi too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | suspend: make rtc alarm wakeup the guest.Gerd Hoffmann2012-02-242-0/+8
| | | | | | | | | | | | | | | | | | Make the rtc wake up the guest when the alarm fires. Add acpi windup to property support RTC_EN, so guests can enable and disable this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | suspend: make serial ports wakeup the guest.Gerd Hoffmann2012-02-241-0/+6
| | | | | | | | | | | | | | | | | | Add a 'wakeup' property to the serial port. It is off by default. When enabled any incoming character on the serial line will wake up the guest. Useful for guests which have a serial console configured. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | suspend: make ps/2 devices wakeup the guestGerd Hoffmann2012-02-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | This patch adds wakeup support to ps/2 emulation. Any key press on the ps/2 keyboard will wakeup the guest. Likewise any mouse button press will wakeup the guest. Mouse moves are ignored, so the guest will not wakeup in case your mouse crosses the vnc window of a suspended guest by accident. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann2012-02-249-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | acpi: add acpi_pm1_evt_write_enGerd Hoffmann2012-02-244-2/+8
| | | | | | | | | | | | | | | | Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en function, so the acpi code will see those updates. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | acpi: don't pass overflow_time to acpi_pm1_evt_get_stsGerd Hoffmann2012-02-244-8/+8
| | | | | | | | | | | | | | Pretty pointless, can easily be reached via ACPIREGS now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | acpi: add ACPIREGSGerd Hoffmann2012-02-244-143/+145
| | | | | | | | | | | | | | | | | | | | | | | | All those acpi structs are not independent from each other. Various acpi functions expecting multiple acpi structs passed in are a clean indicator for that ;) So this patch bundles all acpi structs in the new ACPIREGS struct, then use it everythere pass around acpi state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | acpi: move around structsGerd Hoffmann2012-02-241-25/+23
| | | | | | | | | | | | | | | | Group all structs at the top of hw/acpi.h. Just moving around lines, no code changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2012-02-244-23/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * qmp/queue/qmp: qmp: add DEVICE_TRAY_MOVED event ide: drop ide_tray_state_post_load() block: Don't call bdrv_eject() if the tray state didn't change block: bdrv_eject(): Make eject_flag a real bool block: Rename bdrv_mon_event() & BlockMonEventAction
| * | ide: drop ide_tray_state_post_load()Luiz Capitulino2012-02-221-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used to sync the physical tray state after migration when using CD-ROM passthrough. However, migrating when using passthrough is broken anyway and shouldn't be supported... So, drop this function as it causes a problem with the DEVICE_TRAY_MOVED event, which is going to be introduced by the next commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | block: Don't call bdrv_eject() if the tray state didn't changeLuiz Capitulino2012-02-222-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not needed. Besides we can then assume that bdrv_eject() is only called when there's a tray state change, which is useful to the DEVICE_TRAY_MOVED event (going to be added in a future commit). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | block: Rename bdrv_mon_event() & BlockMonEventActionLuiz Capitulino2012-02-223-9/+9
| |/ | | | | | | | | | | | | | | | | | | | | They are QMP events, not monitor events. Rename them accordingly. Also, move bdrv_emit_qmp_error_event() up in the file. A new event will be added soon and it's good to have them next each other. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote-tracking branch 'bonzini/virtio-scsi' into stagingAnthony Liguori2012-02-2417-106/+1079
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bonzini/virtio-scsi: scsi-block: always use scsi_generic_ops for cache != none scsi: fix searching for an empty id scsi: fix wrong return for target INQUIRY virtio-scsi: add migration support virtio-scsi: process control queue requests virtio-scsi: add basic SCSI bus operation virtio-scsi: Add basic request processing infrastructure virtio-scsi: Add virtio-scsi stub device scsi-disk: add migration support scsi-generic: add migration support scsi: add SCSIDevice vmstate definitions scsi-disk: enable scatter/gather functionality scsi: add scatter/gather functionality scsi: pass residual amount to command_complete ahci: use new DMA helpers dma-helpers: add accounting wrappers dma-helpers: add dma_buf_read and dma_buf_write dma-helpers: make QEMUSGList target independent
| * | scsi-block: always use scsi_generic_ops for cache != nonePaolo Bonzini2012-02-241-4/+14
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: fix searching for an empty idPaolo Bonzini2012-02-241-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conditions for detecting no free target or LUN were wrong. The LUN loop was followed by an "if" condition that is never true, because the loop is exited as soon as lun becomes equal to bus->info->max_lun, and never becomes greater than it. The target loop had a wrong condition (<= instead of <). Once this is fixed, the loop would fail in the same way as the LUN loop. The fix is to see whether scsi_device_find returned the device with the last (channel, target, LUN) pair, and fail if so. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: fix wrong return for target INQUIRYPaolo Bonzini2012-02-241-1/+1
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: add migration supportPaolo Bonzini2012-02-241-1/+49
| | | | | | | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: process control queue requestsPaolo Bonzini2012-02-241-8/+126
| | | | | | | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: add basic SCSI bus operationPaolo Bonzini2012-02-221-13/+98
| | | | | | | | | | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: Add basic request processing infrastructureStefan Hajnoczi2012-02-221-2/+140
| | | | | | | | | | | | | | | | | | Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: Add virtio-scsi stub deviceStefan Hajnoczi2012-02-228-0/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a useless virtio SCSI HBA device: qemu -device virtio-scsi-pci Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi-disk: add migration supportPaolo Bonzini2012-02-221-4/+55
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi-generic: add migration supportPaolo Bonzini2012-02-221-0/+25
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: add SCSIDevice vmstate definitionsPaolo Bonzini2012-02-222-3/+120
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi-disk: enable scatter/gather functionalityPaolo Bonzini2012-02-222-13/+51
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: add scatter/gather functionalityPaolo Bonzini2012-02-222-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Scatter/gather functionality uses the newly added DMA helpers. The device can choose between doing DMA itself, or calling scsi_req_data as usual, which will use the newly added DMA helpers to copy piecewise to/from the destination area(s). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: pass residual amount to command_completePaolo Bonzini2012-02-226-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | With the upcoming sglist support, HBAs will not see any transfer_data call and will not have a way to detect short transfers. So pass the residual amount of data upon command completion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | ahci: use new DMA helpersPaolo Bonzini2012-02-221-69/+13
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | | Revert "qemu-char: Print strerror message on failure" and depsMarkus Armbruster2012-02-244-9/+7
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit's purpose is laudable: The only way for chardev drivers to communicate an error was to return a NULL pointer, which resulted in an error message that said _that_ something went wrong, but not _why_. It attempts to achieve it by changing the interface to return 0/-errno and update qemu_chr_open_opts() to use strerror() to display a more helpful error message. Unfortunately, it has serious flaws: 1. Backends "socket" and "udp" return bogus error codes, because qemu_chr_open_socket() and qemu_chr_open_udp() assume that unix_listen_opts(), unix_connect_opts(), inet_listen_opts(), inet_connect_opts() and inet_dgram_opts() fail with errno set appropriately. That assumption is wrong, and the commit turns unspecific error messages into misleading error messages. For instance: $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx inet_connect: host and/or port not specified chardev: opening backend "socket" failed: No such file or directory ENOENT is what happens to be in my errno when the backend returns -errno. Let's put ERANGE there just for giggles: $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx -drive if=none,iops=99999999999999999999 inet_connect: host and/or port not specified chardev: opening backend "socket" failed: Numerical result out of range Worse: when errno happens to be zero, return -errno erroneously signals success, and qemu_chr_new_from_opts() dies dereferencing uninitialized chr. I observe this with "-serial unix:". 2. All qemu_chr_open_opts() knows about the error is an errno error code. That's simply not enough for a decent message. For instance, when inet_dgram() can't resolve the parameter host, which errno code should it use? What if it can't resolve parameter localaddr? Clue: many backends already report errors in their open methods. Let's revert the flawed commit along with its dependencies, and fix up the silent error paths instead. This reverts commit 6e1db57b2ac9025c2443c665a0d9e78748637b26. Conflicts: console.c hw/baum.c qemu-char.c This reverts commit aad04cd024f0c59f0b96f032cde2e24eb3abba6d. The parts of commit db418a0a "Add stdio char device on windows" that depend on the reverted change fixed up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | jazz-led: convert to QOMHervé Poussineau2012-02-223-93/+71
| | | | | | | | | | | | | | | | Some simplifications in I/O functions are possible because Jazz LED only registers one byte of I/O. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | jazz-led: use trace frameworkHervé Poussineau2012-02-221-17/+9
| | | | | | | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | pci: set memory type for memory behind the bridgeMichael S. Tsirkin2012-02-221-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we make upper bits in IO and prefetcheable memory registers writeable, we should declare support for 64 bit prefetcheable memory and 32 bit io in the bridge. This changes the default for apb, dec, but I'm guessing they got the defaults wrong by accident. Alternatively, we could let bridges declare lack of 64 bit support and make the upper bits read-only zero. With this applied, we can drop these bits from express code. Reported-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Could someone familiar with apb,dec ack this please? Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | pci: add accessors to get/set registers by maskMichael S. Tsirkin2012-02-221-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci_regs.h specifies many registers by mask + shifted register values. There's always some duplication when using such: for example to override device type, we would need: pci_word_test_and_clear_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE); pci_word_test_and_set_mask(cap + PCI_EXP_FLAGS, PCI_EXP_TYPE_ENDPOINT << (ffs(PCI_EXP_FLAGS_TYPE) - 1)); Getting such registers also uses some duplication: word = pci_get_word(cap + PCI_EXP_FLAGS) & PCI_EXP_FLAGS_TYPE; if ((word >> ffs((PCI_EXP_FLAGS_TYPE) - 1)) == PCI_EXP_TYPE_ENDPOINT) Add API to access such registers in one line: pci_set_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE, PCI_EXP_TYPE_ENDPOINT) and word = pci_get_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE) if (word == PCI_EXP_TYPE_ENDPOINT) Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | pc_piix/pc_sysfw: enable flash by defaultJordan Justen2012-02-222-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, the pc-sysfw:rom_only property will default to false which enables flash by default. All pc types below pc-1.1 set rom_only to true. This prevents flash from being enabled on these pc machine types. For pc-1.1 rom_only will use the default (false), which will allow flash to be used for pc-1.1. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | hw/pc_piix: add pc-1.1Jordan Justen2012-02-221-2/+10
| | | | | | | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | hw/pc_piix: remove is_default for pc-0.15Jordan Justen2012-02-221-1/+0
| | | | | | | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | hw/pc_sysfw: support system flash memory with pflashJordan Justen2012-02-221-2/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flash can be enabled by calling pc_system_firmware_init with the system_flash_enabled parameter being non-zero. If system_flash_enabled is zero, then the older qemu rom creation method will be used. If flash is enabled and a pflash image is found, then it is used for the system firmware image. If flash is enabled and a pflash image is not initially found, then a read-only pflash device is created using the -bios filename. KVM cannot execute from a pflash region currently. Therefore, when KVM is enabled, the old rom based initialization method is used. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud