|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 06/42] xen/riscv: introduce CPU_NONE
On Fri, 13 Nov 2026 16:48:27 +0100, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx> wrote: > Introduce CPU_NONE, a CPU number which doesn't identify any physical > CPU, to be used wherever a pCPU has to be recorded but there may be > none. > > NR_CPUS has been used for that so far: hartid_to_cpuid() returns it for > a hart Xen doesn't know, pcpu_info[] uses it for an entry whose > processor_id isn't valid yet, and vsfile_cpu in struct vimsic_state, > which records the pCPU whose h/w guest interrupt file backs the vCPU's > IMSIC VS-file, uses it to mean that no h/w guest interrupt file is > attached. NR_CPUS is however the number of possible CPUs, i.e. an upper > bound, and a comparison against it reads like a range check rather than > like a test for "no pCPU". Use CPU_NONE in all these places instead, > which states that meaning explicitly. > > [...] Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx> -- Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |