summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2013-01-314-28/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Andreas Färber # Via Andreas Färber * afaerber/qom-cpu: linux-user: bsd-user: Don't reset X86CPU twice target-i386: Pass X86CPU to cpu_x86_set_a20() target-unicore32: Rename CPU subtypes target-openrisc: Rename CPU subtypes target-openrisc: TYPE_OPENRISC_CPU should be abstract target-m68k: Rename CPU subtypes target-m68k: Mark as unmigratable target-s390x: Mark as unmigratable target-sh4: Mark as unmigratable target-xtensa: Mark as unmigratable target-microblaze: Mark as unmigratable target-unicore32: Mark as unmigratable ide/mmio: QOM'ify MMIO IDE for R2D
| * target-i386: Pass X86CPU to cpu_x86_set_a20()Andreas Färber2013-02-011-3/+4
| | | | | | | | | | | | | | | | | | Prepares for cpu_interrupt() changing argument to CPUState. While touching it, rename to x86_cpu_...() now that it takes an X86CPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
| * ide/mmio: QOM'ify MMIO IDE for R2DAndreas Färber2013-02-013-25/+82
| | | | | | | | | | | | | | | | | | It was not qdev'ified before, so turn it into a SysBusDevice. Keep mmio_ide_init_drives() around to attach the hard drive. Signed-off-by: Andreas Färberr <afaerber@suse.de> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori2013-01-319-65/+227
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio,make,pci,e1000,vfio,piix This includes my timestamp generation cleanup, Amos's and my work on virtio net commands, pci,e1000,vfio and piix fixes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 31 Jan 2013 06:20:27 AM CST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (6) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: vfio-pci: Enable PCIe extended config space PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set ich9: add support for pci assignment virtio-net: rename ctrl rx commands virtio-net: introduce a new macaddr control virtio-net: remove layout assumptions for ctrl vq virtio-net: revert mac on reset rules/mak: make clean should blow away timestamp files Makefile: clean timestamp generation rule rules.mak: cleanup config generation rules e1000: document ICS read behaviour
| * vfio-pci: Enable PCIe extended config spaceAlex Williamson2013-01-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | We don't know pre-init time whether the device we're exposing is PCIe or legacy PCI. We could ask for it to be specified via a device option, but that seems like too much to ask of the user. Instead we can assume everything will be PCIe, which makes PCI-core allocate enough config space. Removing the flag during init leaves the space allocated, but allows legacy PCI devices to report the real device config space size to rest of Qemu. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * PIIX3: reset the VM when the Reset Control Register's RCPU bit gets setLaszlo Ersek2013-01-301-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditional PCI config space access is achieved by writing a 32 bit value to io port 0xcf8 to identify the bus, device, function and config register. Port 0xcfc then contains the register in question. But if you write the appropriate pair of magic values to 0xcf9, the machine will reboot. Spectacular! And not standardised in any way (certainly not part of the PCI spec), so different chipsets may have different requirements. Booo. In the PIIX3 spec, IO port 0xcf9 is specified as the Reset Control Register. Bit 1 (System Reset, SRST) would normally differentiate between soft reset and hard reset, but we ignore the difference beyond allowing the guest to read it back. RHBZ reference: 890459 This patch introduces the following overlap between the preexistent "pci-conf-idx" region and the "piix3-reset-control" region just being added. Partial output from "info mtree": I/O 0000000000000000-000000000000ffff (prio 0, RW): io 0000000000000cf8-0000000000000cfb (prio 0, RW): pci-conf-idx 0000000000000cf9-0000000000000cf9 (prio 1, RW): piix3-reset-control I sanity-checked the patch by booting a RHEL-6.3 guest and found no problems. I summoned gdb and set a breakpoint on rcr_write() in order to gather a bit more confidence. Relevant frames of the stack: kvm_handle_io (port=3321, data=0x7f3f5f3de000, direction=1, size=1, count=1) [kvm-all.c:1422] cpu_outb (addr=3321, val=6 '\006') [ioport.c:289] ioport_write (index=0, address=3321, data=6) [ioport.c:83] ioport_writeb_thunk (opaque=0x7f3f622c4680, addr=3321, data=6) [ioport.c:212] memory_region_iorange_write (iorange=0x7f3f622c4680, offset=0, width=1, data=6) [memory.c:439] access_with_adjusted_size (addr=0, value=0x7f3f531fbac0, size=1, access_size_min=1, access_size_max=4, access=0x7f3f5f6e0f90 <memory_region_write_accessor>, opaque=0x7f3f6227b668) [memory.c:364] memory_region_write_accessor (opaque=0x7f3f6227b668, addr=0, value=0x7f3f531fbac0, size=1, shift=0, mask=255) [memory.c:334] rcr_write (opaque=0x7f3f6227afb0, addr=0, val=6, len=1) [hw/piix_pci.c:498] The dispatch happens in ioport_write(); "index=0" means byte-wide access: static void ioport_write(int index, uint32_t address, uint32_t data) { static IOPortWriteFunc * const default_func[3] = { default_ioport_writeb, default_ioport_writew, default_ioport_writel }; IOPortWriteFunc *func = ioport_write_table[index][address]; if (!func) func = default_func[index]; func(ioport_opaque[address], address, data); } The "ioport_write_table" and "ioport_opaque" arrays describe the flattened IO port space. The first array is less interesting (it selects a thunk function). The "ioport_opaque" array is interesting because it decides how writing to the port is implemented ultimately. 4-byte wide access to 0xcf8 (pci-conf-idx): (gdb) print ioport_write_table[2][0xcf8] $1 = (IOPortWriteFunc *) 0x7f3f5f6d99ba <ioport_writel_thunk> (gdb) print \ ((struct MemoryRegionIORange*)ioport_opaque[0xcf8])->mr->ops.write $2 = (void (*)(void *, hwaddr, uint64_t, unsigned int)) 0x7f3f5f5575cb <pci_host_config_write> 1-byte wide access to 0xcf9 (piix3-reset-control): (gdb) print ioport_write_table[0][0xcf9] $3 = (IOPortWriteFunc *) 0x7f3f5f6d98d0 <ioport_writeb_thunk> (gdb) print \ ((struct MemoryRegionIORange*)ioport_opaque[0xcf9])->mr->ops.write $4 = (void (*)(void *, hwaddr, uint64_t, unsigned int)) 0x7f3f5f6b42f1 <rcr_write> The higher priority of "piix3-reset-control" ensures that the 0xcf9 entries in ioport_write_table / ioport_opaque will always belong to it, independently of its relative registration order versus "pci-conf-idx". Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * ich9: add support for pci assignmentJason Baron2013-01-303-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Fills out support for the pci assignment API. Added: PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) Add calls to pci_bus_fire_intx_routing_notifier() when routing changes are made. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: rename ctrl rx commandsAmos Kong2013-01-302-14/+14
| | | | | | | | | | | | | | This patch makes rx commands consistent with specification. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: introduce a new macaddr controlAmos Kong2013-01-303-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In virtio-net guest driver, currently we write MAC address to pci config space byte by byte, this means that we have an intermediate step where mac is wrong. This patch introduced a new control command to set MAC address, it's atomic. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility. "mac" field will be set to read-only when VIRTIO_NET_F_CTRL_MAC_ADDR is acked. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: remove layout assumptions for ctrl vqMichael S. Tsirkin2013-01-301-54/+75
| | | | | | | | | | | | | | | | | | | | | | Virtio-net code makes assumption about virtqueue descriptor layout (e.g. sg[0] is the header, sg[1] is the data buffer). This patch makes code not rely on the layout of descriptors. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: revert mac on resetMichael S. Tsirkin2013-01-301-0/+1
| | | | | | | | | | | | | | | | | | Once guest overrides virtio net primary mac, it retains the value set until qemu exit. This is inconsistent with standard nic behaviour. To fix, revert the mac to the original value on reset. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * e1000: document ICS read behaviourMichael S. Tsirkin2013-01-301-0/+10
| | | | | | | | | | | | | | | | Add code comment to clarify the reason we set ICS with ICR: the reason was previously undocumented and git log confused rather than clarified the comments. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'pmaydell/arm-devs.next' into stagingAnthony Liguori2013-01-302-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | # By Christoffer Dall (1) and Peter Maydell (1) # Via Peter Maydell * pmaydell/arm-devs.next: hw/vexpress: Use correct HBI (board model number) for vexpress-a15 hw/arm_sysctl: Clear sysctl cfgctrl start bit
| * | hw/vexpress: Use correct HBI (board model number) for vexpress-a15Peter Maydell2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | The vexpress-a15 QEMU model is supposed to be a V2P-CA15; the HBI (a kind of board model number) for this coretile is 237, not 217. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/arm_sysctl: Clear sysctl cfgctrl start bitChristoffer Dall2013-01-301-0/+1
| |/ | | | | | | | | | | | | | | The start bit should only be set to indicate that a function call is underway, right now. When done with function, clear it. Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2013-01-308-33/+23
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Markus Armbruster (12) and others # Via Stefan Hajnoczi * stefanha/trivial-patches: qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema tests: Fix {rtc, m48t59}-test build on illumos qemu-pixman.h: Avoid mutual inclusion loop with console.h qemu-ga: Fix unchecked strdup() by converting to g_strdup() qapi: Fix unchecked strdup() by converting to g_strdup() libcacard: Fix unchecked strdup() by converting to g_strdup() qemu-log: Plug trivial memory leak in cpu_set_log_filename() qemu-log: Fix unchecked strdup() by converting to g_strdup() virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup() spice: Fix unchecked strdup() by converting to g_strdup() readline: Fix unchecked strdup() by converting to g_strdup() hw/9pfs: Fix unchecked strdup() by converting to g_strdup() g_strdup(NULL) returns NULL; simplify g_malloc(0) and g_malloc0(0) return NULL; simplify xilinx_axidma: Fix debug mode compile messages cadence_gem: Debug mode compile fixes cadence_ttc: Debug mode compile fixes vnc: Clean up vncws_send_handshake_response()
| * | hw/9pfs: Fix unchecked strdup() by converting to g_strdup()Markus Armbruster2013-01-302-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Note: the allocation in virtio_9p_init() is still leaked. To be fixed in a followup commit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | g_strdup(NULL) returns NULL; simplifyMarkus Armbruster2013-01-302-8/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | g_malloc(0) and g_malloc0(0) return NULL; simplifyMarkus Armbruster2013-01-302-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once upon a time, it was decided that qemu_malloc(0) should abort. Switching to glib retired that bright idea. Some code that was added to cope with it (e.g. in commits 702ef63, b76b6e9) is still around. Bury it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | xilinx_axidma: Fix debug mode compile messagesPeter Crosthwaite2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Missing cast one one of the conditionally compiled printfs. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | cadence_gem: Debug mode compile fixesPeter Crosthwaite2013-01-301-7/+10
| | | | | | | | | | | | | | | | | | | | | Some printfs are throwing warnings when debug mode is enabled. Fixed. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | cadence_ttc: Debug mode compile fixesPeter Crosthwaite2013-01-301-2/+2
| |/ | | | | | | | | | | | | Some printfs are throwing warnings when debug mode is enabled. Fixed. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | Merge remote-tracking branch 'afaerber-or/prep-up' into stagingAnthony Liguori2013-01-303-31/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | # By Andreas Färber # Via Andreas Färber * afaerber-or/prep-up: prep: Move PReP machine to hw/ppc/ prep_pci: Convert to QOM realizefn prep_pci: Create PCIBus and PCIDevice in-place
| * | prep: Move PReP machine to hw/ppc/Andreas Färber2013-01-302-15/+16
| | | | | | | | | | | | Signed-off-by: Andreas Färber <andreas.faerber@web.de>
| * | prep_pci: Convert to QOM realizefnAndreas Färber2013-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SysBusDeviceClass' initfn merely calls SysBusDeviceClass::init, so we can already hook up our own realizefn overwriting this behavior. A symmetric unrealizefn is not necessary, knowing that the child's unrealizefn is still no-op, too. Avoids ripping it out again when recursive realization at DeviceState-level is implemented. Signed-off-by: Andreas Färber <andreas.faerber@web.de>
| * | prep_pci: Create PCIBus and PCIDevice in-placeAndreas Färber2013-01-271-13/+37
| | | | | | | | | | | | | | | | | | Prepares for QOM realizefn by removing object creation from qdev initfn. Signed-off-by: Andreas Färber <andreas.faerber@web.de>
* | | s390: Drop set_bit usage in virtio_ccw.Cornelia Huck2013-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set_bit on indicators doesn't go well on 32 bit targets: note: expected 'long unsigned int *' but argument is of type 'uint64_t *' Switch to bit shifts instead. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> [agraf: use 1ULL instead] Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: css error codes.Cornelia Huck2013-01-292-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed error codes in the channel subsystem / virtio-ccw code (-EOPNOTSUPP -> -ENOSYS, -ERESTART -> -EINPROGRESS). This should hopefully fix building on mingw32. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Use s390_cpu_physical_memory_map for tpi.Cornelia Huck2013-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | Map the I/O interruption code before calling into css. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Add s390-ccw-virtio machine.Cornelia Huck2013-01-293-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new machine type, s390-ccw-virtio, making use of the virtio-ccw transport to present virtio devices as channel devices. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390-virtio: Check for NULL device in reset hypercallAndreas Färber2013-01-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s390_virtio_bus_find_mem() may return a NULL VirtIOS390Device. If called with, e.g., args[0] == 0, this leads to a segfault. Fix this by adding error handling as done for other hypercalls. Present since baf0b55a9e57b909b1f8b0f732c0b10242867418 (Implement virtio reset). Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Move hw files to hw/s390xAlexander Graf2013-01-296-18/+16
| | | | | | | | | | | | | | | | | | | | | This moves all files only used by s390 system emulation to hw/s390x. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
* | | virtio-s390: add a reset function to virtio-s390 devicesPaolo Bonzini2013-01-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio-s390 devices are not being reset when their bus is. To fix this, add a reset method that forwards to virtio_reset. This is only needed because of the "strange" modeling of virtio devices; the ->vdev link is being handled manually rather than through qdev. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Make typeinfo constAlexander Graf2013-01-291-1/+1
| | | | | | | | | | | | | | | | | | All TypeInfo definitions should be const. Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Add new channel I/O based virtio transport.Cornelia Huck2013-01-293-0/+1059
| | | | | | | | | | | | | | | | | | | | | | | | Add a new virtio transport that uses channel commands to perform virtio operations. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390-virtio: Factor out some initialization code.Cornelia Huck2013-01-292-51/+72
| | | | | | | | | | | | | | | | | | | | | | | | Some of the machine initialization for s390-virtio will be reused by virtio-ccw. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Virtual channel subsystem support.Cornelia Huck2013-01-293-0/+1377
| | | | | | | | | | | | | | | | | | | | | | | | Provide a mechanism for qemu to provide fully virtual subchannels to the guest. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | | s390: Add default support for SCLP consoleAlexander Graf2013-01-291-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | The current s390 machine uses the virtio console as default console, but this doesn't mean that we always want to keep it that way for new machines. This patch introduces a way for a machine type to specify that it wants the default console to be an SCLP console, which is a lot closer to what real hardware does. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <afaerber@suse.de>
* | Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2013-01-287-13/+60
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * afaerber/qom-cpu: (37 commits) kvm: Pass CPUState to kvm_on_sigbus_vcpu() cpu: Unconditionalize CPUState fields target-m68k: Use type_register() instead of type_register_static() target-unicore32: Use type_register() instead of type_register_static() target-openrisc: Use type_register() instead of type_register_static() target-unicore32: Catch attempt to instantiate abstract type in cpu_init() target-openrisc: Catch attempt to instantiate abstract type in cpu_init() target-m68k: Catch attempt to instantiate abstract type in cpu_init() target-arm: Catch attempt to instantiate abstract type in cpu_init() target-alpha: Catch attempt to instantiate abstract type in cpu_init() qom: Introduce object_class_is_abstract() target-unicore32: Detect attempt to instantiate non-CPU type in cpu_init() target-openrisc: Detect attempt to instantiate non-CPU type in cpu_init() target-m68k: Detect attempt to instantiate non-CPU type in cpu_init() target-alpha: Detect attempt to instantiate non-CPU type in cpu_init() target-arm: Detect attempt to instantiate non-CPU type in cpu_init() cpu: Add model resolution support to CPUClass target-i386: Remove setting tsc-frequency from x86_def_t target-i386: Set custom features/properties without intermediate x86_def_t target-i386: Remove vendor_override field from CPUX86State ... Conflicts: tests/Makefile Resolved simple conflict caused by lack of context in Makefile Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | pc: Generate APIC IDs according to CPU topologyEduardo Habkost2013-01-271-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This keeps compatibility on machine-types pc-1.2 and older, and prints a warning in case the requested configuration won't get the correct topology. I couldn't think of a better way to warn about broken topology when in compat mode other than using error_report(). The warning message will probably be buried in a log file somewhere, but it's better than nothing. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | pc: Set fw_cfg data based on APIC ID calculationEduardo Habkost2013-01-271-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes FW_CFG_MAX_CPUS and FW_CFG_NUMA to use apic_id_for_cpu(), so the NUMA table can be based on the APIC IDs, instead of CPU index (SeaBIOS knows nothing about CPU indexes, just APIC IDs). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | fw_cfg: Remove FW_CFG_MAX_CPUS from fw_cfg_init()Eduardo Habkost2013-01-276-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | PC will not use max_cpus for that field, so move it outside the common code so it can use a different value on PC. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * | pc: Reverse pc_init_pci() compatibility logicEduardo Habkost2013-01-271-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the pc-1.4 machine init function enables PV EOI and then calls the pc-1.2 machine init function. The problem with this approach is that now we can't enable any additional compatibility code inside the pc-1.2 init function because it would end up enabling the compatibility behavior on pc-1.3 and pc-1.4 as well. This reverses the logic so that the pc-1.2 machine init function will disable PV EOI, and then call the pc-1.4 machine init function. This way we can change older machine-types to enable compatibility behavior, and the newer machine-types (pc-1.3, pc-q35-1.4 and pc-i440fx-1.4) would just use the default behavior. (This means that one nice side-effect of this change is that pc-q35-1.4 will get PV EOI enabled by default, too) It would be interesting to eventually change pc_init_pci_no_kvmclock() and pc_init_isa() to reuse pc_init_pci_1_2() as well (so we don't need to duplicate compatibility code on those two functions). But this will be probably much easier to do after we create a PCInitArgs struct for the PC initialization arguments, and/or after we use global-properties to implement the compatibility modes present in pc_init_pci_1_2(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2013-01-284-29/+136
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Paolo Bonzini (14) and others # Via Kevin Wolf * kwolf/for-anthony: (24 commits) ide: Add fall through annotations block: Create proper size file for disk mirror ahci: Add migration support ahci: Change data types in preparation for migration ahci: Remove unused AHCIDevice fields hbitmap: add assertion on hbitmap_iter_init mirror: do nothing on zero-sized disk block/vdi: Check for bad signature block/vdi: Improved return values from vdi_open block/vdi: Improve debug output for signature block: Use error code EMEDIUMTYPE for wrong format in some block drivers block: Add special error code for wrong format mirror: support arbitrarily-sized iterations mirror: support more than one in-flight AIO operation mirror: add buf-size argument to drive-mirror mirror: switch mirror_iteration to AIO mirror: allow customizing the granularity block: allow customizing the granularity of the dirty bitmap block: return count of dirty sectors, not chunks mirror: perform COW if the cluster size is bigger than the granularity ...
| * | | ide: Add fall through annotationsKevin Wolf2013-01-251-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add comments to help static analysers detect that these cases are intentional, and clean up some whitespace in the environment of these comments. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
| * | | ahci: Add migration supportJason Baron2013-01-253-5/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jason tested these patches by migrating Windows 7 and Fedora 17 guests (while under I/O) on both piix with ahci attached and on q35 (which has a built-in AHCI controller). Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | ahci: Change data types in preparation for migrationKevin Wolf2013-01-252-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The size of an int depends on the host, so in order to be able to migrate these fields, make them either int32_t or bool, depending on the use. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | ahci: Remove unused AHCIDevice fieldsJason Baron2013-01-252-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'dma_status' and 'dma_cb' are written to, but never read. Remove these fields in preparation for AHCI migration bits. Signed-off-by: Jason Baron <jbaron@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | | Merge remote-tracking branch 'luiz/queue/qmp' into stagingAnthony Liguori2013-01-281-25/+150
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Lei Li (3) and others # Via Luiz Capitulino * luiz/queue/qmp: QAPI: Introduce memchar-read QMP command QAPI: Introduce memchar-write QMP command qemu-char: Add new char backend CirMemCharDriver docs: document virtio-balloon stats balloon: re-enable balloon stats balloon: drop old stats code & API block: Monitor command commit neglects to report some errors
| * | | balloon: re-enable balloon statsLuiz Capitulino2013-01-251-1/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The statistics are now available through device properties via a polling mechanism. First a client has to enable polling, then it can query available stats. Polling is enabled by setting an update interval (in seconds) to a property named guest-stats-polling-interval, like this: { "execute": "qom-set", "arguments": { "path": "/machine/peripheral-anon/device[1]", "property": "guest-stats-polling-interval", "value": 4 } } Then the available stats can be retrieved by querying the guest-stats property. The returned object is a dict containing all available stats. Example: { "execute": "qom-get", "arguments": { "path": "/machine/peripheral-anon/device[1]", "property": "guest-stats" } } { "return": { "stats": { "stat-swap-out": 0, "stat-free-memory": 844943360, "stat-minor-faults": 219028, "stat-major-faults": 235, "stat-total-memory": 1044406272, "stat-swap-in": 0 }, "last-update": 1358529861 } } Please, check the next commit for full documentation. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
OpenPOWER on IntegriCloud