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

Function emulate_rdmsr

freebsd/amd64/vmm/intel/vmx.c:2300–2325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2298}
2299
2300static int
2301emulate_rdmsr(struct vmx *vmx, int vcpuid, u_int num, bool *retu)
2302{
2303 struct vmxctx *vmxctx;
2304 uint64_t result;
2305 uint32_t eax, edx;
2306 int error;
2307
2308 if (lapic_msr(num))
2309 error = lapic_rdmsr(vmx->vm, vcpuid, num, &result, retu);
2310 else
2311 error = vmx_rdmsr(vmx, vcpuid, num, &result, retu);
2312
2313 if (error == 0) {
2314 eax = result;
2315 vmxctx = &vmx->ctx[vcpuid];
2316 error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RAX, eax);
2317 KASSERT(error == 0, ("vmxctx_setreg(rax) error %d", error));
2318
2319 edx = result >> 32;
2320 error = vmxctx_setreg(vmxctx, VM_REG_GUEST_RDX, edx);
2321 KASSERT(error == 0, ("vmxctx_setreg(rdx) error %d", error));
2322 }
2323
2324 return (error);
2325}
2326
2327static int
2328vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)

Callers 1

vmx_exit_processFunction · 0.70

Calls 4

lapic_msrFunction · 0.85
lapic_rdmsrFunction · 0.85
vmx_rdmsrFunction · 0.85
vmxctx_setregFunction · 0.85

Tested by

no test coverage detected