Lines Matching full:tree

2  * vhost software live migration iova tree
11 #include "qemu/iova-tree.h"
12 #include "vhost-iova-tree.h"
46 VhostIOVATree *tree = g_new(VhostIOVATree, 1); in vhost_iova_tree_new() local
49 tree->iova_first = MAX(iova_first, iova_min_addr); in vhost_iova_tree_new()
50 tree->iova_last = iova_last; in vhost_iova_tree_new()
52 tree->iova_taddr_map = iova_tree_new(); in vhost_iova_tree_new()
53 tree->iova_map = iova_tree_new(); in vhost_iova_tree_new()
54 tree->gpa_iova_map = gpa_tree_new(); in vhost_iova_tree_new()
55 return tree; in vhost_iova_tree_new()
72 * @tree: The VhostIOVATree
77 const DMAMap *vhost_iova_tree_find_iova(const VhostIOVATree *tree, in vhost_iova_tree_find_iova() argument
80 return iova_tree_find_iova(tree->iova_taddr_map, map); in vhost_iova_tree_find_iova()
84 * Allocate a new IOVA range and add the mapping to the IOVA->HVA tree
86 * @tree: The VhostIOVATree
93 * - IOVA_ERR_NOMEM if tree cannot allocate more space.
97 int vhost_iova_tree_map_alloc(VhostIOVATree *tree, DMAMap *map, hwaddr taddr) in vhost_iova_tree_map_alloc() argument
102 hwaddr iova_first = tree->iova_first ?: qemu_real_host_page_size(); in vhost_iova_tree_map_alloc()
108 /* Allocate a node in the IOVA-only tree */ in vhost_iova_tree_map_alloc()
109 ret = iova_tree_alloc_map(tree->iova_map, map, iova_first, tree->iova_last); in vhost_iova_tree_map_alloc()
114 /* Insert a node in the IOVA->HVA tree */ in vhost_iova_tree_map_alloc()
116 return iova_tree_insert(tree->iova_taddr_map, map); in vhost_iova_tree_map_alloc()
134 * @tree: The VhostIOVATree
139 const DMAMap *vhost_iova_tree_find_gpa(const VhostIOVATree *tree, in vhost_iova_tree_find_gpa() argument
142 return iova_tree_find_iova(tree->gpa_iova_map, map); in vhost_iova_tree_find_gpa()
146 * Allocate a new IOVA range and add the mapping to the GPA->IOVA tree
148 * @tree: The VhostIOVATree
155 * - IOVA_ERR_NOMEM if the IOVA-only tree cannot allocate more space
159 int vhost_iova_tree_map_alloc_gpa(VhostIOVATree *tree, DMAMap *map, hwaddr taddr) in vhost_iova_tree_map_alloc_gpa() argument
164 hwaddr iova_first = tree->iova_first ?: qemu_real_host_page_size(); in vhost_iova_tree_map_alloc_gpa()
170 /* Allocate a node in the IOVA-only tree */ in vhost_iova_tree_map_alloc_gpa()
171 ret = iova_tree_alloc_map(tree->iova_map, map, iova_first, tree->iova_last); in vhost_iova_tree_map_alloc_gpa()
176 /* Insert a node in the GPA->IOVA tree */ in vhost_iova_tree_map_alloc_gpa()
178 return gpa_tree_insert(tree->gpa_iova_map, map); in vhost_iova_tree_map_alloc_gpa()
184 * @tree: The VhostIOVATree