kvm: fill in padding to help valgrind
valgrind warns about padding fields which are passedto vcpu ioctls uninitialized.This is not an error in practice because kvm ignored padding.Since the ioctls in question are off data path andthe cost is zero anyway, initialize padding to 0...
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kerneli8254 emulation of KVM.
The in-kernel model supports lost tick compensation according to the"delay" policy. This is enabled by default and can be switched off via a...
kvm: Add kvm_has_pit_state2 helper
To be used for in-kernel PIT emulation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
i8254: Open-code timer restore
Same as for the APIC: To enable migration between accelerated andnon-accelerated models, we need to arm the channel 0 timer only insidethe emulated PIT model. The common code just saves/restores that timerto the the next_transition_time field....
i8254: Factor out base class for KVM reuse
Applying the concept used for the *PICs once again: establish a baseclass for the i8254 that can be used both by the current user spaceemulation and the upcoming KVM in-kernel version. We share most of thepublic interface of the i8254, specifically to the pcspk, vmstate, reset...
cadence_uart: initial version of device model
Implemented cadence UART serial controller
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: John Linn <john.linn@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
cadence_ttc: initial version of device model
Implemented cadence Triple Timer Counter (TCC)
cadence_gem: initial version of device model
Device model for cadence gem ethernet controller.
xilinx_zynq: machine model initial version
Xilinx zynq-7000 machine model. Also includes device model for the zynq-specificsystem level control register (SLCR) module.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
petalogix_s2adsp1800: macro'd magic numbers
defined macros for the addresses of the peripherals in machine model
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
qemu-options.hx: allow -dtb argument for all archs
microblaze_boot: enabled -dtb argument
Use the -dtb argument for passing is a custom dtb rather than the oldhardcoded "mb.dtb"
microblaze: factored out common boot code
factored out the copy-pasted common boot code from the two microblaze platformsinto a dedicated microblaze bootloader (microblaze_boot.o).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
petalogix_s2adsp1800: moved rst logic to rst fn
This belongs in the machine specific reset function
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
s390: Rework kernel loading: supports elf and newer kernels
This reworks the image loading on s390.
Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.We must not rely on specific code at certain addresses. This check wasintroduced to warn users that tried to load vmlinux, since ELF loading...
Move helpers.h to helper.h
Provides a file naming scheme consistent with other targets.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Alexander Graf <agraf@suse.de>
memory: fix I/O port aliases
Commit e58ac72b6a0 ("ioport: change portio_list not to usememory_region_set_offset()") started using aliases of I/O memoryregions. Since the IORange used for the I/O was contained in thetarget region, the alias information (specifically, the offset...
ioport: add destructor method to IORange
Previously all callers had a containing object with a destructor thatcould be used to trigger cleanup of the IORange objects (typicallyjust freeing the containing object), but a forthcoming memory APIchange doesn't fit this pattern. Rather than setting up a new global...
w64: fix type casts when calling flush_icache_range
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cache-utils: Change data type of parameters for flush_icache_range
The TCG targets i386 and tci needed a change of the functionprototype for w64.
This change is currently not needed here, but it can be appliedto avoid code differences.
Cc: Alexander Graf <agraf@suse.de>...
w64: Change data type of parameters for flush_icache_range
This change is currently not needed for the other TCG targets,but it can be applied to avoid code differences.
Cc: Blue Swirl <blauwirbel@gmail.com>...
w64: Fix data type of parameters for flush_icache_range
flush_icache_range takes two address parameters which must be largeenough to address any address of the host.
For hosts with sizeof(unsigned long) == sizeof(void *), this patchchanges nothing. All currently supported hosts fall into this category....
tcg: Rearrange definitions and include statements
This change makes tcg_target_ulong available in tcg-target.h.
w64: Fix size of ram_addr_t
ram_addr_t must be large enough to address any address of the host.
For hosts with sizeof(unsigned long) == sizeof(void *), this patchchanges nothing. All currently supported hosts fall into this category.
For w64 hosts, sizeof(unsigned long) is 4 while sizeof(void *) is 8,...
Merge branch 'upstream' of git://qemu.weilnetz.de/qemu
usb: Fix signature of stub usb_host_device_open
This was a breakage of 3741715cf2.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa
hw/arm11mpcore: Fix broken realview_mpcore/arm11mpcore_priv properties
Fix confusion in the Property arrays for the "arm11mpcore_priv" (per-CPU devices for the ARM11MPcore CPU) and "realview_mpcore" (realview-eb board specific device encapsulating CPU and some...
arm: clean up GIC constants
Interrupts numbers 0-31 are private to the processor interface, 32-1019 aregeneral interrupts. Add GIC_INTERNAL and substitute everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>[Peter Maydell: converted some tabs to spaces]...
arm: make sure that number of irqs can be represented in GICD_TYPER.
We currently assume that the number of interrupts (ITLinesNumber inthe architecture reference manual) is divisible by 32, since wepresent it to the guest when it reads GICD_TYPER (in gic_dist_readb())...
arm: add device tree support
If compiled with CONFIG_FDT, allow user to specify a device tree file usingthe -dtb argument. If the machine supports it then the dtb will be loadedinto memory and passed to the kernel on boot.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>...
Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
kvm: fix unaligned slots
kvm_set_phys_mem() may be passed sections that are not aligned to a pageboundary. The current code simply brute-forces the alignment which leadsto an inconsistency and an abort().
Fix by aligning the start and the end of the section correctly, discarding...
pc-bios: update kvmvapic.bin
Signed-off-by: Avi Kivity <avi@redhat.com>
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'spice/spice.v49' into staging
Merge remote-tracking branch 'kraxel/usb.39' into staging
qemu-img: fix segment fault when the image format is qed
[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.imgimage: /home/zwu/work/misc/rh6.imgfile format: qedvirtual size: 4.0G (4294967296 bytes)disk size: 1.2Gcluster_size: 65536Segmentation fault (core dumped)...
qemu-io: fix segment fault when the image format is qed
[root@f15 qemu]# qemu-io -c info /home/zwu/work/misc/rh6.imgformat name: qedcluster size: 64 KiBvm state offset: 0.000000 bytesSegmentation fault (core dumped)
This reason is same as the former patch...
qemu-iotests: export TEST_DIR for non-bash tests
Since qemu-iotests may need to create large image files it is possibleto specify the test directory. The TEST_DIR variable needs to beexported so non-bash tests can make use of it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-iotests: add iotests Python module
Block layer tests that involve QMP commands rather than qemu-img orqemu-io are not well-suited for shell scripting. This patch adds aPython module which allows tests to be written in Python instead.
The basic API is:...
test: add image streaming tests
This patch adds a test suite for the image streaming feature. Itexercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed',and 'query-block-jobs' QMP commands.
qemu-iotests: Filter out DOS line endings
This one makes it possible to run qemu-iotests on a Windows build using Wineand get somewhat meaningful results.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qemu-iotests: 026: Reduce output changes for cache=none qcow2
qemu-iotests supports the -nocache option which makes the tests run withcache=none. For blkdebug tests with qcow2 this means that we may seetest results that differ from cache=writethrough. This patch makes the...
qemu-iotests: Test rebase with short backing file
This tests that qemu-img rebase doesn't assume that the backing file hasthe same size as the image, but considers that it can be smaller.
qemu-tool: revert cpu_get_clock() abort(3)
Despite the fact that the qemu-tool environment has no guest running andvm_clock therefore does not make sense, there is code that gets thevm_clock time even in qemu-tool. Therefore, revert the abort(3) calland just return 0 like we used to. This unbreaks qemu-img/qemu-io with...
QMP: Add qmp command for blockdev-group-snapshot-sync
This adds the QMP command for blockdev-group-snapshot-sync. Ittakes an array in as the input, for the argument devlist. Thearray consists of the following elements:
+ device: device to snapshot. e.g. "ide-hd0", "virtio0"...
qapi: Introduce blockdev-group-snapshot-sync command
This is a QAPI/QMP only command to take a snapshot of a group ofdevices. This is similar to the blockdev-snapshot-sync command, exceptblockdev-group-snapshot-sync accepts a list devices, filenames, and...
qcow2: Fix build with DEBUG_EXT enabled
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: remove unused fields in BlockDriverState
sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIOCompletion Blocks., 2006-08-07).
private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: drop aio_multiwrite in BlockDriver
These were never used.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Fix offset in qcow2_read_extensions
The spec says that the length of extensions is padded to 8 bytes, notthe offset. Currently this is the same because the header size is amultiple of 8, so this is only about compatibility with future changesto the header size....
qcow2: Reject too large header extensions
Image files that make qemu-img info read several gigabytes into theunknown header extensions list are bad. Just fail opening the imageif an extension claims to be larger than the header extension area.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
fdc: take side count into account
Floppies can be simple or double-sided. However, current codewas only taking the common case into account (ie 2 sides).
This repairs single-sided floppies, which where totally brokenbefore this patch : for track > 0, wrong sector number was...
fdc: set busy bit when starting a command
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: most control commands do not generate interrupts
In fact, only three control commands generate an interrupt:read_id, recalibrate and seek
fdc: handle read-only floppies (abort early on write commands)
A real floppy doesn't attempt to write to read-only media either.
fdc: add CCR (Configuration Control Register) write register
DIR and CCR registers share the same address ; DIR is read-onlywhile CCR is write-only
CCR register is used to change media transfer rate, which will bechecked in following changes.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
block: add a transfer rate for floppy types
Floppies must be read at a specific transfer rate, depending of its own format.Update floppy description table to include required transfer rate.
fdc: add a 'check media rate' property. Not used yet
Set it to true for current Qemu versions, and false for previous ones
fdc: check if media rate is correct before doing any transfer
The programmed rate has to be the same as the required rate for thefloppy format ; if that's not the case, the transfer should abort.This check can be disabled by using the 'check_media_rate' property....
fdc: fix seek command, which shouldn't check tracks
The seek command just sends step pulses to the drive and doesn't care ifthere is a medium inserted of if it is banging the head against the drive.
fdc: DIR (Digital Input Register) should return status of current drive...
ide: fail I/O to empty disk
Requesting a read or a write operation on an empty disk can leadto QEMU dumping core.
Also fix a few braces here and there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
memory: replace phys_page_find_alloc() with phys_page_set()
By giving the function the value we want to set, we make itmore flexible for the next patch.
memory: switch phys_page_set() to a recursive implementation
Setting multiple pages at once requires backtracking to previousnodes; easiest to achieve via recursion.
memory: change phys_page_set() to set multiple pages
memory: unify PhysPageEntry::node and ::leaf
They have the same type, unify them.
memory: allow phys_map tree paths to terminate early
When storing large contiguous ranges in phys_map, all values tend tobe the same pointers to a single MemoryRegionSection. Collapse themby marking nodes with level > 0 as leaves. This reduces tree memory...
memory: unify the two branches of cpu_register_physical_memory_log()
Identical except that the second branch knows its not modifying an existingsubpage.
memory: move tlb flush to MemoryListener commit callback
This way, if we have several changes in a single transaction, we flush justonce.
memory: make phys_page_find() return a MemoryRegionSection
We no longer describe memory in terms of individual pages; use sectionsthroughout instead.
PhysPageDesc no longer used - remove.
memory: give phys_page_find() its own tree search loop
We'll change phys_page_find_alloc() soon, but phys_page_find()doesn't need to bear the consequences.
memory: simplify multipage/subpage registration
Instead of considering subpage on a per-page basis, split each sectioninto a subpage head, multipage body, and subpage tail, and registereach separately. This simplifies the registration functions.
memory: change memory registration to rebuild the memory map on each change
Instead of incrementally building the memory map, rebuild it every time.This allows later simplification, since the code need not consider overlayinga previous mapping. It is also RCU friendly....
memory: remove first level of l1_phys_map
L1 and the lower levels in l1_phys_map are equivalent, except that L1 hasa different size, and is always allocated. Simplify the code by removingL1. This leaves us with a tree composed solely of L2 tables, but that...
memory: unify phys_map last level with intermediate levels
This lays the groundwork for storing leaf data in intermediate levels,saving space.
memory: store MemoryRegionSection pointers in phys_map
Instead of storing PhysPageDesc, store pointers to MemoryRegionSections.The various offsets (phys_offset & ~TARGET_PAGE_MASK,PHYS_OFFSET & TARGET_PAGE_MASK, region_offset) can all be synthesizedfrom the information in a MemoryRegionSection. Adjust phys_page_find()...
memory: compress phys_map node pointers to 16 bits
Use an expanding vector to store nodes. Allocation is baroque to g_renew()potentially invalidating pointers; this will be addressed later.
memory: fix RAM subpages in newly initialized pages
If the first subpage installed in a page is RAM, then we install it asa full page, instead of a subpage. Fix by not special casing RAM.
The issue dates to commit db7b5426a4b4242, which introduced subpages....
memory: don't pass ->readable attribute to cpu_register_physical_memory_log
It can be derived from the MemoryRegion itself (which is why it is notused there).
Signed-off-by: Avi Kivity <avi@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>
memory: use a MemoryListener for core memory map updates too
This transforms memory.c into a library which can then be unit testedeasily, by feeding it inputs and listening to its outputs.
memory: drop AddressSpaceOps
All functionality has been moved to various MemoryListeners.
memory: allow MemoryListeners to observe a specific address space
Ignore any regions not belonging to a specified address space.
xen: ignore I/O memory regions
memory: split memory listener for the two address spaces
The memory and I/O address spaces do different things, so split them intotwo memory listeners.
memory: support stateless memory listeners
Current memory listeners are incremental; that is, they are expected tomaintain their own state, and receive callbacks for changes to that state.
This patch adds support for stateless listeners; these work by receiving...
memory: remove memory_region_set_offset()
memory_region_set_offset() complicates the API, and has been deprecatedsince its introduction. Now that it is no longer used, remove it.
memory: add shorthand for invoking a callback on all listeners
memory: switch memory listeners to a QTAILQ
This allows reverse iteration, which in turns allows consistent orderingamong multiple listeners:
l1->add l2->add l2->del l1->del
memory: code motion: move MEMORY_LISTENER_CALL()
So it can be used in earlier code.
memory: move ioeventfd ops to MemoryListener
This way the accelerator (kvm) can handle them directly.
memory: add a readonly attribute to MemoryRegionSection
.readonly cannot be obtained from the MemoryRegion, since it isinherited from aliases (so you can have a MemoryRegion mapped RWat one address and RO at another). Record it in a MemoryRegionSection...
ioport: change portio_list not to use memory_region_set_offset()
memory_region_set_offset() will be going away soon, so don't use it.Use an alias instead.
target-xtensa: Clean includes
Remove some include statements which are not needed.
Acked-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>
Move definition of HOST_LONG_BITS to qemu-common.h
Like the related macro TCG_TARGET_LONG, HOST_LONG_BITS can be determinedby the C preprocessor. It is also not used in Makefiles.
So there is no need to calculate it in configure, and it can be definedin qemu-common.h....