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

Function vmcs_setdesc

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

Source from the content-addressed store, hash-verified

252}
253
254int
255vmcs_setdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc)
256{
257 int error;
258 uint32_t base, limit, access;
259
260 error = vmcs_seg_desc_encoding(seg, &base, &limit, &access);
261 if (error != 0)
262 panic("vmcs_setdesc: invalid segment register %d", seg);
263
264 if (!running)
265 VMPTRLD(vmcs);
266 if ((error = vmwrite(base, desc->base)) != 0)
267 goto done;
268
269 if ((error = vmwrite(limit, desc->limit)) != 0)
270 goto done;
271
272 if (access != VMCS_INVALID_ENCODING) {
273 if ((error = vmwrite(access, desc->access)) != 0)
274 goto done;
275 }
276done:
277 if (!running)
278 VMCLEAR(vmcs);
279 return (error);
280}
281
282int
283vmcs_getdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc)

Callers 2

vmx_setdescFunction · 0.85
vmcs_snapshot_descFunction · 0.85

Calls 5

vmcs_seg_desc_encodingFunction · 0.85
VMPTRLDFunction · 0.85
vmwriteFunction · 0.85
VMCLEARFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected