From: Andrew Jones Subject: [PATCH kvm-unit-tests 2/3] arm/arm64: psci: cpu_psci_cpu_die operates on itself Date: Mon, 29 May 2017 15:58:03 +0200 Message-ID: <20170529135804.22891-3-drjones@redhat.com> References: <20170529135804.22891-1-drjones@redhat.com> Cc: rkrcmar@redhat.com To: kvm@vger.kernel.org, pbonzini@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45012 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbdE2N6K (ORCPT ); Mon, 29 May 2017 09:58:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5392820B1A for ; Mon, 29 May 2017 13:58:10 +0000 (UTC) In-Reply-To: <20170529135804.22891-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Andrew Jones --- lib/arm/asm/psci.h | 2 +- lib/arm/psci.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/arm/asm/psci.h b/lib/arm/asm/psci.h index eeb55cf299d1..ed51708fd265 100644 --- a/lib/arm/asm/psci.h +++ b/lib/arm/asm/psci.h @@ -8,6 +8,6 @@ extern int psci_invoke(unsigned long function_id, unsigned long arg0, extern int psci_cpu_on(unsigned long cpuid, unsigned long entry_point); extern void psci_sys_reset(void); extern int cpu_psci_cpu_boot(unsigned int cpu); -extern void cpu_psci_cpu_die(unsigned int cpu); +extern void cpu_psci_cpu_die(void); #endif /* _ASMARM_PSCI_H_ */ diff --git a/lib/arm/psci.c b/lib/arm/psci.c index a14acddeefd3..119f74e57e91 100644 --- a/lib/arm/psci.c +++ b/lib/arm/psci.c @@ -9,6 +9,7 @@ #include #include #include +#include __attribute__((noinline)) int psci_invoke(unsigned long function_id, unsigned long arg0, @@ -40,11 +41,11 @@ int cpu_psci_cpu_boot(unsigned int cpu) } #define PSCI_POWER_STATE_TYPE_POWER_DOWN (1U << 16) -void cpu_psci_cpu_die(unsigned int cpu) +void cpu_psci_cpu_die(void) { int err = psci_invoke(PSCI_0_2_FN_CPU_OFF, PSCI_POWER_STATE_TYPE_POWER_DOWN, 0, 0); - printf("unable to power off CPU%d (%d)\n", cpu, err); + printf("CPU%d unable to power off (error = %d)\n", smp_processor_id(), err); } void psci_sys_reset(void) -- 2.9.4