Commit c5a9c0d2 authored by liwei's avatar liwei
Browse files

arm64/psci: Add undefined error message printing for psci_x_cpu_on

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8XMTL


CVE: NA

---------------------------

if the error code returned by the cpu_on interface is not -EPERM, no error information is printed. For instance,

 => res.a0 = PSCI_RET_DENIED (-3)
 => arm_smccc_hvc(function_id, arg0, arg1, arg2, 0, 0, 0, 0, &res)
 => invoke_psci_fn = __invoke_psci_fn_hvc
 => __psci_cpu_on(PSCI_FN_NATIVE(0_2, CPU_ON), cpuid, entry_point)
 => psci_0_2_cpu_on
 => cpu_psci_cpu_boot
 => bringup_cpu
 => cpuhp_invoke_callback
 => __cpuhp_invoke_callback_range
 => cpuhp_up_callbacks
 => cpu_up

When the value of res.a0 is PSCI_RET_DENIED(-3), no information is displayed, indicating that the CPU fails to go online.

Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent ba9a8dda
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -40,8 +40,12 @@ static int cpu_psci_cpu_boot(unsigned int cpu)
{
	phys_addr_t pa_secondary_entry = __pa_symbol(secondary_entry);
	int err = psci_ops.cpu_on(cpu_logical_map(cpu), pa_secondary_entry);
	if (err && err != -EPERM)
	if (err) {
		if (err != -EPERM)
			pr_err("failed to boot CPU%d (%d)\n", cpu, err);
		else
			pr_err("psci feedback boot CPU%d result(%d) undefined\n", cpu, err);
	}

	return err;
}