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

hvf: ensure vcpus run in the right thread #242

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

slp
Copy link
Contributor

@slp slp commented Dec 5, 2024

For correctness and to support IPIs in future GICv3 implementations, we need to ensure each HVF vCPU runs in the right thread, so their respective IDs match each other.

We can't supply an ID to hv_vcpu_create. Instead, it'll return an incremental integer each time we call it. In order to have deterministic IDs, we need to serialize each call.

As we already have a Sender for notifying each vCPU TLS initialization, let's reuse and simply deplay writting to it until hv_vcpu_create has been called.

While there, also set MPIDR to the same vCPU ID, as this will be needed to properly support the in-kernel HVF GICv3 implementation.

For correctness and to support IPIs in future GICv3 implementations, we
need to ensure each HVF vCPU runs in the right thread, so their
respective IDs match each other.

We can't supply an ID to hv_vcpu_create. Instead, it'll return an
incremental integer each time we call it. In order to have deterministic
IDs, we need to serialize each call.

As we already have a Sender for notifying each vCPU TLS initialization,
let's reuse and simply deplay writting to it until hv_vcpu_create has
been called.

While there, also set MPIDR to the same vCPU ID, as this will be needed
to properly support the in-kernel HVF GICv3 implementation.

Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp slp merged commit d0ac954 into containers:main Dec 5, 2024
5 checks passed
@slp slp deleted the hvf-cpu-order branch December 5, 2024 19:34
@slp slp mentioned this pull request Dec 5, 2024
3 tasks
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

Successfully merging this pull request may close these issues.

1 participant