Re: [kvm-unit-tests PATCH v1 1/5] lib: s390x: smp: add functions to work with CPU indexes

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

 



On 28.01.22 19:54, Claudio Imbrenda wrote:
> Knowing the number of active CPUs is not enough to know which ones are
> active. This patch adds 2 new functions:
> 
> * smp_cpu_addr_from_idx to get the CPU address from the index
> * smp_cpu_from_idx allows to retrieve the struct cpu from the index
> 
> This makes it possible for tests to avoid hardcoding the CPU addresses.
> It is useful in cases where the address and the index might not match.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> ---
>  lib/s390x/smp.h |  2 ++
>  lib/s390x/smp.c | 12 ++++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/lib/s390x/smp.h b/lib/s390x/smp.h
> index a2609f11..69aa4003 100644
> --- a/lib/s390x/smp.h
> +++ b/lib/s390x/smp.h
> @@ -37,6 +37,7 @@ struct cpu_status {
>  
>  int smp_query_num_cpus(void);
>  struct cpu *smp_cpu_from_addr(uint16_t addr);
> +struct cpu *smp_cpu_from_idx(uint16_t addr);

s/addr/idx/


-- 
Thanks,

David / dhildenb




[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