Lines Matching +full:rcu +full:- +full:endian +full:- +full:offset
10 * the COPYING file in the top-level directory.
19 #include "exec/cpu-common.h"
30 #include "qemu/rcu.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"
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 */
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
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()
289 /* Guest-visible constraints: */
363 * for secure transactions and one for non-secure transactions.
387 * holding the big QEMU lock or is inside an RCU critical section;
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
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.
474 * returns -EINVAL for unrecognized or unimplemented attribute types.
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()
593 * An example #RamDiscardManager is virtio-mem, which logically (un)plugs
596 * access unplugged (discarded) memory - especially via DMA. virtio-mem will
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)
821 * Allows a component to adjust to changes in the guest-visible memory map.
1094 struct rcu_head rcu; member
1098 /* Accessed via RCU. */
1130 struct rcu_head rcu; member
1141 return qatomic_rcu_read(&as->current_map); in address_space_to_flatview()
1150 * @offset_in_region: offset of the first byte of the range within @mr
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()
1226 * preserved against hot-unplug. MemoryRegions actually do not have their
1243 * preserved against hot-unplug. MemoryRegions actually do not have their
1357 * mmap-ed backend.
1370 * @offset: offset within the file referenced by path
1385 ram_addr_t offset,
1390 * mmap-ed backend.
1400 * @offset: offset within the file referenced by fd
1414 ram_addr_t offset,
1420 * user-provided pointer. Accesses into the
1441 * a user-provided pointer.
1444 * MMIO BAR of an vfio-pci assigned device. The memory region may be mapped
1475 * @orig between @offset and @offset + @size - 1.
1476 * @offset: start of the section in @orig to be referenced.
1483 hwaddr offset,
1490 * and then marking the resulting region read-only with
1569 * memory_region_init_ram - Initialize RAM memory region. Accesses into the
1588 * If you pass a non-NULL non-device @owner then we will assert.
1608 * and then marking the resulting region read-only with
1616 * If you pass a non-NULL non-device @owner then we will assert.
1647 * If you pass a non-NULL non-device @owner then we will assert.
1692 return mr->ram; in memory_region_is_ram()
1714 return mr->rom_device && mr->romd_mode; in memory_region_is_romd()
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()
1768 return (IOMMUMemoryRegionClass *) (((Object *)iommu_mr)->class); in memory_region_get_iommu_class_nocheck()
1786 * Note: for any IOMMU implementation, an in-place mapping change
1829 * -EINVAL indicates that at least one of the attributes of the notifier
1845 * mr->iommu_ops->get_page_size().
1847 * Note: this is not related to record-and-replay functionality.
1870 * -EINVAL indicates that the IOMMU does not support the requested
1932 * Returns %true if a memory region is read-only memory.
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.
1950 return mr->nonvolatile; in memory_region_is_nonvolatile()
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.
1965 * and an offset within it.
1969 * the MemoryRegion and the offset within it.
1972 * not protected by RCU anymore. If the caller is not within an RCU critical
1978 * @offset: the offset within memory region
1980 MemoryRegion *memory_region_from_host(void *ptr, ram_addr_t *offset);
1989 * not protected by RCU anymore. If the caller is not within an RCU critical
2056 * memory_region_clear_dirty_bitmap - clear dirty bitmap for memory range
2065 * @start: start address offset within the memory region
2133 * TBs (for self-modifying code).
2135 * The MemoryRegionOps->write() callback of a ROM device must use this function
2140 * detect self-modifying code.
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).
2161 * memory_region_set_nonvolatile: Turn a memory region non-volatile
2163 * Allows a memory region to be marked as non-volatile.
2167 * @nonvolatile: whether rhe region is to be non-volatile.
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.
2197 * memory_region_add_coalescing: Enable memory coalescing for a sub-range of
2200 * Like memory_region_set_coalescing(), but works on a sub-range of a region.
2204 * @offset: the start of the range within the region to be coalesced.
2208 hwaddr offset,
2293 * Adds a subregion at @offset. The subregion may not overlap with other
2301 * @offset: the offset relative to @mr where @subregion is added.
2305 hwaddr offset,
2311 * Adds a subregion at @offset. The subregion may overlap with other
2320 * @offset: the offset relative to @mr where @subregion is added.
2325 hwaddr offset,
2354 * obscure sibling subregions with lower priority - it simply behaves as
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
2395 hwaddr offset);
2481 * - @size = 0 iff no overlap was found
2482 * - @mr is non-%NULL iff an overlap was found
2493 * - @offset_within_address_space >= @addr
2494 * - @offset_within_address_space + .@size <= @addr + @size
2543 * @filter: if non-%NULL, only regions in this address space will be observed
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
2705 * The _le suffixed functions treat the data as little endian;
2706 * _be indicates big endian; no suffix indicates "same endianness
2710 * target-* code; devices should be CPU-agnostic and use either the LE
2748 * The _le suffixed functions treat the data as little endian;
2749 * _be indicates big endian; no suffix indicates "same endianness
2753 * target-* code; devices should be CPU-agnostic and use either the LE
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()
2817 * read-modify-write operations. In this case, is_write should be %true.
2838 cache->mrs.mr = NULL; in address_space_cache_init_empty()
2840 cache->fv = NULL; in address_space_cache_init_empty()
2863 * entry. Should be called from an RCU critical section.
2870 * called from an RCU critical section, to avoid that the last reference
2919 * Use only for reads OR writes - not for read-modify-write operations.
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()
3005 * IOMMU fault). Called within RCU critical section.
3031 ptr = qemu_map_ram_ptr(mr->ram_block, addr1); in address_space_read()
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()
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()
3111 /* Swap if non-host endianness or native (target) endianness */ in devend_memop()
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