Lines Matching +full:memory +full:- +full:region

2  * Physical memory management API
10 * the COPYING file in the top-level directory.
19 #include "exec/cpu-common.h"
35 #define MAX_PHYS_ADDR (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1)
37 #define TYPE_MEMORY_REGION "memory-region"
41 #define TYPE_IOMMU_MEMORY_REGION "iommu-memory-region"
46 #define TYPE_RAM_DISCARD_MANAGER "ram-discard-manager"
90 * @mr: the region, or %NULL if empty
91 * @fv: the flat view of the address space the region is mapped in
95 * relative to the region's address space
97 * @nonvolatile: this section is non-volatile
159 * should be able to take care of over-sized invalidations.
196 /* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
199 /* RAM is mmap-ed with MAP_SHARED */
216 /* RAM is a persistent kind memory */
222 * support 'write-tracking' migration type.
223 * Implies ram_state->ram_wt_enabled.
228 * RAM is mmap-ed with MAP_NORESERVE. When set, reserving swap space (or huge
230 * set, the OS will do the reservation, if supported for the memory type.
237 /* RAM is an mmap-ed named file */
240 /* RAM is mmap-ed read-only */
243 /* RAM FD is opened read-only */
254 n->notify = fn; in iommu_notifier_init()
255 n->notifier_flags = flags; in iommu_notifier_init()
256 n->start = start; in iommu_notifier_init()
257 n->end = end; in iommu_notifier_init()
258 n->iommu_idx = iommu_idx; in iommu_notifier_init()
262 * Memory region callbacks
265 /* Read from the memory region. @addr is relative to @mr; @size is
270 /* Write to the memory region. @addr is relative to @mr; @size is
289 /* Guest-visible constraints: */
341 * to handle requests to the memory region. Other methods are optional.
349 * to an output TLB entry. If the IOMMU is aware of memory transaction
363 * for secure transactions and one for non-secure transactions.
394 * @hwaddr: address to be translated within the memory region
418 * Optional method -- need not be provided if the IOMMU does not
428 * returns -EINVAL if the new flag bitmap is not supported by the
429 * IOMMU memory region. In case of failure, the error object
449 * Optional method -- an IOMMU only needs to provide this method
452 * Note: this is not related to record-and-replay functionality.
460 * can be used to allow users of the IOMMU to get implementation-specific
465 * memory_region_iommu_get_attr() will always return -EINVAL.
471 * @data: memory to fill in with the attribute data
474 * returns -EINVAL for unrecognized or unimplemented attribute types.
491 * @attrs: memory transaction attributes
519 * Notification that previously discarded memory is about to get populated.
525 * is aligned within the memory region to the minimum granularity
536 * Notification that previously populated memory was discarded successfully
537 * and listeners should drop all references to such memory and prevent
542 * is aligned within the memory region to the minimum granularity
564 rdl->notify_populate = populate_fn; in ram_discard_listener_init()
565 rdl->notify_discard = discard_fn; in ram_discard_listener_init()
566 rdl->double_discard_supported = double_discard_supported; in ram_discard_listener_init()
577 * after parts were discarded (freeing up memory) and before parts will be
578 * populated (consuming memory), to be used/accessed by the VM.
587 * memory inside a #MemoryRegion), and require proper coordination to only
589 * remain discarded from silently getting populated and consuming memory.
593 * An example #RamDiscardManager is virtio-mem, which logically (un)plugs
594 * memory within an assigned RAM #MemoryRegion, coordinated with the VM.
595 * Logically unplugging memory consists of discarding RAM. The VM agreed to not
596 * access unplugged (discarded) memory - especially via DMA. virtio-mem will
597 * properly coordinate with listeners before memory is plugged (populated),
598 * and after memory is unplugged (discarded).
602 * granularity within the #MemoryRegion. Listeners have to prepare for memory
738 * @mr_has_discard_manager: indicates memory is controlled by a
753 * A struct representing a memory region.
773 /* owner as TYPE_DEVICE. Used for re-entrancy checks in MR access hotpath */
800 /* For devices designed to perform re-entrant IO into their own IO MRs */
812 QLIST_FOREACH((n), &(mr)->iommu_notify, node)
819 * struct MemoryListener: callbacks structure for updates to the physical memory map
821 * Allows a component to adjust to changes in the guest-visible memory map.
891 * #MemoryListener.region_nop(), if dirty memory logging clients have
896 * @old: A bitmap of dirty memory logging clients that were active in
898 * @new: A bitmap of dirty memory logging clients that are active in
910 * #MemoryListener.log_start(), if dirty memory logging clients have
915 * @old: A bitmap of dirty memory logging clients that were active in
917 * @new: A bitmap of dirty memory logging clients that are active in
928 * copy of the dirty memory bitmap for a #MemoryRegionSection.
953 * Called before reading the dirty memory bitmap for a
965 * enables the %DIRTY_LOG_MIGRATION client on all memory regions in
981 * disables the %DIRTY_LOG_MIGRATION client on all memory regions in
991 * Called after reading the dirty memory bitmap
1062 * Govern the order in which memory listeners are invoked. Lower priorities
1072 * identify one memory listener with the rest.
1108 * Maximum DMA bounce buffer size used for indirect memory map requests.
1110 * DMA requests to indirect memory regions within this AddressSpace. DMA
1126 /* Flattened global view of current active memory hierarchy. Kept in sorted
1141 return qatomic_rcu_read(&as->current_map); in address_space_to_flatview()
1167 * A FlatView is made up of a list of non-overlapping ranges, each of
1177 return a->mr == b->mr && in MemoryRegionSection_eq()
1178 a->fv == b->fv && in MemoryRegionSection_eq()
1179 a->offset_within_region == b->offset_within_region && in MemoryRegionSection_eq()
1180 a->offset_within_address_space == b->offset_within_address_space && in MemoryRegionSection_eq()
1181 int128_eq(a->size, b->size) && in MemoryRegionSection_eq()
1182 a->readonly == b->readonly && in MemoryRegionSection_eq()
1183 a->nonvolatile == b->nonvolatile; in MemoryRegionSection_eq()
1187 * memory_region_section_new_copy: Copy a memory region section
1189 * Allocate memory for a new copy, copy the memory region section, and
1197 * memory_region_section_new_copy: Free a copied memory region section
1199 * Free a copy of a memory section created via memory_region_section_new_copy().
1207 * memory_region_init: Initialize a memory region
1209 * The region typically acts as a container for other memory regions. Use
1213 * @owner: the object that tracks the region's reference count
1215 * @size: size of the region; any subregions beyond this size will be clipped
1223 * memory_region_ref: Add 1 to a memory region's reference count
1225 * Whenever memory regions are accessed outside the BQL, they need to be
1226 * preserved against hot-unplug. MemoryRegions actually do not have their
1232 * the region could be returned at any time by memory_region_find, and this
1240 * memory_region_unref: Remove 1 to a memory region's reference count
1242 * Whenever memory regions are accessed outside the BQL, they need to be
1243 * preserved against hot-unplug. MemoryRegions actually do not have their
1252 * memory_region_init_io: Initialize an I/O memory region.
1254 * Accesses into the region will cause the callbacks in @ops to be called.
1258 * @owner: the object that tracks the region's reference count
1260 * I/O is performed on the region.
1263 * @size: size of the region.
1273 * memory_region_init_ram_nomigrate: Initialize RAM memory region. Accesses
1274 * into the region will modify memory
1278 * @owner: the object that tracks the region's reference count
1279 * @name: Region name, becomes part of RAMBlock name used in migration stream
1281 * @size: size of the region.
1285 * RAM memory region to be migrated; that is the responsibility of the caller.
1296 * memory_region_init_ram_flags_nomigrate: Initialize RAM memory region.
1297 * Accesses into the region will
1298 * modify memory directly.
1301 * @owner: the object that tracks the region's reference count
1302 * @name: Region name, becomes part of RAMBlock name used in migration stream
1304 * @size: size of the region.
1310 * RAM memory region to be migrated; that is the responsibility of the caller.
1322 * memory_region_init_resizeable_ram: Initialize memory region with resizable
1323 * RAM. Accesses into the region will
1324 * modify memory directly. Only an initial
1331 * @owner: the object that tracks the region's reference count
1332 * @name: Region name, becomes part of RAMBlock name used in migration stream
1334 * @size: used size of the region.
1335 * @max_size: max size of the region.
1340 * RAM memory region to be migrated; that is the responsibility of the caller.
1356 * memory_region_init_ram_from_file: Initialize RAM memory region with a
1357 * mmap-ed backend.
1360 * @owner: the object that tracks the region's reference count
1361 * @name: Region name, becomes part of RAMBlock name used in migration stream
1363 * @size: size of the region.
1364 * @align: alignment of the region base address; if 0, the default alignment
1374 * RAM memory region to be migrated; that is the responsibility of the caller.
1389 * memory_region_init_ram_from_fd: Initialize RAM memory region with a
1390 * mmap-ed backend.
1393 * @owner: the object that tracks the region's reference count
1394 * @name: the name of the region.
1395 * @size: size of the region.
1404 * RAM memory region to be migrated; that is the responsibility of the caller.
1419 * memory_region_init_ram_ptr: Initialize RAM memory region from a
1420 * user-provided pointer. Accesses into the
1421 * region will modify memory directly.
1424 * @owner: the object that tracks the region's reference count
1425 * @name: Region name, becomes part of RAMBlock name used in migration stream
1427 * @size: size of the region.
1428 * @ptr: memory to be mapped; must contain at least @size bytes.
1431 * RAM memory region to be migrated; that is the responsibility of the caller.
1440 * memory_region_init_ram_device_ptr: Initialize RAM device memory region from
1441 * a user-provided pointer.
1444 * MMIO BAR of an vfio-pci assigned device. The memory region may be mapped
1445 * into the VM address space and access to the region will modify memory
1446 * directly. However, the memory region should not be included in a memory
1452 * @owner: the object that tracks the region's reference count
1453 * @name: the name of the region.
1454 * @size: size of the region.
1455 * @ptr: memory to be mapped; must contain at least @size bytes.
1458 * RAM memory region to be migrated; that is the responsibility of the caller.
1459 * (For RAM device memory regions, migrating the contents rarely makes sense.)
1468 * memory_region_init_alias: Initialize a memory region that aliases all or a
1469 * part of another memory region.
1472 * @owner: the object that tracks the region's reference count
1474 * @orig: the region to be referenced; @mr will be equivalent to
1475 * @orig between @offset and @offset + @size - 1.
1477 * @size: size of the region.
1487 * memory_region_init_rom_nomigrate: Initialize a ROM memory region.
1490 * and then marking the resulting region read-only with
1494 * RAM side of the memory region to be migrated; that is the responsibility
1498 * @owner: the object that tracks the region's reference count
1499 * @name: Region name, becomes part of RAMBlock name used in migration stream
1501 * @size: size of the region.
1513 * memory_region_init_rom_device_nomigrate: Initialize a ROM memory region.
1517 * RAM side of the memory region to be migrated; that is the responsibility
1521 * @owner: the object that tracks the region's reference count
1524 * @name: Region name, becomes part of RAMBlock name used in migration stream
1526 * @size: size of the region.
1540 * memory_region_init_iommu: Initialize a memory region of a custom type
1543 * An IOMMU region translates addresses and forwards accesses to a target
1544 * memory region.
1547 * @_iommu_mr should be a pointer to enough memory for an instance of
1551 * accesses to the memory region. See the documentation of
1557 * @owner: the object that tracks the region's reference count
1559 * @size: size of the region.
1569 * memory_region_init_ram - Initialize RAM memory region. Accesses into the
1570 * region will modify memory directly.
1573 * @owner: the object that tracks the region's reference count (must be
1575 * @name: name of the memory region
1576 * @size: size of the region in bytes
1588 * If you pass a non-NULL non-device @owner then we will assert.
1605 * memory_region_init_rom: Initialize a ROM memory region.
1608 * and then marking the resulting region read-only with
1616 * If you pass a non-NULL non-device @owner then we will assert.
1619 * @owner: the object that tracks the region's reference count
1620 * @name: Region name, becomes part of RAMBlock name used in migration stream
1622 * @size: size of the region.
1634 * memory_region_init_rom_device: Initialize a ROM memory region.
1637 * This function initializes a memory region backed by RAM for reads
1647 * If you pass a non-NULL non-device @owner then we will assert.
1650 * @owner: the object that tracks the region's reference count
1653 * @name: Region name, becomes part of RAMBlock name used in migration stream
1655 * @size: size of the region.
1670 * memory_region_owner: get a memory region's owner.
1672 * @mr: the memory region being queried.
1677 * memory_region_size: get a memory region's size.
1679 * @mr: the memory region being queried.
1684 * memory_region_is_ram: check whether a memory region is random access
1686 * Returns %true if a memory region is random access.
1688 * @mr: the memory region being queried
1692 return mr->ram; in memory_region_is_ram()
1696 * memory_region_is_ram_device: check whether a memory region is a ram device
1698 * Returns %true if a memory region is a device backed ram region
1700 * @mr: the memory region being queried
1705 * memory_region_is_romd: check whether a memory region is in ROMD mode
1707 * Returns %true if a memory region is a ROM device and currently set to allow
1710 * @mr: the memory region being queried
1714 return mr->rom_device && mr->romd_mode; in memory_region_is_romd()
1718 * memory_region_is_protected: check whether a memory region is protected
1720 * Returns %true if a memory region is protected RAM and cannot be accessed
1723 * @mr: the memory region being queried
1728 * memory_region_has_guest_memfd: check whether a memory region has guest_memfd
1731 * Returns %true if a memory region's ram_block has valid guest_memfd assigned.
1733 * @mr: the memory region being queried
1738 * memory_region_get_iommu: check whether a memory region is an iommu
1740 * Returns pointer to IOMMUMemoryRegion if a memory region is an iommu,
1743 * @mr: the memory region being queried
1747 if (mr->alias) { in memory_region_get_iommu()
1748 return memory_region_get_iommu(mr->alias); in memory_region_get_iommu()
1750 if (mr->is_iommu) { in memory_region_get_iommu()
1757 * memory_region_get_iommu_class_nocheck: returns iommu memory region class
1760 * Returns pointer to IOMMUMemoryRegionClass if a memory region is an iommu,
1763 * @iommu_mr: the memory region being queried
1768 return (IOMMUMemoryRegionClass *) (((Object *)iommu_mr)->class); in memory_region_get_iommu_class_nocheck()
1779 * @iommu_mr: the memory region being queried
1786 * Note: for any IOMMU implementation, an in-place mapping change
1789 * @iommu_mr: the memory region that was changed
1829 * -EINVAL indicates that at least one of the attributes of the notifier
1830 * is not supported (flag/range) by the IOMMU memory region. In case of error
1833 * @mr: the memory region to observe
1845 * mr->iommu_ops->get_page_size().
1847 * Note: this is not related to record-and-replay functionality.
1849 * @iommu_mr: the memory region to observe
1858 * @mr: the memory region which was observed and for which notify_stopped()
1870 * -EINVAL indicates that the IOMMU does not support the requested
1873 * @iommu_mr: the memory region
1883 * use for translations with the given memory transaction attributes.
1885 * @iommu_mr: the memory region
1886 * @attrs: the memory transaction attributes
1895 * @iommu_mr: the memory region
1900 * memory_region_name: get a memory region's name
1902 * Returns the string that was used to initialize the memory region.
1904 * @mr: the memory region being queried
1909 * memory_region_is_logging: return whether a memory region is logging writes
1911 * Returns %true if the memory region is logging writes for the given client
1913 * @mr: the memory region being queried
1920 * memory region is logging writes.
1925 * @mr: the memory region being queried
1930 * memory_region_is_rom: check whether a memory region is ROM
1932 * Returns %true if a memory region is read-only memory.
1934 * @mr: the memory region being queried
1938 return mr->ram && mr->readonly; in memory_region_is_rom()
1942 * memory_region_is_nonvolatile: check whether a memory region is non-volatile
1944 * Returns %true is a memory region is non-volatile memory.
1946 * @mr: the memory region being queried
1950 return mr->nonvolatile; in memory_region_is_nonvolatile()
1954 * memory_region_get_fd: Get a file descriptor backing a RAM memory region.
1956 * Returns a file descriptor backing a file-based RAM memory region,
1957 * or -1 if the region is not a file-based RAM memory region.
1959 * @mr: the RAM or alias memory region being queried.
1964 * memory_region_from_host: Convert a pointer into a RAM memory region
1967 * Given a host pointer inside a RAM memory region (created with
1974 * protecting the pointer, such as a reference to the region that includes
1978 * @offset: the offset within memory region
1983 * memory_region_get_ram_ptr: Get a pointer into a RAM memory region.
1985 * Returns a host pointer to a RAM memory region (created with
1991 * protecting the pointer, such as a reference to the region that includes
1994 * @mr: the memory region being queried.
1998 /* memory_region_ram_resize: Resize a RAM region.
2001 * Care has to be taken if the guest might have already detected the memory.
2003 * @mr: a memory region created with @memory_region_init_resizeable_ram.
2004 * @newsize: the new size the region
2012 * a memory mapped region
2014 * @mr: the memory region to be msync
2024 * @mr: the memory region to be updated
2031 * memory_region_set_log: Turn dirty logging on or off for a region.
2036 * @mr: the memory region being updated.
2043 * memory_region_set_dirty: Mark a range of bytes as dirty in a memory region.
2048 * @mr: the memory region being dirtied.
2049 * @addr: the address (relative to the start of the region) being dirtied.
2056 * memory_region_clear_dirty_bitmap - clear dirty bitmap for memory range
2059 * dirty bitmap of a memory range within the memory region. This can
2064 * @mr: the memory region to clear the dirty log upon
2065 * @start: start address offset within the memory region
2066 * @len: length of the memory region to clear dirty bitmap
2081 * The dirty bitmap region which gets copied into the snapshot (and
2093 * @mr: the memory region being queried.
2094 * @addr: the address (relative to the start of the region) being queried.
2107 * @mr: the memory region being queried.
2109 * @addr: the address (relative to the start of the region) being queried.
2122 * @mr: the region being updated.
2133 * TBs (for self-modifying code).
2135 * The MemoryRegionOps->write() callback of a ROM device must use this function
2137 * accessing the memory returned by memory_region_get_ram_ptr().
2140 * detect self-modifying code.
2142 * @mr: the region being flushed.
2143 * @addr: the start, relative to the start of the region, of the range being
2150 * memory_region_set_readonly: Turn a memory region read-only (or read-write)
2152 * Allows a memory region to be marked as read-only (turning it into a ROM).
2155 * @mr: the region being updated.
2156 * @readonly: whether rhe region is to be ROM or RAM.
2161 * memory_region_set_nonvolatile: Turn a memory region non-volatile
2163 * Allows a memory region to be marked as non-volatile.
2166 * @mr: the region being updated.
2167 * @nonvolatile: whether rhe region is to be non-volatile.
2176 * device is mapped to guest memory and satisfies read access directly.
2180 * @mr: the memory region to be updated
2181 * @romd_mode: %true to put the region into ROMD mode
2186 * memory_region_set_coalescing: Enable memory coalescing for the region.
2188 * Enabled writes to a region to be queued for later processing. MMIO ->write
2189 * callbacks may be delayed until a non-coalesced MMIO is issued.
2190 * Only useful for IO regions. Roughly similar to write-combining hardware.
2192 * @mr: the memory region to be write coalesced
2197 * memory_region_add_coalescing: Enable memory coalescing for a sub-range of
2198 * a region.
2200 * Like memory_region_set_coalescing(), but works on a sub-range of a region.
2203 * @mr: the memory region to be updated.
2204 * @offset: the start of the range within the region to be coalesced.
2212 * memory_region_clear_coalescing: Disable MMIO coalescing for the region.
2215 * memory_region_add_coalescing(). Roughly equivalent to uncacheble memory
2218 * @mr: the memory region to be updated.
2223 * memory_region_set_flush_coalesced: Enforce memory coalescing flush before
2226 * Ensure that pending coalesced MMIO request are flushed before the memory
2227 * region is accessed. This property is automatically enabled for all regions
2230 * @mr: the memory region to be updated.
2235 * memory_region_clear_flush_coalesced: Disable memory coalescing flush before
2240 * memory regions that have MMIO coalescing enabled for themselves. For them,
2243 * @mr: the memory region to be updated.
2251 * Marks a word in an IO region (initialized with memory_region_init_io())
2256 * @mr: the memory region being updated.
2276 * @mr: the memory region being updated.
2294 * subregions (except for those explicitly marked as overlapping). A region
2297 * want a region to be a subregion in multiple locations.
2299 * @mr: the region to contain the new subregion; must be a container
2314 * A region may only be added once as a subregion (unless removed with
2316 * want a region to be a subregion in multiple locations.
2318 * @mr: the region to contain the new subregion; must be a container
2330 * memory_region_get_ram_addr: Get the ram address associated with a memory
2331 * region
2333 * @mr: the region to be queried
2344 * @subregion: the region being removed; must be a current subregion of @mr.
2350 * memory_region_set_enabled: dynamically enable or disable a region
2352 * Enables or disables a memory region. A disabled memory region
2354 * obscure sibling subregions with lower priority - it simply behaves as
2359 * @mr: the region to be updated
2360 * @enabled: whether to enable or disable the region
2365 * memory_region_set_address: dynamically update the address of a region
2367 * Dynamically updates the address of a region, relative to its container.
2368 * May be used on regions are currently part of a memory hierarchy.
2370 * @mr: the region to be updated
2371 * @addr: new address, relative to container region
2376 * memory_region_set_size: dynamically update the size of a region.
2378 * Dynamically updates the size of a region.
2380 * @mr: the region to be updated
2381 * @size: used size of the region.
2386 * memory_region_set_alias_offset: dynamically update a memory alias's offset
2388 * Dynamically updates the offset into the target region that an alias points
2392 * @offset: the new offset into the target memory region
2398 * memory_region_set_unmergeable: Set a memory region unmergeable
2400 * Mark a memory region unmergeable, resulting in the memory region (or
2401 * everything contained in a memory region container) not getting merged when
2402 * simplifying the address space and notifying memory listeners. Consequently,
2403 * memory listeners will never get notified about ranges that are larger than
2404 * the original memory regions.
2406 * This is primarily useful when multiple aliases to a RAM memory region are
2407 * mapped into a memory region container, and updates (e.g., enable/disable or
2408 * map/unmap) of individual memory region aliases are not supposed to affect
2409 * other memory regions in the same container.
2430 * into another memory region, which does not necessarily imply that it is
2441 * The #RamDiscardManager cannot change while a memory region is mapped.
2481 * - @size = 0 iff no overlap was found
2482 * - @mr is non-%NULL iff an overlap was found
2485 * relative to the returned region (in the .@mr field), not to the
2493 * - @offset_within_address_space >= @addr
2494 * - @offset_within_address_space + .@size <= @addr + @size
2504 * memory_global_dirty_log_sync: synchronize the dirty log for all memory
2513 * memory_global_dirty_log_sync: synchronize the dirty log for all memory
2517 * before dirty guest memory pages are read. If you are using
2538 * memory_listener_register: register callbacks to be called when memory
2543 * @filter: if non-%NULL, only regions in this address space will be observed
2582 * @addr: address within that region
2584 * @op: size, sign, and endianness of the memory operation
2585 * @attrs: memory transaction attributes to use for the access
2597 * @addr: address within that region
2599 * @op: size, sign, and endianness of the memory operation
2600 * @attrs: memory transaction attributes to use for the access
2622 * is destroyed, its root memory region (given by address_space_init()) may be destroyed
2643 * or failed (eg unassigned memory, device rejected the transaction,
2648 * @attrs: memory transaction attributes
2661 * or failed (eg unassigned memory, device rejected the transaction,
2666 * @attrs: memory transaction attributes
2678 * write data to both ROM and RAM. This is used for non-guest
2683 * a device will be silently ignored -- only real RAM and ROM will
2687 * or failed (eg unassigned memory, device rejected the transaction,
2692 * @attrs: memory transaction attributes
2710 * target-* code; devices should be CPU-agnostic and use either the LE
2716 * @attrs: memory transaction attributes
2753 * target-* code; devices should be CPU-agnostic and use either the LE
2759 * @attrs: memory transaction attributes
2773 assert(addr < cache->len); in address_space_ldub_cached()
2774 if (likely(cache->ptr)) { in address_space_ldub_cached()
2775 return ldub_p(cache->ptr + addr); in address_space_ldub_cached()
2784 assert(addr < cache->len); in address_space_stb_cached()
2785 if (likely(cache->ptr)) { in address_space_stb_cached()
2786 stb_p(cache->ptr + addr, val); in address_space_stb_cached()
2804 * memory region
2817 * read-modify-write operations. In this case, is_write should be %true.
2833 * Initializes #MemoryRegionCache structure without memory region attached.
2838 cache->mrs.mr = NULL; in address_space_cache_init_empty()
2840 cache->fv = NULL; in address_space_cache_init_empty()
2858 * @cache: The #MemoryRegionCache whose memory should be released.
2871 * to the returned region disappears after address_space_translate returns.
2875 * @xlat: pointer to address within the returned memory region section's
2879 * @attrs: memory attributes
2898 * Check whether memory is assigned to the given address space range, and
2909 * @attrs: memory attributes
2914 /* address_space_map: map a physical memory region into a host virtual address
2919 * Use only for reads OR writes - not for read-modify-write operations.
2927 * @attrs: memory attributes
2932 /* address_space_unmap: Unmaps a memory region previously mapped by address_space_map()
2934 * Will also mark the memory as dirty if @is_write == %true. @access_len gives
2935 * the amount of memory that was actually read or written by the caller.
2951 * such as when bounce buffer memory would exceed the limit. The callback can
2992 return memory_region_is_ram(mr) && !mr->readonly && in memory_access_is_direct()
2993 !mr->rom_device && !memory_region_is_ram_device(mr); in memory_access_is_direct()
3004 * or failed (eg unassigned memory, device rejected the transaction,
3009 * @attrs: memory transaction attributes
3031 ptr = qemu_map_ram_ptr(mr->ram_block, addr1); in address_space_read()
3045 * address_space_read_cached: read from a cached RAM region
3047 * @cache: Cached region to be addressed
3048 * @addr: address relative to the base of the RAM region
3056 assert(addr < cache->len && len <= cache->len - addr); in address_space_read_cached()
3057 fuzz_dma_read_cb(cache->xlat + addr, len, cache->mrs.mr); in address_space_read_cached()
3058 if (likely(cache->ptr)) { in address_space_read_cached()
3059 memcpy(buf, cache->ptr + addr, len); in address_space_read_cached()
3067 * address_space_write_cached: write to a cached RAM region
3069 * @cache: Cached region to be addressed
3070 * @addr: address relative to the base of the RAM region
3078 assert(addr < cache->len && len <= cache->len - addr); in address_space_write_cached()
3079 if (likely(cache->ptr)) { in address_space_write_cached()
3080 memcpy(cache->ptr + addr, buf, len); in address_space_write_cached()
3091 * or failed (eg unassigned memory, device rejected the transaction,
3096 * @c: constant byte to fill the memory
3098 * @attrs: memory transaction attributes
3111 /* Swap if non-host endianness or native (target) endianness */ in devend_memop()
3125 * to manage the actual amount of memory consumed by the VM (then, the memory
3126 * provided by RAM blocks might be bigger than the desired memory consumption).
3128 * - Discarding parts of a RAM blocks does not result in the change being
3130 * - All memory in RAM blocks is pinned or duplicated, invaldiating any previous
3132 * - Discarding parts of a RAM blocks will result in integrity issues (e.g.,
3141 * Returns 0 if successful. Returns -EBUSY if a technology that relies on
3155 * Returns 0 if successful. Returns -EBUSY if discards are already set to
3162 * uncoordinated discarding of pages in RAM blocks, allowing co-existence with
3169 * Test if any discarding of memory in ram blocks is disabled.
3174 * Test if any discarding of memory in ram blocks is required to work reliably.