History | View | Annotate | Download (26.1 kB)
memory: move functions is_romd and section_addr to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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...
memory: allow MemoryListeners to observe a specific address space
Ignore any regions not belonging to a specified address space.
Signed-off-by: Avi Kivity <avi@redhat.com>
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.
Signed-off-by: Avi Kivity <avi@redhat.com>Reviewed-by: Richard Henderson <rth@twiddle.net>
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: 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...
memory: change dirty getting API to take a size
Instead of each device knowing or guessing the guest page size,just pass the desired size of dirtied memory area.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
memory: change dirty setting APIs to take a size
Instead of each target knowing or guessing the guest page size,just pass the desired size of dirtied memory area.
memory: Introduce memory_region_init_reservation
Introduce a memory region type that can reserve I/O space. Such regionsare useful for modeling I/O that is only handled outside of QEMU, i.e.in the context of an accelerator like KVM.
Any access to such a region from QEMU is a bug, but could theoretically...
Spelling fixes in comments and documentation
Codespell detected these new spelling issues.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Remove IO_MEM_SUBPAGE
Replace with a MemoryRegion flag.
Drop IO_MEM_ROMD
Unlike ->readonly, ->readable is not inherited from aliase, so we can simplyquery the memory region.
memory: remove MemoryRegion::backend_registered
backend_registered was used to lazify the process of registering anmmio region, since the it is different for the I/O address space andthe memory address space. However, it also makes registration dependent...
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it forlive migration. This differs from other state (which is enumeratedin a VMStateDescription structure) and ties the live migration codeinto the memory core....
memory: introduce memory_region_name()
Trivial accessor for the name attribute.
memory: temporarily add memory_region_get_ram_addr()
This is a layering violation, but needed while the code containsnaked calls to qemu_get_ram_ptr() and the like.
memory: introduce memory_region_find()
Given an address space (represented by the top-level memory region),returns the memory region that maps a given range. Useful for implementingDMA.
The implementation is a simplistic binary search. Once we have a tree...
memory: replace cpu_physical_sync_dirty_bitmap() with a memory API
The function is still used as the implementation.
memory: add API for observing updates to the physical memory map
Add an API that allows a client to observe changes in the globalmemory map: - region added (possibly with logging enabled) - region removed (possibly with logging enabled) - logging started on a region...
memory: add memory_region_is_ram()
memory: add memory_region_is_rom()
memory: add memory_region_is_logging()
Merge remote-tracking branch 'qemu-kvm/memory/mutators' into staging
Conflicts: memory.h
memory: minor documentation fixes/enhancements
Fix typos and minor documentation errors in both memory.h anddocs/memory.txt.
Also add missing documentation formatting tags to transactionfunctions.
Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Ademar de Souza Reis Jr <areis@redhat.com>...
memory: introduce memory_region_set_alias_offset()
Add an API to update an alias offset of an active alias. This can beused to simplify implementation of dynamic memory banks.
memory: introduce memory_region_set_address()
Allow changing the address of a memory region while it isin the memory hierarchy.
memory: introduce memory_region_set_enabled()
This allows users to disable a memory region without removingit from the hierarchy, simplifying the implementation ofmemory routers.
memory: add MemoryRegionOps::valid.accepts
MemoryRegionOps::valid tries to declaratively specify which transactionsare accepted by the device/bus, however it is not completely generic. Adda callback for special cases.
memory: use 128-bit integers for sizes and intermediates
Since the memory API supports 64-bit buses, it needs a larger type to representintermediate results.
memory: simple memory tree printer
Add a monitor command 'info mtree' to show the memory hierarchymuch like /proc/iomem in Linux.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Avi Kivity <avi@redhat.com>
memory: implement memory_region_set_readonly()
The property is inheritable, but only if set to true. This is sothat memory routers can mark sections of RAM as read-only via aliases.
memory: add opaque parameter to memory_region_init_rom_device()
The MemoryRegionOps callbacks expect it.
memory: add API for creating ROM/device regions
ROM/device regions act as mapped RAM for reads, can I/O memory forwrites. This allow emulation of flash devices.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
memory: reclaim resources when a memory region is destroyed for good
memory: rename PORTIO_END to PORTIO_END_OF_LIST
For consistency with other _END_OF_LIST macros.
memory: rename MemoryRegion::has_ram_addr to ::terminates
I/O regions will not have ram_addrs, so this is a better name.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
memory: late initialization of ram_addr
For non-RAM memory regions, we cannot tell whether this is an I/O regionor an MMIO region. Since the qemu backing registration is different forthe two, we have to defer initialization until we know which address...
memory: I/O address space support
Allow registering I/O ports via the same mechanism as mmio ranges.
memory: add backward compatibility for old portio registration
memory: add backward compatibility for old mmio registration
This eases the transition to the new API.
memory: add ioeventfd support
As with the rest of the memory API, the caller associates an eventfdwith an address, and the memory API takes care of registering orunregistering when the address is made visible or invisible to theguest.
Signed-off-by: Avi Kivity <avi@redhat.com>...
memory: transaction API
Allow changes to the memory hierarchy to be accumulated andmade visible all at once. This reduces computational effort,especially when an accelerator (e.g. kvm) is involved.
Useful when a single register update causes multiple changes...
Hierarchical memory region API
The memory API separates the attributes of a memory region (its size, howreads or writes are handled, dirty logging, and coalescing) from where itis mapped and whether it is enabled. This allows a device to configurea memory region once, then hand it off to its parent bus to map it according...
memory: implement dirty tracking
Currently dirty tracking is implemented by passing throughall calls to the underlying cpu_physical_memory_*() calls.