summaryrefslogtreecommitdiff
path: root/hw/core
AgeCommit message (Collapse)AuthorFilesLines
2013-08-22aio / timers: Switch entire codebase to the new timer APIAlex Bligh1-9/+9
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-21loader: store FW CFG ROM files in RAMMichael S. Tsirkin1-3/+46
ROM files that are put in FW CFG are copied to guest ram, by BIOS, but they are not backed by RAM so they don't get migrated. Each time we change two bytes in such a ROM this breaks cross-version migration: since we can migrate after BIOS has read the first byte but before it has read the second one, getting an inconsistent state. Future-proof this by creating, for each such ROM, an MR serving as the backing store. This MR is never mapped into guest memory, but it's registered as RAM so it's migrated with the guest. Naturally, this only helps for -M 1.7 and up, older machine types will still have the cross-version migration bug. Luckily the race window for the problem to trigger is very small, which is also likely why we didn't notice the cross-version migration bug in testing yet. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2013-08-16qdev: Set globals in instance_post_init functionEduardo Habkost1-1/+10
This way, properties registered in the instance_init function of child classes will be handled properly by qdev_prop_set_globals(), too. Includes a unit test for the new functionality. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-08-07Bugfix for loading multiboot kernelsMartijn van den Broek1-4/+3
This patch fixes a bug in rom_copy introduced by commit d60fa42e8bae39440f997ebfe8fe328269a57d16. rom_copy failed to load roms with a "datasize" of 0. As a result, multiboot kernels were not loaded correctly when they contain a segment with a "file size" of 0. https://bugs.launchpad.net/qemu/+bug/1208944 Signed-off-by: Martijn van den Broek <martijn.vdbrk@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: CAG1x_oET1u3TMPu3r_zzd3ZXsTWQLiaM0zAc+RkHFCwvJjGOvg@mail.gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-31qdev: Use clz in print_sizeRichard Henderson1-7/+13
We can compute a floor log2 value with clz rather than a division loop. Signed-off-by: Richard Henderson <rth@twiddle.net> Message-id: 1375208443-17288-3-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-31qdev: Fix 32-bit compilation in print_sizeRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net> Message-id: 1375208443-17288-2-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29qdev: Add SIZE type to qdev propertiesVasilis Liaskovitis1-0/+55
This patch adds a 'SIZE' type property to qdev. Signed-off-by: Ian Molton <ian.molton@collabora.co.uk> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1375109277-25561-7-git-send-email-imammedo@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-29empty_slot: QOM cast cleanupAndreas Färber1-5/+9
Introduce type constant and use QOM casts. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-29hw: import bitmap operations in qdev-core headerMarcel Apfelbaum1-6/+7
Made small tweaks in code to prevent compilation issues when importing qemu/bitmap.h in qdev-core Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-22hw/loader: Support ramdisk with u-boot headerSoren Brinkmann1-25/+59
Introduce 'load_ramdisk()' which can load "normal" ramdisks and ramdisks with a u-boot header. To enable this and leverage synergies 'load_uimage()' is refactored to accomodate this additional use case. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1373323202-17083-2-git-send-email-soren.brinkmann@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-07-04hw/c*: pass owner to memory_region_init* functionsPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04memory: add ref/unref callsPaolo Bonzini1-0/+1
Add ref/unref calls at the following places: - places where memory regions are stashed by a listener and used outside the BQL (including in Xen or KVM). - memory_region_find callsites - creation of aliases and containers (only the aliased/contained region gets a reference to avoid loops) - around calls to del_subregion/add_subregion, where the region could disappear after the first call Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04memory: add owner argument to initialization functionsPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-06-20memory: make section size a 128-bit integerPaolo Bonzini1-1/+1
So far, the size of all regions passed to listeners could fit in 64 bits, because artificial regions (containers and aliases) are eliminated by the memory core, leaving only device regions which have reasonable sizes An IOMMU however cannot be eliminated by the memory core, and may have an artificial size, hence we may need 65 bits to represent its size. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-06-04Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori1-1/+1
pci: misc cleanups This includes some pci-related cleanups, and fw cfg cleanups which will be useful for on-going pci related work. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 02 Jun 2013 02:46:52 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (8) and Laszlo Ersek (1) # Via Michael S. Tsirkin * mst/tags/for_anthony: pvpanic: use FWCfgState explicitly fw_cfg: fw_cfg is a singleton fw_cfg: add API to find FW cfg object fw_cfg: move typedef to qemu/typedefs.h refer to FWCfgState explicitly apic: rename apic specific bitopts firmware_abi: move to include/hw/nvram/ dec.c - move to pci-bridge q35: set fw_name Message-id: 1370202787-3712-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-02refer to FWCfgState explicitlyLaszlo Ersek1-1/+1
Currently some places use pointer-to-void even though they mean pointer-to-FWCfgState. Clean them up. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-05-30qdev: fix get_fw_dev_path to support to add nothing to fw_dev_pathAmos Kong1-1/+9
Recent virtio refactoring in QEMU made virtio-bus become the parent bus of scsi-bus, and virtio-bus doesn't have get_fw_dev_path implementation, typename will be added to fw_dev_path by default, the new fw_dev_path could not be identified by seabios. It causes that bootindex parameter of scsi device doesn't work. This patch implements get_fw_dev_path() in BusClass, it will be called if bus doesn't implement the method, tyename will be added to fw_dev_path. If the implemented method returns NULL, nothing will be added to fw_dev_path. It also implements virtio_bus_get_fw_dev_path() to return NULL. Then QEMU will still pass original style of fw_dev_path to seabios. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1369814202-10346-1-git-send-email-akong@redhat.com -- v2: only add nothing to fw_dev_path when get_fw_dev_path() is implemented and returns NULL. then it will not effect other devices don't have get_fw_dev_path() implementation. v3: implement default get_fw_dev_path() in BusClass Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-06qdev: Introduce qdev_prop_set_globals_for_type()Andreas Färber1-11/+25
Reuse it in qdev_prop_set_globals(). Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> [AF: Renamed from qdev_prop_set_custom_globals()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-06qdev: Let qdev_prop_parse() pass through ErrorAndreas Färber2-15/+17
Move error reporting to callers. Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-03qdev: skip bus check for bus-less devices in qdev_unplug()Igor Mammedov1-1/+1
Since commit 2f7bd829db "qdev: Fix device_add bus assumptions" it's possible to device_add bus-less device, but if such device is unplugged it will dereference NULL parent_bus in qdev_unplug(). Fix it by taking in account that parent_bus might be NULL and skipping bus check. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-id: 1367587536-14964-1-git-send-email-imammedo@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-30qdev: Report errors collected during device realizationJan Kiszka1-0/+1
Better than just releasing the error object silently. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 517E68FC.6030400@siemens.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-20qdev: Drop taddr propertiesPeter Maydell2-79/+0
Drop all the infrastructure for taddr properties (ie ones which are 'hwaddr' sized). These are now unused, and any further desired use would be rather questionable since device properties shouldn't generally depend on a type that is conceptually variable based on the target CPU. 32 or 64 bit integer properties should be used instead as appropriate for the specific device. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-04-16Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2-4/+37
# By Igor Mammedov (8) and others # Via Andreas Färber * afaerber/qom-cpu: target-cris: Override do_interrupt for pre-v32 CPU cores qdev: Set device's parent before calling realize() down inheritance chain cpu: Pass CPUState to *cpu_synchronize_post*() target-i386: Split out CPU creation and features parsing target-i386/cpu.c: Coding style fixes ioapic: Replace FROM_SYSBUS() with QOM type cast kvmvapic: Replace FROM_SYSBUS() with QOM type cast target-i386: Split APIC creation from initialization in x86_cpu_realizefn() target-i386: Consolidate error propagation in x86_cpu_realizefn() qdev: Add qdev property for bool type target-i386: Improve -cpu ? features output target-i386: Fix including "host" in -cpu ? output
2013-04-16stream: Remove app argument hackPeter Crosthwaite1-2/+2
The uint32_t *app argument doesn't exist in real hardware. It was a hack in xilinx_axidma/enet to fake the (secondary) control stream connection. Removed the argument and added the second stream to axienet/dma. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-16stream: Add flow control APIPeter Crosthwaite1-2/+11
Add basic flow control to stream. A stream slave may return short, indicating that it is not capable of accepting any more data at the present time. Polling or a callback can be used via the can_push() function to determine when the slave can receive again. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-16qdev: Set device's parent before calling realize() down inheritance chainIgor Mammedov1-4/+4
Currently device_set_realized() sets parent only after device was realized, but qdev_device_add() sets it before device is realized. Make behavior consistent and alter device_set_realized() to behave like qdev_device_add(). It will allow to set link<> properties in realize() method in classes inherited from DEVICE. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-16qdev: Add qdev property for bool typeIgor Mammedov1-0/+33
Signed-off-by: Igor Mammedov <imammedo@redhat.com> [AF: Use new qdev_prop_set_after_realize()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-15Merge remote-tracking branch 'bonzini/hw-dirs' into stagingAnthony Liguori2-2/+2
* bonzini/hw-dirs: exec: remove useless declarations from memory-internal.h memory: move core typedefs to qemu/typedefs.h include: avoid useless includes of exec/ headers sysemu: avoid proliferation of include/ subdirectories tpm: reorganize headers and split hardware part configure: fix TPM logic acpi.h: make it self contained acpi: move declarations from pc.h to acpi.h hw: Add lost ARM core again Fix failure to create q35 machine Add linux-headers to QEMU_INCLUDES arm: fix location of some include files Conflicts: configure aliguori: trivial conflict in configure output Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15qdev: Fix QOM unrealize behaviorAndreas Färber1-7/+18
Since commit 249d41720b7dfbb5951b430b9eefdbee7464f515 (qdev: Prepare "realized" property) setting realized = true would register the device's VMStateDescription, but realized = false would not unregister it. Fix that. Moving the code from unparenting also revealed that we were calling DeviceClass::init through DeviceClass::realize as interim solution but DeviceClass::exit still at unparenting time with a realized check. Make this symmetrical by implementing DeviceClass::unrealize to call it, while we're setting realized = false in the unparenting path. The only other unrealize user is mac_nvram, which can safely override it. Thus, mark DeviceClass::exit as obsolete, new devices should implement DeviceClass::unrealize instead. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1366043650-9719-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-15sysemu: avoid proliferation of include/ subdirectoriesPaolo Bonzini2-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-08hw: move private headers to hw/ subdirectories.Paolo Bonzini2-1/+159
Many headers are used only in a single directory. These can be kept in hw/. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-08hw: move target-independent files to subdirectoriesPaolo Bonzini12-0/+4132
This patch tackles all files that are compiled once, moving them to subdirectories of hw/. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-08hw: make subdirectories for devicesPaolo Bonzini1-0/+0
Prepare the new directory structure. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>