History | View | Annotate | Download (37 kB)
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.
Signed-off-by: Avi Kivity <avi@redhat.com>
memory: fix subregion collision warning
Instead of the offset property use the proper addr property to calculatethe offsets.
Additionally, be a little more verbose on the warning and print thesubregion name.
Signed-off-by: Michael Walle <michael@walle.cc>...
Fix subtle integer overflow bug in memory API
It is quite common to have a MemoryRegion with size of INT64_MAX.When processing alias regions in render_memory_region() it's quiteeasy to find a case where it will construct a temporary AddrRange witha non-zero start, and size still of INT64_MAX. When means attempting...
memory: Fix memory_region_get_ram_ptr for ROM devices
Mask out the sub-page bits that are used by ROM device for storing theio-index and the IO_MEM_ROMD flag.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
memory: fix rom_device I/O mode
When adding a rom_device in I/O mode, we incorrectly masked off the lowbits, resulting in a pure RAM map. Fix my masking off the high bits andIO_MEM_ROMD, yielding a pure I/O map.
memory: add opaque parameter to memory_region_init_rom_device()
The MemoryRegionOps callbacks expect it.
memory: fix memory_region_init_rom_device() not initializing ->ops
memory: Fix old_portio vs non-zero offset
The legacy functions that we're wrapping expect that offsetto be included in the register. Indeed, they generallyexpect the absolute address and then mask off the "high" bits.
The FDC is the first converted device with a non-zero offset....
memory: temporarily suppress the subregion collision warning
After 312b4234, the APIC and PCI devices are colliding with each other. Thisis harmless in practice because the APIC accesses are special cased and nevermake there way onto the bus.
Avi is working on a proper fix, but until that's ready, avoid printing the...
memory: abstract cracking of write access ops into a function
The memory API automatically cracks large reads and writes into smallerones when needed. Factor out this mechanism, which is now duplicated betweenmemory reads and memory writes, into a function....
memory: crack wide ioport accesses into smaller ones when needed
The memory API supports cracking wide accesses into narrower oneswhen needed; but this was no implemented for the pio address space,causing lsi53c895a's IO BAR to malfunction.
Fix by correctly cracking wide accesses when needed....
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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: synchronize dirty bitmap before unmapping a range
When a range is being unmapped, ask accelerators (e.g. kvm) to synchronize thedirty bitmap to avoid losing information forever.
Fixes grub2 screen update.
Signed-off-by: Avi Kivity <avi@redhat.com>...
memory: use signed arithmetic
When trying to map an alias of a ram region, where the alias starts ataddress A and we map it into address B, and A > B, we had an arithmeticunderflow. Because we use unsigned arithmetic, the underflow convertedinto a large number which failed addrrange_intersects() tests....
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.
memory: separate building the final memory map into two steps
Instead of adding and deleting regions in one pass, do a deletepass followed by an add pass. This fixes the following case:
from: 0x0000-0x0fff ram (a1) 0x1000-0x1fff mmio (a2) 0x2000-0x2fff ram (a3)...
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.
memory: merge adjacent segments of a single memory region
Simple implementations of memory routers, for example the Cirrus VGA memory banksor the 440FX PAM registers can generate adjacent memory regions which are contiguous.Detect these and merge them; this saves kvm memory slots and shortens lookup times....
Internal interfaces for memory API
get_system_memory() provides the root of the memory hierarchy.
This interface is intended to be private between memory.c and exec.c.If this file is included elsewhere, it should be regarded as a bug (orTODO item). However, it will be temporarily needed for the conversion...
memory: abstract address space operations
Prepare for multiple address space support by abstracting away the detailsof registering a memory range with qemu's flat representation into anAddressSpace object.
Note operations which are memory specific are not abstracted, since they will...