diff mbox series

[kvm-unit-tests,v3,05/18] lib: arm/arm64: Remove unused CPU_OFF parameter

Message ID 1577808589-31892-6-git-send-email-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series arm/arm64: Various fixes | expand

Commit Message

Alexandru Elisei Dec. 31, 2019, 4:09 p.m. UTC
The first version of PSCI required an argument for CPU_OFF, the power_state
argument, which was removed in version 0.2 of the specification [1].
kvm-unit-tests supports PSCI 0.2, and KVM ignores any CPU_OFF parameters,
so let's remove the PSCI_POWER_STATE_TYPE_POWER_DOWN parameter.

[1] ARM DEN 0022D, section 7.3.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 lib/arm/psci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Andre Przywara Jan. 2, 2020, 6:11 p.m. UTC | #1
On Tue, 31 Dec 2019 16:09:36 +0000
Alexandru Elisei <alexandru.elisei@arm.com> wrote:

Hi,

> The first version of PSCI required an argument for CPU_OFF, the power_state
> argument, which was removed in version 0.2 of the specification [1].
> kvm-unit-tests supports PSCI 0.2,

You mean kvm-unit-tests *require* PSCI v0.2? I only see explicit checks for that in the PSCI portion of selftests, but not in the other tests using PSCI, for secondary core bringup. Judging by the code we seem to *rely* on the presence of PSCI >= v0.2 via smc (for instance by assuming the v0.2 function IDs), even though this is not documented.

I guess there is little point to provide support for PSCI v0.1, so we should just document this, possibly referring to the explicit PSCI test.

> and KVM ignores any CPU_OFF parameters,
> so let's remove the PSCI_POWER_STATE_TYPE_POWER_DOWN parameter.
>
> [1] ARM DEN 0022D, section 7.3.
> 
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>

Anyway, in case we decide on requiring PSCI v0.2, this seems to be right, so:

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  lib/arm/psci.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/lib/arm/psci.c b/lib/arm/psci.c
> index c3d399064ae3..936c83948b6a 100644
> --- a/lib/arm/psci.c
> +++ b/lib/arm/psci.c
> @@ -40,11 +40,9 @@ int cpu_psci_cpu_boot(unsigned int cpu)
>  	return err;
>  }
>  
> -#define PSCI_POWER_STATE_TYPE_POWER_DOWN (1U << 16)
>  void cpu_psci_cpu_die(void)
>  {
> -	int err = psci_invoke(PSCI_0_2_FN_CPU_OFF,
> -			PSCI_POWER_STATE_TYPE_POWER_DOWN, 0, 0);
> +	int err = psci_invoke(PSCI_0_2_FN_CPU_OFF, 0, 0, 0);
>  	printf("CPU%d unable to power off (error = %d)\n", smp_processor_id(), err);
>  }
>
diff mbox series

Patch

diff --git a/lib/arm/psci.c b/lib/arm/psci.c
index c3d399064ae3..936c83948b6a 100644
--- a/lib/arm/psci.c
+++ b/lib/arm/psci.c
@@ -40,11 +40,9 @@  int cpu_psci_cpu_boot(unsigned int cpu)
 	return err;
 }
 
-#define PSCI_POWER_STATE_TYPE_POWER_DOWN (1U << 16)
 void cpu_psci_cpu_die(void)
 {
-	int err = psci_invoke(PSCI_0_2_FN_CPU_OFF,
-			PSCI_POWER_STATE_TYPE_POWER_DOWN, 0, 0);
+	int err = psci_invoke(PSCI_0_2_FN_CPU_OFF, 0, 0, 0);
 	printf("CPU%d unable to power off (error = %d)\n", smp_processor_id(), err);
 }