Lines Matching full:section
311 static inline bool section_covers_addr(const MemoryRegionSection *section, in section_covers_addr() argument
315 * the section must cover the entire address space. in section_covers_addr()
317 return int128_gethi(section->size) || in section_covers_addr()
318 range_covers_byte(section->offset_within_address_space, in section_covers_addr()
319 int128_getlo(section->size), addr); in section_covers_addr()
345 /* Called from RCU critical section */
350 MemoryRegionSection *section = qatomic_read(&d->mru_section); in address_space_lookup_region() local
353 if (!section || section == &d->map.sections[PHYS_SECTION_UNASSIGNED] || in address_space_lookup_region()
354 !section_covers_addr(section, addr)) { in address_space_lookup_region()
355 section = phys_page_find(d, addr); in address_space_lookup_region()
356 qatomic_set(&d->mru_section, section); in address_space_lookup_region()
358 if (resolve_subpage && section->mr->subpage) { in address_space_lookup_region()
359 subpage = container_of(section->mr, subpage_t, iomem); in address_space_lookup_region()
360 section = &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr)]]; in address_space_lookup_region()
362 return section; in address_space_lookup_region()
365 /* Called from RCU critical section */
370 MemoryRegionSection *section; in address_space_translate_internal() local
374 section = address_space_lookup_region(d, addr, resolve_subpage); in address_space_translate_internal()
376 addr -= section->offset_within_address_space; in address_space_translate_internal()
379 *xlat = addr + section->offset_within_region; in address_space_translate_internal()
381 mr = section->mr; in address_space_translate_internal()
395 diff = int128_sub(section->size, int128_make64(addr)); in address_space_translate_internal()
398 return section; in address_space_translate_internal()
420 * This function is called from RCU critical section. It is the common
432 MemoryRegionSection *section; in address_space_translate_iommu() local
458 section = address_space_translate_internal( in address_space_translate_iommu()
462 iommu_mr = memory_region_get_iommu(section->mr); in address_space_translate_iommu()
468 return *section; in address_space_translate_iommu()
492 * This function is called from RCU critical section
504 MemoryRegionSection *section; in flatview_do_translate() local
512 section = address_space_translate_internal( in flatview_do_translate()
516 iommu_mr = memory_region_get_iommu(section->mr); in flatview_do_translate()
528 return *section; in flatview_do_translate()
531 /* Called from RCU critical section */
535 MemoryRegionSection section; in address_space_get_iotlb_entry() local
542 section = flatview_do_translate(address_space_to_flatview(as), addr, &xlat, in address_space_get_iotlb_entry()
547 if (section.mr == &io_mem_unassigned) { in address_space_get_iotlb_entry()
552 xlat += section.offset_within_address_space - in address_space_get_iotlb_entry()
553 section.offset_within_region; in address_space_get_iotlb_entry()
568 /* Called from RCU critical section */
574 MemoryRegionSection section; in flatview_translate() local
578 section = flatview_do_translate(fv, addr, xlat, plen, NULL, in flatview_translate()
580 mr = section.mr; in flatview_translate()
683 /* Called from RCU critical section */
689 MemoryRegionSection *section; in address_space_translate_for_iotlb() local
698 section = address_space_translate_internal(d, addr, &addr, plen, false); in address_space_translate_for_iotlb()
700 iommu_mr = memory_region_get_iommu(section->mr); in address_space_translate_for_iotlb()
733 assert(!memory_region_is_iommu(section->mr)); in address_space_translate_for_iotlb()
735 return section; in address_space_translate_for_iotlb()
768 /* Called from RCU critical section */
770 MemoryRegionSection *section) in memory_region_section_get_iotlb() argument
772 AddressSpaceDispatch *d = flatview_to_dispatch(section->fv); in memory_region_section_get_iotlb()
773 return section - d->map.sections; in memory_region_section_get_iotlb()
851 /* Called from RCU critical section */
1035 uint16_t section);
1039 MemoryRegionSection *section) in phys_section_add() argument
1041 /* The physical section number is ORed with a page-aligned in phys_section_add()
1052 map->sections[map->sections_nb] = *section; in phys_section_add()
1053 memory_region_ref(section->mr); in phys_section_add()
1073 MemoryRegionSection *section = &map->sections[--map->sections_nb]; in phys_sections_free() local
1074 phys_section_destroy(section->mr); in phys_sections_free()
1080 static void register_subpage(FlatView *fv, MemoryRegionSection *section) in register_subpage() argument
1084 hwaddr base = section->offset_within_address_space in register_subpage()
1104 start = section->offset_within_address_space & ~TARGET_PAGE_MASK; in register_subpage()
1105 end = start + int128_get64(section->size) - 1; in register_subpage()
1107 phys_section_add(&d->map, section)); in register_subpage()
1112 MemoryRegionSection *section) in register_multipage() argument
1115 hwaddr start_addr = section->offset_within_address_space; in register_multipage()
1116 uint16_t section_index = phys_section_add(&d->map, section); in register_multipage()
1117 uint64_t num_pages = int128_get64(int128_rshift(section->size, in register_multipage()
1125 * The range in *section* may look like this:
1131 void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section) in flatview_add_to_dispatch() argument
1133 MemoryRegionSection remain = *section; in flatview_add_to_dispatch()
2415 * Called within RCU critical section.
2462 * Called within RCU critical section.
2642 uint16_t section) in subpage_register() argument
2651 printf("%s: %p start %08x end %08x idx %08x eidx %08x section %d\n", in subpage_register()
2652 __func__, mmio, start, end, idx, eidx, section); in subpage_register()
2655 mmio->sub_section[idx] = section; in subpage_register()
2683 MemoryRegionSection section = { in dummy_section() local
2691 return phys_section_add(map, §ion); in dummy_section()
2782 * the main loop, which will end the RCU critical section and reclaim in tcg_commit()
2976 /* Called within RCU critical section. */
3005 /* Called from RCU critical section. */
3068 /* Called within RCU critical section. */
3096 /* Called from RCU critical section. */
3543 * cache->xlat is now relative to cache->mrs.mr, not to the section itself. in address_space_cache_init()
3545 * cache->xlat and the end of the section. in address_space_cache_init()
3597 /* Called from RCU critical section. This function has the same
3606 MemoryRegionSection section; in address_space_translate_cached() local
3621 section = address_space_translate_iommu(iommu_mr, xlat, plen, in address_space_translate_cached()
3624 return section.mr; in address_space_translate_cached()
3627 /* Called within RCU critical section. */
3656 /* Called within RCU critical section. */
3680 /* Called from RCU critical section. address_space_read_cached uses this
3697 /* Called from RCU critical section. address_space_write_cached uses this