MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vmcs_setreg

Function vmcs_setreg

freebsd/amd64/vmm/intel/vmcs.c:227–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227int
228vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val)
229{
230 int error;
231 uint32_t encoding;
232
233 if (ident < 0)
234 encoding = ident & 0x7fffffff;
235 else
236 encoding = vmcs_field_encoding(ident);
237
238 if (encoding == (uint32_t)-1)
239 return (EINVAL);
240
241 val = vmcs_fix_regval(encoding, val);
242
243 if (!running)
244 VMPTRLD(vmcs);
245
246 error = vmwrite(encoding, val);
247
248 if (!running)
249 VMCLEAR(vmcs);
250
251 return (error);
252}
253
254int
255vmcs_setdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc)

Callers 4

vmx_setup_cr_shadowFunction · 0.85
vmx_modify_intr_shadowFunction · 0.85
vmx_setregFunction · 0.85
vmcs_snapshot_regFunction · 0.85

Calls 5

vmcs_field_encodingFunction · 0.85
vmcs_fix_regvalFunction · 0.85
VMPTRLDFunction · 0.85
vmwriteFunction · 0.85
VMCLEARFunction · 0.85

Tested by

no test coverage detected