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

Function vmcs_getdesc

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

Source from the content-addressed store, hash-verified

280}
281
282int
283vmcs_getdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc)
284{
285 int error;
286 uint32_t base, limit, access;
287 uint64_t u64;
288
289 error = vmcs_seg_desc_encoding(seg, &base, &limit, &access);
290 if (error != 0)
291 panic("vmcs_getdesc: invalid segment register %d", seg);
292
293 if (!running)
294 VMPTRLD(vmcs);
295 if ((error = vmread(base, &u64)) != 0)
296 goto done;
297 desc->base = u64;
298
299 if ((error = vmread(limit, &u64)) != 0)
300 goto done;
301 desc->limit = u64;
302
303 if (access != VMCS_INVALID_ENCODING) {
304 if ((error = vmread(access, &u64)) != 0)
305 goto done;
306 desc->access = u64;
307 }
308done:
309 if (!running)
310 VMCLEAR(vmcs);
311 return (error);
312}
313
314int
315vmcs_set_msr_save(struct vmcs *vmcs, u_long g_area, u_int g_count)

Callers 2

vmx_getdescFunction · 0.85
vmcs_snapshot_descFunction · 0.85

Calls 5

vmcs_seg_desc_encodingFunction · 0.85
VMPTRLDFunction · 0.85
vmreadFunction · 0.85
VMCLEARFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected