Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for support of cr3 target count before write into #42

Open
1401199262 opened this issue Jan 1, 2024 · 0 comments
Open

Check for support of cr3 target count before write into #42

1401199262 opened this issue Jan 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@1401199262
Copy link

If not doing this, on some cpu vm_launch would failed with VMCS_VM_INSTRUCTION_ERROR = 7, which is invalid vm execution control fileds.

https://github.com/jonomango/hv/blob/main/hv/vmcs.cpp#L99

// 3.24.6.7
// try to trigger the least amount of CR3 exits as possible
if (cpu->cached.vmx_misc.cr3_target_count >= 1)
{
vmx_vmwrite(VMCS_CTRL_CR3_TARGET_COUNT, 1);
vmx_vmwrite(VMCS_CTRL_CR3_TARGET_VALUE_0, ghv.system_cr3.flags);
}
else
{
vmx_vmwrite(VMCS_CTRL_CR3_TARGET_COUNT, 0);
}

@jonomango jonomango added the bug Something isn't working label Jan 1, 2024
@jonomango jonomango self-assigned this Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants