[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/39] xen/riscv: introduce CPU_NONE
- To: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Mon, 12 Oct 2026 16:27:50 +0200
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Zheng Zhang <zhangzheng@xxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Mon, 12 Oct 2026 14:28:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10/5/26 4:53 PM, Baptiste Le Duc 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.
Its first user is vsfile_cpu in struct vimsic_state, which records the
pCPU whose h/w guest interrupt file backs the vCPU's IMSIC VS-file.
NR_CPUS has been used there as the value meaning that there is no such
pCPU, i.e. that the s/w VS-file is in use. NR_CPUS is however an upper
Nit: It's hard to understand when reading the message why s/w is mentioning.
I'd reword it to:
```
NR_CPUS has been used there to mean that no h/w guest interrupt file is
attached (i.e. the vCPU uses the s/w VS-file), so there is no pCPU to
record.
```
bound rather than a "no CPU" marker, and it already carries other
meanings: hartid_to_cpuid() returns it for a hart Xen doesn't know, and
pcpu_info[] uses it for an entry whose processor_id isn't valid yet.
Use CPU_NONE for vsfile_cpu instead, so that the s/w VS-file case can't
be mistaken for any of those.
Nit: Same as above, I'd prefer something like:
```
Use CPU_NONE for vsfile_cpu instead, so that "no h/w guest interrupt
file attached" can't be mistaken for an unknown hart or a not-yet-valid
pcpu_info[] entry.
```
I will apply your suggestions.
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
Thanks!
~ Oleksii
|