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

[Optimize] Preload user pgd in load_pgtbl hypercall #14

Open
zhuangel opened this issue Oct 29, 2024 · 0 comments
Open

[Optimize] Preload user pgd in load_pgtbl hypercall #14

zhuangel opened this issue Oct 29, 2024 · 0 comments

Comments

@zhuangel
Copy link

Currently, PVM relies on PTI is enabled inside VM. This means each process inside guest has 2 cr3, and there are 2 PGD in SPT of PVM.

PVM implements a hypercall (PVM_HC_LOAD_PGTBL) to change pagetable of SPT. And PVM is maintaining a pair of process usr/sys CR3s and switch flags, so that PVM could do direct switch to speed up guest process usr/sys switch without return to hypervisor.

We can speed up sys to usr switch by preloading the user pgd in PVM_HC_LOAD_PGTBL.

Here are some lmbench context switch case test results. Using preload user pgd feature, context switch latency could reduce 10%+, if we apply the enlarge the SPT LRU cache patch set, we can speed up context switching in multiprocess environment.

process num       2        3
w/o preload     3.952    5.344
w/  preload     3.555    4.517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant