Lines Matching +full:gpa +full:- +full:0

9  * See the COPYING file in the top-level directory.
13 #include "qemu/host-utils.h"
15 #include "qemu/main-loop.h"
19 #include "exec/address-spaces.h"
33 #define TYPE_XEN_OVERLAY "xen-overlay"
52 void xen_overlay_do_map_page(MemoryRegion *page, uint64_t gpa) in xen_overlay_do_map_page() argument
62 if (gpa == INVALID_GPA) { in xen_overlay_do_map_page()
66 memory_region_set_address(page, gpa); in xen_overlay_do_map_page()
68 } else if (gpa != INVALID_GPA) { in xen_overlay_do_map_page()
69 memory_region_add_subregion_overlap(get_system_memory(), gpa, page, 0); in xen_overlay_do_map_page()
94 memory_region_init_ram(&s->shinfo_mem, OBJECT(dev), "xen:shared_info", in xen_overlay_realize()
96 memory_region_set_enabled(&s->shinfo_mem, true); in xen_overlay_realize()
98 s->shinfo_ptr = memory_region_get_ram_ptr(&s->shinfo_mem); in xen_overlay_realize()
99 s->shinfo_gpa = INVALID_GPA; in xen_overlay_realize()
100 s->long_mode = false; in xen_overlay_realize()
101 memset(s->shinfo_ptr, 0, XEN_PAGE_SIZE); in xen_overlay_realize()
108 * where the guest has set the hypercall page up in 64-bit mode but in xen_overlay_pre_save()
119 if (s->shinfo_gpa != INVALID_GPA) { in xen_overlay_post_load()
120 xen_overlay_do_map_page(&s->shinfo_mem, s->shinfo_gpa); in xen_overlay_post_load()
121 xen_overlay_set_be_shinfo(s->shinfo_gpa >> XEN_PAGE_SHIFT); in xen_overlay_post_load()
123 if (s->long_mode) { in xen_overlay_post_load()
127 return 0; in xen_overlay_post_load()
159 dc->realize = xen_overlay_realize; in xen_overlay_class_init()
160 dc->vmsd = &xen_overlay_vmstate; in xen_overlay_class_init()
173 -1, NULL)); in xen_overlay_create()
188 int xen_overlay_map_shinfo_page(uint64_t gpa) in type_init()
194 return -ENOENT; in type_init()
199 if (s->shinfo_gpa) { in type_init()
207 xen_overlay_do_map_page(&s->shinfo_mem, gpa); in type_init()
208 if (gpa != INVALID_GPA) { in type_init()
209 ret = xen_overlay_set_be_shinfo(gpa >> XEN_PAGE_SHIFT); in type_init()
214 s->shinfo_gpa = gpa; in type_init()
216 return 0; in type_init()
227 return s->shinfo_ptr; in xen_overlay_get_shinfo_ptr()
238 return -ENOENT; in xen_sync_long_mode()
243 xen_overlay_singleton->long_mode = xa.u.long_mode; in xen_sync_long_mode()
258 return -ENOENT; in xen_set_long_mode()
263 xen_overlay_singleton->long_mode = xa.u.long_mode; in xen_set_long_mode()
271 return xen_overlay_singleton && xen_overlay_singleton->long_mode; in xen_is_long_mode()