Lines Matching refs:section

35 static bool vfio_prereg_listener_skipped_section(MemoryRegionSection *section)  in vfio_prereg_listener_skipped_section()  argument
37 if (memory_region_is_iommu(section->mr)) { in vfio_prereg_listener_skipped_section()
41 return !memory_region_is_ram(section->mr) || in vfio_prereg_listener_skipped_section()
42 memory_region_is_ram_device(section->mr); in vfio_prereg_listener_skipped_section()
45 static void *vfio_prereg_gpa_to_vaddr(MemoryRegionSection *section, hwaddr gpa) in vfio_prereg_gpa_to_vaddr() argument
47 return memory_region_get_ram_ptr(section->mr) + in vfio_prereg_gpa_to_vaddr()
48 section->offset_within_region + in vfio_prereg_gpa_to_vaddr()
49 (gpa - section->offset_within_address_space); in vfio_prereg_gpa_to_vaddr()
53 MemoryRegionSection *section) in vfio_prereg_listener_region_add() argument
59 const hwaddr gpa = section->offset_within_address_space; in vfio_prereg_listener_region_add()
68 if (vfio_prereg_listener_skipped_section(section)) { in vfio_prereg_listener_region_add()
70 section->offset_within_address_space, in vfio_prereg_listener_region_add()
71 section->offset_within_address_space + in vfio_prereg_listener_region_add()
72 int128_get64(int128_sub(section->size, int128_one()))); in vfio_prereg_listener_region_add()
76 if (unlikely((section->offset_within_address_space & ~page_mask) || in vfio_prereg_listener_region_add()
77 (section->offset_within_region & ~page_mask) || in vfio_prereg_listener_region_add()
78 (int128_get64(section->size) & ~page_mask))) { in vfio_prereg_listener_region_add()
83 end = section->offset_within_address_space + int128_get64(section->size); in vfio_prereg_listener_region_add()
88 memory_region_ref(section->mr); in vfio_prereg_listener_region_add()
90 reg.vaddr = (uintptr_t) vfio_prereg_gpa_to_vaddr(section, gpa); in vfio_prereg_listener_region_add()
113 MemoryRegionSection *section) in vfio_prereg_listener_region_del() argument
118 const hwaddr gpa = section->offset_within_address_space; in vfio_prereg_listener_region_del()
127 if (vfio_prereg_listener_skipped_section(section)) { in vfio_prereg_listener_region_del()
129 section->offset_within_address_space, in vfio_prereg_listener_region_del()
130 section->offset_within_address_space + in vfio_prereg_listener_region_del()
131 int128_get64(int128_sub(section->size, int128_one()))); in vfio_prereg_listener_region_del()
135 if (unlikely((section->offset_within_address_space & ~page_mask) || in vfio_prereg_listener_region_del()
136 (section->offset_within_region & ~page_mask) || in vfio_prereg_listener_region_del()
137 (int128_get64(section->size) & ~page_mask))) { in vfio_prereg_listener_region_del()
142 end = section->offset_within_address_space + int128_get64(section->size); in vfio_prereg_listener_region_del()
147 reg.vaddr = (uintptr_t) vfio_prereg_gpa_to_vaddr(section, gpa); in vfio_prereg_listener_region_del()
236 MemoryRegionSection *section, in vfio_spapr_create_window() argument
241 IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); in vfio_spapr_create_window()
270 create.window_size = int128_get64(section->size); in vfio_spapr_create_window()
311 if (create.start_addr != section->offset_within_address_space) { in vfio_spapr_create_window()
315 section->offset_within_address_space, in vfio_spapr_create_window()
330 MemoryRegionSection *section, in vfio_spapr_container_add_section_window() argument
349 iova = section->offset_within_address_space; in vfio_spapr_container_add_section_window()
350 end = iova + int128_get64(section->size) - 1; in vfio_spapr_container_add_section_window()
369 section->offset_within_address_space, in vfio_spapr_container_add_section_window()
370 int128_get64(section->size))) { in vfio_spapr_container_add_section_window()
374 section->offset_within_address_space, in vfio_spapr_container_add_section_window()
375 section->offset_within_address_space + in vfio_spapr_container_add_section_window()
376 int128_get64(section->size) - 1, in vfio_spapr_container_add_section_window()
382 ret = vfio_spapr_create_window(container, section, &pgsize); in vfio_spapr_container_add_section_window()
388 vfio_host_win_add(scontainer, section->offset_within_address_space, in vfio_spapr_container_add_section_window()
389 section->offset_within_address_space + in vfio_spapr_container_add_section_window()
390 int128_get64(section->size) - 1, pgsize); in vfio_spapr_container_add_section_window()
394 IOMMUMemoryRegion *iommu_mr = IOMMU_MEMORY_REGION(section->mr); in vfio_spapr_container_add_section_window()
423 MemoryRegionSection *section) in vfio_spapr_container_del_section_window() argument
435 section->offset_within_address_space); in vfio_spapr_container_del_section_window()
437 section->offset_within_address_space, in vfio_spapr_container_del_section_window()
438 section->offset_within_address_space + in vfio_spapr_container_del_section_window()
439 int128_get64(section->size) - 1) < 0) { in vfio_spapr_container_del_section_window()
441 __func__, section->offset_within_address_space); in vfio_spapr_container_del_section_window()