-
Notifications
You must be signed in to change notification settings - Fork 102
Consolidate worker threads #317
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
Conversation
The SEV-SNP update also has a worker thread. Can we merge that first and rebase on top? |
701042f
to
d0c4c40
Compare
Sure. I figured I'd at least post the changes and let people review if they want |
Sure, that works. Can you mark as draft to note that its waiting on another PR? |
I think this mechanism can also be used for arm-cca. There is also a worker although the mechanism has not been generalized as here. |
d0c4c40
to
f8c2a7f
Compare
ab523d2
to
edcf800
Compare
Disclaimer: I can't test these changes on a SEV machine to verify the TEE code works |
Tested on SEV-SNP. LGTM! Can you rebase on |
Rather than spawning a new worker thread every time some functionality needs it, which results in it's own Message type, create something generic that can be used in one thread. Signed-off-by: Jake Correnti <[email protected]>
Rather than creating the worker thread on macOS differently than we do for the other x86 tasks, use the same associative function by taking advnatage of the generic `WorkerMessage` enum. Signed-off-by: Jake Correnti <[email protected]>
On x86, use the same sender as we would for macOS. Additionally, rather than using an EventFd to determine when the thread work is done, use a response sender/receiver like macOS. Signed-off-by: Jake Correnti <[email protected]>
For TEE VMs, use the same sender as we would for macOS or an x86 VM with a split IRQCHIP. ADditionally, use a channel for inter-process communication instead of an EventFd. Signed-off-by: Jake Correnti <[email protected]>
edcf800
to
ddde951
Compare
Done! |
@MatiasVara PTAL. I made some modifications to the worker thread for TEEs |
Whenever the vCPU needs to access resources the Vm or Vmm has control over, we end up spawning a worker thread to complete the task. Rather than spawning a new worker thread for each task, use a single thread, but make the message that's passed generic to allow for multiple use cases.