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

requests: refactor SVSM request loop #613

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

msft-jlange
Copy link
Collaborator

Move the SVSM request loop out of the idle task and into a separate task, and invoke it only on SNP platforms. This is a step towards moving SVSM request processing out of the kernel, and enabling it to be excluded in configurations that only support paravisor processing.

Copy link
Member

@joergroedel joergroedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this LGTM. I stumbled a bit over the go_idle() implementation, but after some investigation it looks okay since it takes the scheduler/runqueue (which disables IRQs) lock.
Left two comments with questions for clarification.

kernel/src/cpu/percpu.rs Outdated Show resolved Hide resolved
kernel/src/requests.rs Show resolved Hide resolved
@joergroedel joergroedel added the in-review PR is under active review and not yet approved label Feb 14, 2025
Invocation of `halt` is a platform-specific operation, so all uses of
`halt` should invoke the platform-specific routine instead of a generic
utility version.

Signed-off-by: Jon Lange <[email protected]>
This change modifies the idle task flow so that all CPUs use the same
idle loop, which is responsible for kicking off request processing on
each CPU.

Signed-off-by: Jon Lange <[email protected]>
The idle task should be reserved for cases where the vCPU goes
completely idle.  Request processing should be in a separate task.
Moving the request loop to a separate task has the additional benefit of
making it easier to move request processing to user mode in the future.

Signed-off-by: Jon Lange <[email protected]>
The SVSM request loop is not meaningful on non-SNP platforms, so it
should not be invoked on non-SNP platforms.

Signed-off-by: Jon Lange <[email protected]>
@joergroedel joergroedel merged commit bef01a0 into coconut-svsm:main Feb 14, 2025
4 checks passed
@msft-jlange msft-jlange deleted the req_task branch February 14, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-review PR is under active review and not yet approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants