MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / WrmsrHandler

Function WrmsrHandler

Kernel-Bridge/API/Hypervisor.cpp:2437–2451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2435 _IRQL_requires_same_
2436 _IRQL_requires_min_(DISPATCH_LEVEL)
2437 static VMM_STATUS WrmsrHandler(__inout PRIVATE_VM_DATA* Private, __inout GUEST_CONTEXT* Context, unsigned long long Rip, __inout_opt bool& RepeatInstruction)
2438 {
2439 UNREFERENCED_PARAMETER(Private);
2440 UNREFERENCED_PARAMETER(Rip);
2441 UNREFERENCED_PARAMETER(RepeatInstruction);
2442
2443 unsigned int Msr = static_cast<int>(Context->Rcx);
2444 if (IsMsrAllowed(Msr))
2445 {
2446 unsigned long long Value = (static_cast<unsigned long long>(Context->Rdx) << 32u)
2447 | (static_cast<unsigned long long>(Context->Rax));
2448 __writemsr(Msr, Value);
2449 }
2450 return VMM_STATUS::VMM_CONTINUE;
2451 }
2452
2453 _IRQL_requires_same_
2454 _IRQL_requires_min_(DISPATCH_LEVEL)

Callers

nothing calls this directly

Calls 1

IsMsrAllowedFunction · 0.85

Tested by

no test coverage detected