libsel4vm: guest cpu requests to vcpus from pcpus#85
Open
alexpavey wants to merge 1 commit intoseL4:masterfrom
Open
libsel4vm: guest cpu requests to vcpus from pcpus#85alexpavey wants to merge 1 commit intoseL4:masterfrom
alexpavey wants to merge 1 commit intoseL4:masterfrom
Conversation
Originally the guests were able to make requests for a specific physical core based on its id. These changes associate that requested id with a vcpu instead of a pcpu. Signed-off-by: Alex Pavey <Alex.Pavey@dornerworks.com>
axel-h
reviewed
Nov 17, 2022
| break; | ||
| case PSCI_CPU_ON: { | ||
| uintptr_t target_cpu = smc_get_arg(®s, 1); | ||
| uintptr_t requested_cpu = smc_get_arg(®s, 1); |
Member
There was a problem hiding this comment.
so, my question holds - we get a (v)MPIDR here from the guest and not a linear (seL4 affinity) ID?
axel-h
reviewed
Apr 16, 2023
| if (target_vcpu && start_new_vcpu(target_vcpu, entry_point_address, context_id, target_cpu) == 0) { | ||
| vm_vcpu_t *target_vcpu = NULL; | ||
| if ((requested_cpu >= 0) && (requested_cpu < vcpu->vm->num_vcpus)) { | ||
| target_vcpu = vcpu->vm->vcpus[requested_cpu]; |
Member
There was a problem hiding this comment.
This will not work, because requested_cpu is a MPID value now - because that is what a caller passed into the SMC according to the spec. So we need to do a lookup over all our vCPUs.
axel-h
reviewed
Apr 16, 2023
| /* Automatically assign vcpu to an unassigned physical cpu */ | ||
| if (target_vcpu->target_cpu == -1) { | ||
| int selected_cpu = vm_find_free_unassigned_cpu(vcpu->vm); | ||
| if ((selected_cpu >= 0) && start_new_vcpu(target_vcpu, entry_point_address, context_id, selected_cpu) == 0) { |
Member
There was a problem hiding this comment.
Don't we have to set the MPIDR of the vCPU here also now, so this is in sync with what the caller requested? Can the caller actually starts arbitrary cored here - shouldn't we have prepared the vCPU list in advance, about what cores the caller can start, ie. what cores the VM has.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Originally the guests were able to make requests for a specific physical core based on its id. These changes associate that requested id with a vcpu instead of a pcpu.
Signed-off-by: Alex Pavey Alex.Pavey@dornerworks.com