summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-01-04hw/omap_gpmc: Fix region map/unmap when configuring prefetch enginePeter Maydell1-9/+21
When configuring the prefetch engine (and also when resetting from a state where the prefetch engine was enabled) be careful to adhere to the "unmap/change config fields/map" ordering, to avoid trying to delete the wrong MemoryRegions. This fixes an assertion failure in some cases. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Alexander Graf <agraf@suse.de> Tested-by: Alexander Graf <agraf@suse.de>
2012-01-04hw/omap1.c: Drop unused includesPeter Maydell1-4/+0
Drop includes of qemu-timer.h, qemu-char.h and pc.h as they are no longer needed. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/omap1.c: Separate dpll_ctl from omap_mpu_stateJuha Riihimäki2-15/+19
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio <riku.voipio@iki.fi> [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/omap1.c: Separate PWT from omap_mpu_stateJuha Riihimäki2-32/+35
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio <riku.voipio@iki.fi> [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04Remove IO_MEM_SHIFTAvi Kivity4-23/+17
We no longer use any of the lower bits of a ram_addr, so we might as well use them for the io table index. This increases the number of potential I/O handlers by a factor of 8. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Drop IO_MEM_ROMDAvi Kivity4-13/+16
Unlike ->readonly, ->readable is not inherited from aliase, so we can simply query the memory region. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Remove IO_MEM_SUBPAGEAvi Kivity4-6/+7
Replace with a MemoryRegion flag. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Direct dispatch through MemoryRegionAvi Kivity4-118/+53
Now that all mmio goes through MemoryRegions, we can convert io_mem_opaque to be a MemoryRegion pointer, and remove the thunks that convert from old-style CPU{Read,Write}MemoryFunc to MemoryRegionOps. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Convert io_mem_watch to be a MemoryRegionAvi Kivity1-47/+26
Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Convert IO_MEM_SUBPAGE_RAM to be a MemoryRegionAvi Kivity2-49/+24
Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Convert the subpage wrapper to be a MemoryRegionAvi Kivity1-52/+18
Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Switch cpu_register_physical_memory_log() to use MemoryRegionsAvi Kivity3-53/+37
Still internally using ram_addr. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Convert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegionsAvi Kivity4-146/+98
Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED, and IO_MEM_NOTDIRTY io handlers to MemoryRegions. These aren't real regions, since they are never added to the memory hierarchy, but they allow reuse of the dispatch functionality. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Uninline get_page_addr_code()Avi Kivity2-25/+27
Its use of IO_MEM_ROM and friends will later cause #include loops; and it is too large to merit inlining. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Avoid range comparisons on io index typesAvi Kivity4-21/+27
The code sometimes uses range comparisons on io indexes (e.g. index =< IO_MEM_ROM). Avoid these as they make moving to objects harder. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04Fix wrong region_offset when overlaying a page with anotherAvi Kivity1-0/+1
cpu_register_physical_memory_log() does not update region_offset if a page was previously registered for the same address. This could cause mmio accesses going to the wrong place, by using the old region_offset. Signed-off-by: Avi Kivity <avi@redhat.com> Acked-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04memory: remove MemoryRegion::backend_registeredAvi Kivity2-23/+4
backend_registered was used to lazify the process of registering an mmio region, since the it is different for the I/O address space and the memory address space. However, it also makes registration dependent on the region being visible in the address space. This is not the case for "fake" regions, like watchpoints or IO_MEM_UNASSIGNED. Remove backend_registered and always initialize the region. If it turns out to be part of the I/O address space, we've wasted an I/O slot, but that's not too bad. In any case this will be optimized later on. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04memory: move mmio access to functionsAvi Kivity4-39/+55
Currently mmio access goes directly to the io_mem_{read,write} arrays. In preparation for eliminating them, add indirection via a function. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04exec: make phys_page_find() return a temporaryAvi Kivity1-100/+48
Instead of returning a PhysPageDesc pointer, return a temporary. This lets us move away from actually storing PhysPageDesc's, and instead sythesising them when needed. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04memory: move endianness compensation to memory coreAvi Kivity3-140/+41
Instead of doing device endianness compensation in cpu_register_io_memory(), do it in the memory core. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-01-04memory: obsolete more dirty memory related functionsAvi Kivity2-49/+49
No longer used outside memory.c and exec.c. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04xen: convert framebuffer dirty tracking to memory APIAvi Kivity1-3/+2
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()Avi Kivity5-18/+7
The getter is no longer used, so it is completely removed. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Convert ram_load() to the memory APIAvi Kivity1-2/+2
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Remove support for version 3 ram_loadAvi Kivity1-14/+4
Version 3 ram_load depends on ram_addrs, which are not stable. Version 4 was introduced in 0.13 (and RHEL 6), so this means live migration from 0.12 and earlier to 1.1 or later will not work. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Sort RAMBlocks by ID for migration, not by ram_addrAvi Kivity1-6/+2
ram_addr is (a) unstable (b) going away. Sort by idstr instead. Commit b2e0a138e initially introduced the sorting for the purpose of improving debuggability. After this patch, the order is still stable, but perhaps less usable by a human. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Switch ram_save to the memory APIAvi Kivity1-20/+14
Avoid using ram_addr_t, instead use (MemoryRegion *, offset) pairs. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Store MemoryRegion in RAMBlockAvi Kivity2-0/+2
As a step in moving live migration from RAMBlocks to MemoryRegions, store the MemoryRegion in a RAMBlock. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity71-154/+286
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04memory: introduce memory_region_name()Avi Kivity2-0/+14
Trivial accessor for the name attribute. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04Fix parse of usb device description with multiple configurationsCao,Bing Bu1-8/+11
Changed From V1: Use DPRINTF instead of fprintf,because it is not an error. When testing ipod on QEMU by He Jie Xu<xuhj@linux.vnet.ibm.com>,qemu made a assertion. We found that the ipod with 2 configurations,and the usb-linux did not parse the descriptor correctly. The descr_len returned is the total length of the all configurations,not one configuration. The older version will through the other configurations instead of skip,continue parsing the descriptor of interfaces/endpoints in other configurations,then went wrong. This patch will put the configuration descriptor parse in loop outside and dispel the other configurations not requested. Signed-off-by: Cao,Bing Bu <mars@linux.vnet.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-04hw/omap1.c: Separate PWL from omap_mpu_stateJuha Riihimäki2-31/+37
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio <riku.voipio@iki.fi> [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/omap1.c: omap_mpuio_init() need not be publicPeter Maydell2-5/+1
omap_mpuio_init() is only used and defined in omap1.c, so make it static. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/pl110.c: Add post-load hook to invalidate displayPeter Maydell1-0/+11
Add a post-load hook which invalidates the display. In particular, if we don't do this and the display size we've just reloaded is larger than the default then we will segfault trying to read off the end of the buffer. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/pl181.c: Add save/load supportPeter Maydell1-9/+40
Add save/load support to the PL181. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-03Merge remote-tracking branch 'qemu-kvm/memory/page_desc' into stagingAnthony Liguori27-415/+703
* qemu-kvm/memory/page_desc: (22 commits) Remove cpu_get_physical_page_desc() sparc: avoid cpu_get_physical_page_desc() virtio-balloon: avoid cpu_get_physical_page_desc() vhost: avoid cpu_get_physical_page_desc() kvm: avoid cpu_get_physical_page_desc() memory: remove CPUPhysMemoryClient xen: convert to MemoryListener API memory: temporarily add memory_region_get_ram_addr() xen, vga: add API for registering the framebuffer vhost: convert to MemoryListener API kvm: convert to MemoryListener API kvm: switch kvm slots to use host virtual address instead of ram_addr_t memory: add API for observing updates to the physical memory map memory: replace cpu_physical_sync_dirty_bitmap() with a memory API framebuffer: drop use of cpu_physical_sync_dirty_bitmap() loader: remove calls to cpu_get_physical_page_desc() framebuffer: drop use of cpu_get_physical_page_desc() memory: introduce memory_region_find() memory: add memory_region_is_logging() memory: add memory_region_is_rom() ...
2012-01-03Remove cpu_get_physical_page_desc()Avi Kivity2-12/+0
No longer used. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03sparc: avoid cpu_get_physical_page_desc()Avi Kivity1-1/+4
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03virtio-balloon: avoid cpu_get_physical_page_desc()Avi Kivity1-4/+9
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03vhost: avoid cpu_get_physical_page_desc()Avi Kivity2-8/+41
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03kvm: avoid cpu_get_physical_page_desc()Avi Kivity1-17/+10
This reaches into the innards of the memory core, which are being changed. Switch to a memory API version. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03memory: remove CPUPhysMemoryClientAvi Kivity5-208/+5
No longer used. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03xen: convert to MemoryListener APIAvi Kivity2-59/+83
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03PPC: Add description for the Freescale e500mc core.Varun Sethi1-6/+50
This core is found on chips such as p4080, p3041, p2040, and p5020. More needs to be done to make this viable for TCG (such as missing SPRs and instructions), but this suffices to get KVM running with appropriate kernel support. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> [scottwood@freescale.com: tweak some flags] Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-03pseries: Check for duplicate addresses on the spapr-vio busMichael Ellerman1-0/+32
Check that devices on the spapr vio bus aren't given duplicate addresses. Currently we will not run with duplicate devices, the fdt code will spot it, but the error reporting is not great. With this patch we can report the error nicely in terms of the device names given by the user. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-03pseries: Populate "/chosen/linux,stdout-path" in the FDTDavid Gibson4-1/+40
There is a device tree property "/chosen/linux,stdout-path" which indicates which device should be used as stdout - ie. "the console". Currently we don't specify anything, which means both firmware and Linux choose something arbitrarily. Use the routine we added in the last patch to pick a default vty and specify it as stdout. Currently SLOF doesn't use the property, but we are hoping to update it to do so. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-03pseries: Add a routine to find a stable "default" vty and use itDavid Gibson1-9/+38
In vty_lookup() we have a special case for supporting early debug in the kernel. This accepts reg == 0 as a special case to mean "any vty". We implement this by searching the vtys on the bus and returning the first we find. This means that the vty we chose depends on the order the vtys are specified on the QEMU command line - because that determines the order of the vtys on the bus. We'd rather the command line order was irrelevant, so instead return the vty with the lowest reg value. This is still a guess as to what the user really means, but it is at least stable WRT command line ordering. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de> [agraf] fix braces
2012-01-03pseries: Emit device tree nodes in reg orderDavid Gibson1-5/+45
Although in theory the device tree has no inherent ordering, in practice the order of nodes in the device tree does effect the order that devices are detected by software. Currently the ordering is determined by the order the devices appear on the QEMU command line. Although that does give the user control over the ordering, it is fragile, especially when the user does not generate the command line manually - eg. when using libvirt etc. So order the device tree based on the reg value, ie. the address of on the VIO bus of the devices. This gives us a sane and stable ordering. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de> [agraf] add braces
2012-01-03pseries: FDT NUMA extensions to support multi-node guestsBharata B Rao2-11/+102
Add NUMA specific properties to guest's device tree to boot a multi-node guests. This patch adds the following properties: ibm,associativity ibm,architecture-vec-5 ibm,associativity-reference-points With this, it becomes possible to use -numa option on pseries targets. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-03pseries: Remove hcalls callbackDavid Gibson4-32/+8
For forgotten historical reasons, PAPR hypercalls for specific virtual IO devices (oh which there are quite a number) are registered via a callback in the VIOsPAPRDeviceInfo structure. This is kind of ugly, so this patch instead registers hypercalls from device_init() functions for each device type. This works just as well, and is cleaner. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>