Skip to content

Commit

Permalink
Added debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguikema committed Feb 1, 2024
1 parent 2094fef commit 7d5b03b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libsel4vmmplatsupport/src/arch/arm/psci.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,27 @@ int handle_psci(vm_vcpu_t *vcpu, seL4_UserContext *regs, seL4_Word fn_number, bo
uintptr_t target_cpu = smc_get_arg(regs, 1);
uintptr_t entry_point_address = smc_get_arg(regs, 2);
uintptr_t context_id = smc_get_arg(regs, 3);
ZF_LOGE("target_cpu: %d", target_cpu);
vm_vcpu_t *target_vcpu = vm_vcpu_for_target_cpu(vcpu->vm, target_cpu);
if (target_vcpu == NULL) {
ZF_LOGE("Null VCPU");
target_vcpu = vm_find_free_unassigned_vcpu(vcpu->vm);
ZF_LOGE("Found free unassigned VCPU");
if (target_vcpu && start_new_vcpu(target_vcpu, entry_point_address, context_id, target_cpu) == 0) {
ZF_LOGE("Started found VCPU");
smc_set_return_value(regs, PSCI_SUCCESS);
} else {
ZF_LOGE("Failed to start found VCPU");
smc_set_return_value(regs, PSCI_INTERNAL_FAILURE);
}
} else if ((target_vcpu->target_cpu >= 0) && (target_vcpu->target_cpu < CONFIG_MAX_NUM_NODES)) {
ZF_LOGE("Found existing VCPU");
/* Assign vcpu to physical cpu specified in config */
if (is_vcpu_online(target_vcpu)) {
ZF_LOGE("its already on...");
smc_set_return_value(regs, PSCI_ALREADY_ON);
} else if (start_new_vcpu(target_vcpu, entry_point_address, context_id, target_vcpu->target_cpu) == 0) {
ZF_LOGE("started VCPU that we already found!");
smc_set_return_value(regs, PSCI_SUCCESS);
} else {
ZF_LOGE("[vCPU %u] could not start vCPU", vcpu->vcpu_id);
Expand Down

0 comments on commit 7d5b03b

Please sign in to comment.