Lines Matching full:section

42 static bool vfio_prereg_listener_skipped_section(MemoryRegionSection *section)  in vfio_prereg_listener_skipped_section()  argument
44 if (memory_region_is_iommu(section->mr)) { in vfio_prereg_listener_skipped_section()
48 return !memory_region_is_ram(section->mr) || in vfio_prereg_listener_skipped_section()
49 memory_region_is_ram_device(section->mr); in vfio_prereg_listener_skipped_section()
52 static void *vfio_prereg_gpa_to_vaddr(MemoryRegionSection *section, hwaddr gpa) in vfio_prereg_gpa_to_vaddr() argument
54 return memory_region_get_ram_ptr(section->mr) + in vfio_prereg_gpa_to_vaddr()
55 section->offset_within_region + in vfio_prereg_gpa_to_vaddr()
56 (gpa - section->offset_within_address_space); in vfio_prereg_gpa_to_vaddr()
60 MemoryRegionSection *section) in vfio_prereg_listener_region_add() argument
66 const hwaddr gpa = section->offset_within_address_space; in vfio_prereg_listener_region_add()
75 if (vfio_prereg_listener_skipped_section(section)) { in vfio_prereg_listener_region_add()
77 section->offset_within_address_space, in vfio_prereg_listener_region_add()
78 section->offset_within_address_space + in vfio_prereg_listener_region_add()
79 int128_get64(int128_sub(section->size, int128_one()))); in vfio_prereg_listener_region_add()
83 if (unlikely((section->offset_within_address_space & ~page_mask) || in vfio_prereg_listener_region_add()
84 (section->offset_within_region & ~page_mask) || in vfio_prereg_listener_region_add()
85 (int128_get64(section->size) & ~page_mask))) { in vfio_prereg_listener_region_add()
90 end = section->offset_within_address_space + int128_get64(section->size); in vfio_prereg_listener_region_add()
95 memory_region_ref(section->mr); in vfio_prereg_listener_region_add()
97 reg.vaddr = (uintptr_t) vfio_prereg_gpa_to_vaddr(section, gpa); in vfio_prereg_listener_region_add()
120 MemoryRegionSection *section) in vfio_prereg_listener_region_del() argument
125 const hwaddr gpa = section->offset_within_address_space; in vfio_prereg_listener_region_del()
134 if (vfio_prereg_listener_skipped_section(section)) { in vfio_prereg_listener_region_del()
136 section->offset_within_address_space, in vfio_prereg_listener_region_del()
137 section->offset_within_address_space + in vfio_prereg_listener_region_del()
138 int128_get64(int128_sub(section->size, int128_one()))); in vfio_prereg_listener_region_del()
142 if (unlikely((section->offset_within_address_space & ~page_mask) || in vfio_prereg_listener_region_del()
143 (section->offset_within_region & ~page_mask) || in vfio_prereg_listener_region_del()
144 (int128_get64(section->size) & ~page_mask))) { in vfio_prereg_listener_region_del()
149 end = section->offset_within_address_space + int128_get64(section->size); in vfio_prereg_listener_region_del()
154 reg.vaddr = (uintptr_t) vfio_prereg_gpa_to_vaddr(section, gpa); in vfio_prereg_listener_region_del()
243 MemoryRegionSection *section, in vfio_spapr_create_window() argument
250 IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); in vfio_spapr_create_window()
279 create.window_size = int128_get64(section->size); in vfio_spapr_create_window()
333 if (create.start_addr != section->offset_within_address_space) { in vfio_spapr_create_window()
337 ", must be %"PRIx64, section->offset_within_address_space, in vfio_spapr_create_window()
352 MemoryRegionSection *section, in vfio_spapr_container_add_section_window() argument
366 * the section fall in this range. in vfio_spapr_container_add_section_window()
371 iova = section->offset_within_address_space; in vfio_spapr_container_add_section_window()
372 end = iova + int128_get64(section->size) - 1; in vfio_spapr_container_add_section_window()
391 section->offset_within_address_space, in vfio_spapr_container_add_section_window()
392 int128_get64(section->size))) { in vfio_spapr_container_add_section_window()
396 section->offset_within_address_space, in vfio_spapr_container_add_section_window()
397 section->offset_within_address_space + in vfio_spapr_container_add_section_window()
398 int128_get64(section->size) - 1, in vfio_spapr_container_add_section_window()
404 ret = vfio_spapr_create_window(container, section, &pgsize, errp); in vfio_spapr_container_add_section_window()
409 vfio_host_win_add(scontainer, section->offset_within_address_space, in vfio_spapr_container_add_section_window()
410 section->offset_within_address_space + in vfio_spapr_container_add_section_window()
411 int128_get64(section->size) - 1, pgsize); in vfio_spapr_container_add_section_window()
415 IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); in vfio_spapr_container_add_section_window()
444 MemoryRegionSection *section) in vfio_spapr_container_del_section_window() argument
456 section->offset_within_address_space); in vfio_spapr_container_del_section_window()
458 section->offset_within_address_space, in vfio_spapr_container_del_section_window()
459 section->offset_within_address_space + in vfio_spapr_container_del_section_window()
460 int128_get64(section->size) - 1) < 0) { in vfio_spapr_container_del_section_window()
462 __func__, section->offset_within_address_space); in vfio_spapr_container_del_section_window()