|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 13/27] xen/riscv: add basic VGEIN management for AIA guests
On 4/16/26 2:21 PM, Jan Beulich wrote: On 13.04.2026 16:42, Oleksii Kurochko wrote:On 4/2/26 12:03 PM, Jan Beulich wrote:On 10.03.2026 18:08, Oleksii Kurochko wrote: Thanks, now it makes sense to drop __init. Also - static?It isn't static because it will be called inside the secondary CPU bring-up function.As it doesn't need calling from the outside for the boot CPU, it's not obvious why it would need calling from the outside for secondary ones. I think I am confused here by what do you mean by "calling from the outside". It should be called during boot or secondary CPU initialization (if AIA is used), right? Then considering that VGEIN-related stuff is connected to AIA then vgein_init() is expected to live in aia.c and considering that it wants to be called by secondary CPU boot code it can't be static. I have a feeling that I misunderstood your statement...
Agree, it is. I just tried to follow the spec naming here. But I am okay to rename it to max_gein, for example. + /* + * All vCPU guest interrupt files are used and we don't support a case + * when number of vCPU on 1 pCPU is bigger then geilen. + */This wants checking in vgein_init() then. CPUs (beyond the boot one) violating this should not be brought online.It'll be nice. But we can't know how many vCPUs will be ran on pCPU when vgein_init() is executed.I don't understand: How does it matter how many vCPU-s will exist later on (and will run wherever)? IIUC, you want to check what is mentioned in the comment in vcpu_init(). The comment says that it is checking that number of vCPU on one pCPU isn't bigger then geilen. To check that we have to know an amount of vCPU potentially will be ran on pCPU. For me it is enough to have that vgein->geilen isn't 0 as this case isn't supported now. + ASSERT(vgein_id < vgein_bmp->geilen);What if not bit is available? By asserting, you assume the caller will not call here when no ID is available.It is just a temporary ASSERT() (as we don't support software guest interrupt files) because in general it is fine if there is no bit available, it will just mean that that no physical hardware guest interrupt file is assigned to the virtual hart, and software-based emulation (a "software file") must be used to handle guest external interrupts. Will it be better to return 0 now here and just don't create a vCPU on ... Yet there is no caller of this function,so how can one verify whether this assertion is appropriate?... the caller side when an assignment is expected to be happen?Yes, you want to return errors for cases you can't handle. You wan to assert on internal state only, not on anything controlled by a caller outside of the hypervisor. I will return then just vgein_id = 0 (as it is what should be returned when s/w guest interrupt files are supported) and handle that on the caller side. And symmetrically I will add 'if ( !vgein_id ) return' to vgein_release() as nothing should be done in vgein bitmap in this case. ~ Oleksii ~ Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |