summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2013-05-24Merge remote-tracking branch 'bonzini/iommu-for-anthony' into stagingAnthony Liguori4-29/+37
# By Paolo Bonzini (11) and others # Via Paolo Bonzini * bonzini/iommu-for-anthony: memory: clean up phys_page_find memory: populate FlatView for new address spaces memory: limit sections in the radix tree to the actual address space size s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62 memory: fix address space initialization/destruction memory: make memory_global_sync_dirty_bitmap take an AddressSpace memory: do not duplicate memory_region_destructor_none memory: Rename readable flag to romd_mode memory: Replace open-coded memory_region_is_romd memory: allow memory_region_find() to run on non-root memory regions memory: assert that PhysPageEntry's ptr does not overflow exec: eliminate stq_phys_notdirty exec: make qemu_get_ram_ptr private exec: eliminate qemu_put_ram_ptr exec: remove obsolete comment Message-id: 1369414987-8839-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-24memory: limit sections in the radix tree to the actual address space sizeAvi Kivity1-0/+3
The radix tree is statically sized to fit TARGET_PHYS_ADDR_SPACE_BITS. If a larger memory region is registered, it will overflow. Fix by limiting any section in the radix tree to the supported size. This problem was not observed earlier since 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. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Avi Kivity <avi.kivity@gmail.com> [ Fail the build if TARGET_PHYS_ADDR_SPACE_BITS is too large - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24memory: make memory_global_sync_dirty_bitmap take an AddressSpacePaolo Bonzini1-4/+3
Since this is a MemoryListener operation, it only makes sense on an AddressSpace granularity. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24memory: Rename readable flag to romd_modeJan Kiszka1-11/+11
"Readable" is a very unfortunate name for this flag because even a rom_device region will always be readable from the guest POV. What differs is the mapping, just like the comments had to explain already. Also, readable could currently be understood as being a generic region flag, but it only applies to rom_device regions. So rename the flag and the function to modify it after the original term "ROMD" which could also be interpreted as "ROM direct", i.e. ROM mode with direct access. In any case, the scope of the flag is clearer now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24memory: allow memory_region_find() to run on non-root memory regionsPaolo Bonzini1-9/+19
memory_region_find() is similar to registering a MemoryListener and checking for the MemoryRegionSections that come from a particular region. There is no reason for this to be limited to a root memory region. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24exec: eliminate stq_phys_notdirtyPaolo Bonzini2-2/+0
It is not used anywhere. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24exec: make qemu_get_ram_ptr privatePaolo Bonzini2-2/+1
It is a private interface between exec.c and memory.c. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24exec: eliminate qemu_put_ram_ptrPaolo Bonzini1-1/+0
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-24coroutine: stop using AioContext in CoQueueStefan Hajnoczi1-0/+4
qemu_co_queue_next(&queue) arranges that the next queued coroutine is run at a later point in time. This deferred restart is useful because the caller may not want to transfer control yet. This behavior was implemented using QEMUBH in the past, which meant that CoQueue (and hence CoMutex and CoRwlock) had a dependency on the AioContext event loop. This hidden dependency causes trouble when we move to a world with multiple event loops - now qemu_co_queue_next() needs to know which event loop to schedule the QEMUBH in. After pondering how to stash AioContext I realized the best solution is to not use AioContext at all. This patch implements the deferred restart behavior purely in terms of coroutines and no longer uses QEMUBH. Here is how it works: Each Coroutine has a wakeup queue that starts out empty. When qemu_co_queue_next() is called, the next coroutine is added to our wakeup queue. The wakeup queue is processed when we yield or terminate. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-22Merge remote-tracking branch 'mjt/trivial-patches' into stagingAnthony Liguori3-3/+0
# By Christophe Lyon (1) and others # Via Michael Tokarev * mjt/trivial-patches: target-moxie: replace target_phys_addr_t with hwaddr Rename hexdump to avoid FreeBSD libutil conflict remove some double-includes translate: remove redundantly included qemu/timer.h Remove twice include of qemu-common.h fix /proc/self/maps output Message-id: 51977B44.1000302@msgid.tls.msk.ru Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-22virtio-net: dynamic network offloads configurationDmitry Fleytman2-0/+17
Virtio-net driver currently negotiates network offloads on startup via features mechanism and have no ability to disable and re-enable offloads later. This patch introduced a new control command that allows to configure device network offloads state dynamically. The patch also introduces a new feature flag VIRTIO_NET_F_CTRL_GUEST_OFFLOADS. Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 20130520081814.GA8162@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-22ui/gtk.c: Fix *BSD build of Gtk+ UIBrad Smith1-0/+1
Fix the build of the Gtk+ UI on *BSD systems. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 20130521161324.GA29977@rox.home.comstyle.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20Rename hexdump to avoid FreeBSD libutil conflictEd Maste1-1/+1
On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's. Signed-off-by: Ed Maste <emaste@freebsd.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368718348-15199-1-git-send-email-emaste@freebsd.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-18Rename hexdump to avoid FreeBSD libutil conflictEd Maste1-1/+1
On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's. Signed-off-by: Ed Maste <emaste@freebsd.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-05-18remove some double-includesMichael Tokarev3-3/+0
Some source files #include the same header more than once for no good reason. Remove second #includes in such cases. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-05-15qemu-common: Resolve vector build breakes for AltiVecPaolo Bonzini1-2/+8
On Mac OS X ppc, altivec.h defines "vector", leading to build breakage when used as variable name, e.g. in tracing code. Fix this by undefining identifiers after altivec.h inclusion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Message-id: 1368632771-4328-1-git-send-email-andreas.faerber@web.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-15virtio-net: add virtio_net_set_netclient_name.KONRAD Frederic1-0/+4
This adds virtio_net_set_netclient_name, which is used to set the name and type shown in "info network" command. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Message-id: 1368619970-23892-2-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-14osdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memoryPaolo Bonzini1-0/+1
We switched from qemu_memalign to mmap() but then we don't modify qemu_vfree() to do a munmap() over free(). Which we cannot do because qemu_vfree() frees memory allocated by qemu_{mem,block}align. Introduce a new function that does the munmap(), luckily the size is available in the RAMBlock. Reported-by: Amos Kong <akong@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Message-id: 1368454796-14989-3-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-14osdep, kvm: rename low-level RAM allocation functionsPaolo Bonzini2-3/+3
This is preparatory to the introduction of a separate freeing API. Reported-by: Amos Kong <akong@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Message-id: 1368454796-14989-2-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-14portability: pty.h is glibc-specificPaolo Bonzini1-0/+12
This should fix building the GTK+ front-end on BSDs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368533121-30796-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-13qom: aggressively optimize qom castingAnthony Liguori1-0/+4
This patch adds a small typename cache to ObjectClass. This allows caching positive casts within each ObjectClass. Benchmarking a PPC workload provided by Aurelien, this patch eliminates every single g_hash_table_lookup() happening during the benchmark (which was about 2 million per-second). With this patch applied, I get exactly the same performance (within the margin of error) as with --disable-qom-cast-debug. N.B. it's safe to cache typenames only from the _assert() macros because they are always called with string literals. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-13Revert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"Paolo Bonzini1-5/+0
This reverts commit 9953f8822cc316eec9962f0a2858c3439a80adec. While Markus's analysis is entirely correct, there are 1.6 patches that fix the bug for real and without requiring machine type hacks. Let's think of the children who will have to read this code, and avoid a complicated mess of semantics that differ between <1.5, 1.5, and >1.5. Conflicts: hw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1368189483-7915-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-13qom: allow turning cast debugging offPaolo Bonzini1-5/+6
Cast debugging can have a substantial cost (20% or more). Instead of adding special-cased "fast casts" in the hot paths, we can just disable it in releases. The tracing facilities we just added make it easier to analyze those problems that cast debugging would reveal. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368188203-3407-7-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-13qom: pass file/line/function to asserting castsPaolo Bonzini1-5/+11
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368188203-3407-5-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-13qom: improve documentation of cast functionsPaolo Bonzini1-2/+21
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368188203-3407-2-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-12osdep.h: include sys/types.h for ssize_t definitionIgor Mitsyanko1-1/+1
sys/types.h is taken out from "ifdef __OpenBSD__" guard. It should be safe for other systems, according to following survey: http://hacks.owlfolio.org/header-survey/ This fixes build for CONFIG_IOVEC-less systems (mingw). Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-05-06target-i386: Change CPUID model of 486 to 8Andreas Färber1-0/+4
This changes the model number of 486 to 8 (DX4) which matches the feature set presented, and actually has the CPUID instruction. This adds a compatibility property, to keep model=0 on pc-*-1.4 and older. Signed-off-by: H. Peter Anvin <hpa@zytor.com> [AF: Add compat_props entry] Tested-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-06qdev: Introduce qdev_prop_set_globals_for_type()Andreas Färber1-0/+2
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ärber1-2/+3
Move error reporting to callers. Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-03virtio-scsi: fix the command line compatibility.KONRAD Frederic1-1/+0
The bus name is wrong since the refactoring. This keeps the behaviour of the command line. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1367330931-12994-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-03scsi: add bus_name parameter to scsi_bus_new.KONRAD Frederic1-1/+2
This adds the possibility to create a scsi-bus with a specified name. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1367330931-12994-4-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-03virtio: add virtio_device_set_child_bus_name.KONRAD Frederic1-0/+4
Add virtio_device_set_child_bus_name function. It will be used with virtio-serial-x and virtio-scsi-x to set the child bus name before calling virtio-x-device's init. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1367330931-12994-3-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-03nbd: support large NBD requestsStefan Hajnoczi1-1/+2
The Linux nbd driver recently increased the maximum supported request size up to 32 MB: commit 078be02b80359a541928c899c2631f39628f56df Author: Michal Belczyk <belczyk@bsd.krakow.pl> Date: Tue Apr 30 15:28:28 2013 -0700 nbd: increase default and max request sizes Raise the default max request size for nbd to 128KB (from 127KB) to get it 4KB aligned. This patch also allows the max request size to be increased (via /sys/block/nbd<x>/queue/max_sectors_kb) to 32MB. QEMU's 1 MB buffers are too small to handle these requests. This patch allocates data buffers dynamically and allows up to 32 MB per request. Reported-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-03qemu: add castagnoli crc32c checksum algorithmJeff Cody1-0/+35
This adds the Castagnoli CRC32C algorithm, using the 0x11EDC6F41 polynomial. This is extracted from the linux kernel cryptographic crc32.c module. The algorithm is based on: Castagnoli93: Guy Castagnoli and Stefan Braeuer and Martin Herrman "Optimization of Cyclic Redundancy-Check Codes with 24 and 32 Parity Bits", IEEE Transactions on Communication, Volume 41, Number 6, June 1993 Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-05-02Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori9-27/+183
# By Igor Mammedov (21) and others # Via Andreas Färber * afaerber/qom-cpu: (29 commits) Drop redundant resume_all_vcpus() from main() cpus: Fix pausing TCG CPUs while in vCPU thread target-i386: Replace cpuid_*features fields with a feature word array target-i386: Break CPUID feature definition lines target-i386/kvm.c: Code formatting changes target-i386: Group together level, xlevel, xlevel2 fields pc: Implement QEMUMachine::hot_add_cpu hook QMP: Add cpu-add command Add hot_add_cpu hook to QEMUMachine target-i386: Move APIC to ICC bus target-i386: Attach ICC bus to CPU on its creation target-i386: Introduce ICC bus/device/bridge cpu: Move cpu_write_elfXX_note() functions to CPUState kvmvapic: Make dependency on sysbus.h explicit target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE target-i386: Do not allow to set apic-id once CPU is realized target-i386: Introduce apic-id CPU property target-i386: Introduce feat2prop() for CPU properties acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest cpu: Add helper cpu_exists(), to check if CPU with specified id exists ...
2013-05-01Trivial grammar and spelling fixesStefan Weil2-4/+4
similiar -> similar recieve -> receive transfered -> transferred preperation -> preparation Most changes are in comments, one modifies a parameter name in a function prototype. The spelling fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-05-01pc: Implement QEMUMachine::hot_add_cpu hookIgor Mammedov1-0/+1
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01Add hot_add_cpu hook to QEMUMachineIgor Mammedov1-0/+3
Hook should be set by machines that implement CPU hot-add via cpu-add QMP command. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01target-i386: Move APIC to ICC busIgor Mammedov2-3/+6
It allows APIC to be hotplugged. * map APIC's mmio at board level if it is present * do not register mmio region for each APIC, since only one is used/mapped Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01target-i386: Attach ICC bus to CPU on its creationIgor Mammedov1-1/+1
X86CPU should have parent bus so it could provide bus for child APIC. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01target-i386: Introduce ICC bus/device/bridgeIgor Mammedov1-0/+79
Provides a hotpluggable bus for APIC and CPU. * icc-bridge will serve as a parent for icc-bus and provide mmio mapping services to child icc-devices. * icc-device will replace SysBusDevice as a parent of APIC and IOAPIC devices. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Move cpu_write_elfXX_note() functions to CPUStateJens Freimann2-9/+49
Convert cpu_write_elfXX_note() functions to CPUClass methods and pass CPUState as argument. Update target-i386 accordingly. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [AF: Retain stubs as CPUClass' default method implementation; style changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZEIgor Mammedov1-2/+0
Put APIC_SPACE_SIZE in a public header so that it can be reused elsewhere later. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Add helper cpu_exists(), to check if CPU with specified id existsIgor Mammedov1-0/+10
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Add qemu_for_each_cpu()Michael S. Tsirkin1-0/+9
Wrapper to avoid open-coded loops and to make CPUState iteration independent of CPUArchState. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Introduce get_arch_id() method and override it for X86CPUIgor Mammedov1-0/+2
get_arch_id() adds possibility for generic code to get a guest-visible CPU ID without accessing CPUArchState. If derived classes don't override it, it will return cpu_index. Override it on target-i386 in X86CPU to return the APIC ID. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01pc: Update rtc_cmos on CPU hot-plugIgor Mammedov1-0/+1
It provides updated currently available CPUs count to BIOS on reboot. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Introduce CPU hot-plug notifierIgor Mammedov1-0/+3
Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Introduce cpu_resume(), for single CPUIgor Mammedov1-0/+7
Also add a stub for it, to make possible to use it in qom/cpu.c, which is shared with user emulators. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()Igor Mammedov1-10/+10
If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>