hvf: ensure vcpus run in the right thread #242
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.