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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Dec 2019 16:09:36 +0000
Alexandru Elisei <alexandru.elisei@xxxxxxx> 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@xxxxxxx>

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

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

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);
>  }
>  




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux