Lines Matching refs:ctx

9 static int handle_hvm_context(struct xc_sr_context *ctx,  in handle_hvm_context()  argument
12 xc_interface *xch = ctx->xch; in handle_hvm_context()
22 free(ctx->x86_hvm.restore.context); in handle_hvm_context()
24 ctx->x86_hvm.restore.context = memcpy(p, rec->data, rec->length); in handle_hvm_context()
25 ctx->x86_hvm.restore.contextsz = rec->length; in handle_hvm_context()
33 static int handle_hvm_params(struct xc_sr_context *ctx, in handle_hvm_params() argument
36 xc_interface *xch = ctx->xch; in handle_hvm_params()
73 ctx->restore.console_gfn = entry->value; in handle_hvm_params()
74 xc_clear_domain_page(xch, ctx->domid, entry->value); in handle_hvm_params()
77 ctx->restore.xenstore_gfn = entry->value; in handle_hvm_params()
78 xc_clear_domain_page(xch, ctx->domid, entry->value); in handle_hvm_params()
82 xc_clear_domain_page(xch, ctx->domid, entry->value); in handle_hvm_params()
86 rc = xc_hvm_param_set(xch, ctx->domid, entry->index, entry->value); in handle_hvm_params()
98 static bool x86_hvm_pfn_is_valid(const struct xc_sr_context *ctx, xen_pfn_t pfn) in x86_hvm_pfn_is_valid() argument
104 static xen_pfn_t x86_hvm_pfn_to_gfn(const struct xc_sr_context *ctx, in x86_hvm_pfn_to_gfn() argument
111 static void x86_hvm_set_gfn(struct xc_sr_context *ctx, xen_pfn_t pfn, in x86_hvm_set_gfn() argument
118 static void x86_hvm_set_page_type(struct xc_sr_context *ctx, in x86_hvm_set_page_type() argument
125 static int x86_hvm_localise_page(struct xc_sr_context *ctx, in x86_hvm_localise_page() argument
135 static int x86_hvm_setup(struct xc_sr_context *ctx) in x86_hvm_setup() argument
137 xc_interface *xch = ctx->xch; in x86_hvm_setup()
139 if ( ctx->restore.guest_type != DHDR_TYPE_X86_HVM ) in x86_hvm_setup()
142 dhdr_type_to_str(ctx->restore.guest_type)); in x86_hvm_setup()
145 else if ( ctx->restore.guest_page_size != PAGE_SIZE ) in x86_hvm_setup()
148 ctx->restore.guest_page_size); in x86_hvm_setup()
153 if ( ctx->restore.p2m_size > 0x0fffffff ) in x86_hvm_setup()
167 static int x86_hvm_process_record(struct xc_sr_context *ctx, in x86_hvm_process_record() argument
173 return handle_tsc_info(ctx, rec); in x86_hvm_process_record()
176 return handle_hvm_context(ctx, rec); in x86_hvm_process_record()
179 return handle_hvm_params(ctx, rec); in x86_hvm_process_record()
189 static int x86_hvm_stream_complete(struct xc_sr_context *ctx) in x86_hvm_stream_complete() argument
191 xc_interface *xch = ctx->xch; in x86_hvm_stream_complete()
194 rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_STORE_EVTCHN, in x86_hvm_stream_complete()
195 ctx->restore.xenstore_evtchn); in x86_hvm_stream_complete()
202 rc = xc_hvm_param_set(xch, ctx->domid, HVM_PARAM_CONSOLE_EVTCHN, in x86_hvm_stream_complete()
203 ctx->restore.console_evtchn); in x86_hvm_stream_complete()
210 rc = xc_domain_hvm_setcontext(xch, ctx->domid, in x86_hvm_stream_complete()
211 ctx->x86_hvm.restore.context, in x86_hvm_stream_complete()
212 ctx->x86_hvm.restore.contextsz); in x86_hvm_stream_complete()
219 rc = xc_dom_gnttab_hvm_seed(xch, ctx->domid, in x86_hvm_stream_complete()
220 ctx->restore.console_gfn, in x86_hvm_stream_complete()
221 ctx->restore.xenstore_gfn, in x86_hvm_stream_complete()
222 ctx->restore.console_domid, in x86_hvm_stream_complete()
223 ctx->restore.xenstore_domid); in x86_hvm_stream_complete()
233 static int x86_hvm_cleanup(struct xc_sr_context *ctx) in x86_hvm_cleanup() argument
235 free(ctx->x86_hvm.restore.context); in x86_hvm_cleanup()