summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* target-xtensa: Start QOM'ifying CPU initAndreas Färber2012-04-142-1/+9
| | | | | | | | Move XtensaConfig-independent code from cpu_xtensa_init() into a QOM initfn, as a start. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: QOM'ify CPU resetAndreas Färber2012-04-143-14/+14
| | | | | | | | Move code from cpu_state_reset() into QOM xtensa_cpu_reset(). To avoid moving reset_mmu() and dependencies, make it non-static. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: QOM'ify CPUAndreas Färber2012-04-145-1/+154
| | | | | | | | Embed CPUXtensaState as first member of XtensaCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: improve unit tests debuggingMax Filippov2012-04-142-0/+20
| | | | | | | | - add testcase announcement; - add global symbols for individual tests; - add host-debug-* makefile target. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* target-xtensa: Move helpers.h to helper.hLluís Vilanova2012-04-144-5/+5
| | | | | | | Provides a file naming scheme consistent with other targets. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2012-04-134-8/+46
|\ | | | | | | | | | | | | | | | | | | * stefanha/trivial-patches: configure: Insist on a Python 2, not Python 3 bsd-user: fix compile failure ps2: avoid repeated header file includes make: Always set LC_ALL=C for makeinfo configure: Fix wrong preprocessor statement configure: Remove useless uses of ARCH_CFLAGS
| * configure: Insist on a Python 2, not Python 3Peter Maydell2012-04-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our Python scripts require Python 2 and will fail on Python 3, eg: File "/home/petmay01/linaro/qemu-from-laptop/qemu/scripts/qapi-commands.py", line 378 except getopt.GetoptError, err: ^ SyntaxError: invalid syntax Add a check to configure that Python is not a Python 3, so we can fail with a comprehensible error rather than an obscure one. Reported-by: Boris Matti <swiftos@lavabit.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * bsd-user: fix compile failurePeter Maydell2012-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bsd-user doesn't actually support reserving a memory area for the guest address space, but we need to at least define the reserved_va global so that cpu-all.h's RESERVED_VA macro will work correctly. This fixes a compilation error introduced in commit 39879bb which added a use of RESERVED_VA to h2g_valid(). Reported-by: Brad Smith <brad@comstyle.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * ps2: avoid repeated header file includesWanpeng Li2012-04-121-0/+29
| | | | | | | | | | Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * make: Always set LC_ALL=C for makeinfoStefan Weil2012-04-121-1/+1
| | | | | | | | | | | | | | | | Otherwise the generated file qemu-doc.html will contain "Anhang" instead of "Appendix" with a German locale (de_DE.UTF-8). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * configure: Fix wrong preprocessor statementStefan Weil2012-04-121-1/+1
| | | | | | | | | | | | | | | | #abort is not a preprocessor statement. It aborts, but the preprocessor statement #error is more common to abort a compilation. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * configure: Remove useless uses of ARCH_CFLAGSPeter Maydell2012-04-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some useless uses of ARCH_CFLAGS -- this variable was never set so will always be empty. The uses were accidental: in commit 0c439cbf8 Juan Quintela removed ARCH_CFLAGS in favour of CFLAGS (which in turn became QEMU_CFLAGS). However in commit be17dc90 a use of it was reintroduced (apparently accidentally) by Michael S. Tsirkin, and then I subsequently cut-n-pasted that into a number of other configure feature tests. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2012-04-1310-30/+171
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qemu-kvm/uq/master: kvmclock: guest stop notification kvm: update linux headers kvm: set gsi_bits and max_gsi correctly kvm: Drop unused kvm_pit_in_kernel kvm: allow arbitrarily sized mmio ioeventfd kvm: Drop redundant kvm_enabled from cpu_thread_is_idle kvm: add flightrecorder script
| * | kvmclock: guest stop notificationEric B Munson2012-04-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Often when a guest is stopped from the qemu console, it will report spurious soft lockup warnings on resume. There are kernel patches being discussed that will give the host the ability to tell the guest that it is being stopped and should ignore the soft lockup warning that generates. This patch uses the qemu Notifier system to tell the guest it is about to be stopped. Signed-off-by: Eric B Munson <emunson@mgebm.net> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | kvm: update linux headersMarcelo Tosatti2012-04-133-0/+12
| | | | | | | | | | | | Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | kvm: set gsi_bits and max_gsi correctlyJason Baron2012-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current kvm_init_irq_routing() doesn't set up the used_gsi_bitmap correctly, and as a consequence pins max_gsi to 32 when it really should be 1024. I ran into this limitation while testing pci passthrough, where I consistently got an -ENOSPC return from kvm_get_irq_route_gsi() called from assigned_dev_update_msix_mmio(). Signed-off-by: Jason Baron <jbaron@redhat.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | kvm: Drop unused kvm_pit_in_kernelJan Kiszka2012-04-133-14/+0Star
| | | | | | | | | | | | | | | | | | | | | This is now implied by kvm_irqchip_in_kernel. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | kvm: allow arbitrarily sized mmio ioeventfdMichael S. Tsirkin2012-04-134-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | We use a 2 byte ioeventfd for virtio memory, add support for this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | kvm: Drop redundant kvm_enabled from cpu_thread_is_idleJan Kiszka2012-04-131-2/+1Star
| | | | | | | | | | | | | | | | | | | | | This is now implied by kvm_irqchip_in_kernel. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | kvm: add flightrecorder scriptStefan Hajnoczi2012-04-131-0/+126
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kvm kernel module includes a number of trace events which can be useful when debugging system behavior. Even on production systems these trace events can be used to observe guest behavior and identify the source of problems. The kvm_flightrecorder script is a command-line wrapper for the /sys/kernel/debug/tracing interface. Kernel symbols do not need to be installed. This script captures a fixed-size buffer of KVM trace events. Recent events overwrite the oldest events when the buffer size is exceeded and it is possible to leave KVM tracing enabled for any period of time with just a fixed-size buffer. If the buffer is large enough this script is a useful tool for collecting detailed information after an issue occurs with a guest. Hence the name "flight recorder". The script can also be used in 'tail' mode to simply view KVM trace events as they occur. This is handy for development and to ensure that the guest is indeed running. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Merge remote-tracking branch 'afaerber/qom-cpu-lm32.v3' into stagingAnthony Liguori2012-04-135-13/+158
|\ \ | |/ |/| | | | | | | | | * afaerber/qom-cpu-lm32.v3: target-lm32: QOM'ify CPU reset target-lm32: QOM'ify CPU init target-lm32: QOM'ify CPU
| * target-lm32: QOM'ify CPU resetAndreas Färber2012-04-122-10/+10
| | | | | | | | | | | | | | Move code from cpu_state_reset() into QOM lm32_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc>
| * target-lm32: QOM'ify CPU initAndreas Färber2012-04-122-3/+13
| | | | | | | | | | | | | | | | Move code from cpu_lm32_init() to an initfn; call cpu_reset() instead of cpu_state_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc>
| * target-lm32: QOM'ify CPUAndreas Färber2012-04-125-1/+136
| | | | | | | | | | | | | | | | Embed CPULM32State as first member of QOM LM32CPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Michael Walle <michael@walle.cc>
* | target-microblaze: added PetaLogix copyrightPeter A. G. Crosthwaite2012-04-124-0/+4
| | | | | | | | | | | | | | | | Microblaze cpu development has been driven and funded by PetaLogix. Added (c) PetaLogix line accordingly. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* | rtl8139: do not assume TxStatus[] and TxAddr[] are adjacentStefan Hajnoczi2012-04-111-11/+15
|/ | | | | | | | | | | | | | | | | | | Commit afe0a595356192d5f79703cf6462fcc112df007c ("rtl8139: support byte read to TxStatus registers") reused rtl8139_TxStatus_read() for reading TxAddr registers. It relies on the fact that TxStatus[] and TxAddr[] are adjacent. This causes a gcc warning because the compiler can detect that array access is out-of-bounds: hw/rtl8139.c:2501:27: error: array subscript is above array bounds [-Werror=array-bounds] This patch refactors the function so that we don't rely on out-of-bounds accesses. Cc: Jason Wang <jasonwang@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* target-i386: QOM'ify CPU resetAndreas Färber2012-04-102-71/+72
| | | | | | | Move code from cpu_state_reset() into QOM x86_cpu_reset(), fixing style issues for FPU init. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: QOM'ify CPU initAndreas Färber2012-04-102-18/+27
| | | | | | | Move code from cpu_x86_init() to new QOM x86_cpu_initfn(). Also move mce_init() to cpu.c since it's used nowhere else. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: QOM'ify CPUAndreas Färber2012-04-104-8/+118
| | | | | | | | | | Embed CPUX86State as first member of X86CPU. Distinguish between "x86_64-cpu" and "i386-cpu". Drop cpu_x86_close() in favor of calling object_delete() directly. For now let CPUClass::reset() call cpu_state_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Rename cpuid.cAndreas Färber2012-04-102-1/+1
| | | | | | Name it cpu.c to align with other QOM'ified targets. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Merge commit 'ff71f2e8cacefae99179993204172bc65e4303df' into stagingAnthony Liguori2012-04-1019-150/+1078
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ff71f2e8cacefae99179993204172bc65e4303df': (21 commits) rtl8139: do the network/host communication only in normal operating mode rtl8139: correctly check the opmode net: move compute_mcast_idx() to net.h rtl8139: support byte read to TxStatus registers rtl8139: remove unused marco rtl8139: limit transmission buffer size in c+ mode pci_regs: Add PCI_EXP_TYPE_PCIE_BRIDGE virtio-net: add DATA_VALID flag pci_bridge: upper 32 bit are long registers pci: fix bridge IO/BASE pcie: drop functionality moved to core pci: set memory type for memory behind the bridge pci: add standard bridge device slotid: add slot id capability shpc: standard hot plug controller pci_bridge: user-friendly default bus name pci: make another unused extern function static pci: don't export an internal function pci_regs: Fix value of PCI_EXP_TYPE_RC_EC. pci: Do not check if a bus exist in pci_parse_devaddr. ...
| * rtl8139: do the network/host communication only in normal operating modeJason Wang2012-03-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According the spec, the card works in network/host communication mode only when both EEM1 and EEM0 are unset in 93C46 Command Register (normal op mode). So this patch check these bits before trying to receive packets. As some guest driver (such as linux, see cp_init_hw() in 8139cp.c) allocate rx ring after the recevier were enabled, this would cause our emulation codes tries to dma into guest memory when the rx descriptor is not properly configured. This patch fixes this. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * rtl8139: correctly check the opmodeJason Wang2012-03-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | According to the spec, only when opmode is "Config. Register Write Enable" could driver write to CONFIG0,1,3,4 and bits 13,12,8 of BMCR. Currently, we allow modifying to those registers also when 8139 is in "Auto-load" mode and "93C46 (93C56) Programming" mode. This patch fixes this. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * net: move compute_mcast_idx() to net.hJason Wang2012-03-166-98/+26Star
| | | | | | | | | | | | | | Reduce duplicated codes. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * rtl8139: support byte read to TxStatus registersJason Wang2012-03-161-4/+29
| | | | | | | | | | | | | | | | | | | | Some drivers (such as win7) use byte read for TxStatus registers, so we need to support this to let guest driver behave correctly. For writing, only double-word access is allowed by spec. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * rtl8139: remove unused marcoJason Wang2012-03-161-3/+0Star
| | | | | | | | | | Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * rtl8139: limit transmission buffer size in c+ modeJason Wang2012-03-161-6/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tx buffer would be re-allocated for tx descriptor with big size and without LS bit set, this would make guest driver could easily let qemu to allocate unlimited. In linux host, a glib failure were easy to be triggered: GLib-ERROR **: gmem.c:176: failed to allocate 18446744071562067968 bytes This patch fix this by adding a limit. As the spec didn't tell the maximum size of buffer allowed, stick it to current CP_TX_BUFFER_SIZE (65536). Changes from V1: Drop the while statement and s->cplus_txbuffer check. Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci_regs: Add PCI_EXP_TYPE_PCIE_BRIDGEAnthony PERARD2012-03-161-0/+1
| | | | | | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: add DATA_VALID flagMichael S. Tsirkin2012-03-151-0/+1
| | | | | | | | | | | | | | Add DATA_VALID flag from the Linux header, to keep us in sync with that. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci_bridge: upper 32 bit are long registersMichael S. Tsirkin2012-03-151-4/+4
| | | | | | | | | | | | Use pci_set_long for accesses. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: fix bridge IO/BASEMichael S. Tsirkin2012-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5caef97a16010f818ea8b950e2ee24ba876643ad introduced a regression: we do not make IO base/limit upper 16 bit registers writeable, so we should report a 16 bit IO range type, not a 32 bit one. Note that PCI_PREF_RANGE_TYPE_32 is 0x0, but PCI_IO_RANGE_TYPE_32 is 0x1. In particular, this broke sparc64. Note: this just reverts to behaviour prior to the commit above. Making PCI_IO_BASE_UPPER16 and PCI_IO_LIMIT_UPPER16 registers writeable should, and seems to, work just as well, but as no system seems to actually be interested in 32 bit IO, let's not make unnecessary changes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pcie: drop functionality moved to coreMichael S. Tsirkin2012-03-151-11/+1Star
| | | | | | | | | | | | | | Now that core sets memory type correctly, remove this code from pcie port implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: set memory type for memory behind the bridgeMichael S. Tsirkin2012-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Reported-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: add standard bridge deviceMichael S. Tsirkin2012-03-152-1/+175
| | | | | | | | | | | | | | | | | | | | | | This adds support for a standard pci to pci bridge, enabling support for more than 32 PCI devices in the system. Device hotplug is supported by means of SHPC controller. For guests with an SHPC driver, this allows robust hotplug and even hotplug of nested bridges, up to 31 devices per bridge. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * slotid: add slot id capabilityMichael S. Tsirkin2012-03-154-0/+58
| | | | | | | | | | | | | | | | | | | | | | This capability makes it possible for the guest to report a unique chassis identifier to the user. The spec also recommends making chassis indentifier persist in eeprom. This isn't implemented. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * shpc: standard hot plug controllerMichael S. Tsirkin2012-03-155-0/+737
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for SHPC interface, as defined by PCI Standard Hot-Plug Controller and Subsystem Specification, Rev 1.0 http://www.pcisig.com/specifications/conventional/pci_hot_plug/SHPC_10 Only SHPC intergrated with a PCI-to-PCI bridge is supported, SHPC integrated with a host bridge would need more work. All main SHPC features are supported: - MRL sensor - Attention button - Attention indicator - Power indicator Wake on hotplug and serr generation are stubbed out but unused as we don't have interfaces to generate these events ATM. One issue that isn't completely resolved is that qemu currently expects an "eject" interface, which SHPC does not provide: it merely removes the power to device and it's up to the user to remove the device from slot. This patch works around that by ejecting the device when power is removed and power LED goes off. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci_bridge: user-friendly default bus nameMichael S. Tsirkin2012-03-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a pci bridge device, if we don't override the name with custom code, the bus will be addressed as <id>.0, where id is the id specified by the user. Since PCI Bridge devices have a single bus each, we don't need the index: address the bus using the parent device name. This is better since this way users don't care about our internal bus/device distinctions. As far as I could see, we only have built-in bridges at this point which always override the name. So this change will only affect ioh3420.c. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: make another unused extern function staticMichael S. Tsirkin2012-03-152-8/+8
| | | | | | | | | | | | | | Make pci_find_bus static and rename to pci_find_bus_nr to match functionality. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: don't export an internal functionMichael S. Tsirkin2012-03-152-3/+1Star
| | | | | | | | | | | | | | Make an internal function, pci_parse_devaddr, static. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci_regs: Fix value of PCI_EXP_TYPE_RC_EC.Anthony PERARD2012-03-151-1/+1
| | | | | | | | | | | | | | Value check in PCI Express Base Specification rev 1.1 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>