[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 03/12] xen/arm: vgic: implement helper functions for virq checks
On 27.08.25 21:24, Leonid Komarianskyi wrote: Hello Leonid Introduced two new helper functions for vGIC: vgic_is_valid_line and vgic_is_spi. The functions are similar to the newly introduced gic_is_valid_line and gic_is_spi, but they verify whether a vIRQ is available for a specific domain, while GIC-specific functions validate INTIDs for the real GIC hardware. For example, the GIC may support all 992 SPI lines, but the domain may use only some part of them (e.g., 640), depending on the highest IRQ number defined in the domain configuration. Therefore, for vGIC-related code and checks, the appropriate functions should be used. Also, updated the appropriate checks to use these new helper functions. The purpose of introducing new helper functions for vGIC is essentially the same as for GIC: to avoid potential confusion with GIC-related checks and to consolidate similar code into separate functions, which can be more easily extended by additional conditions, e.g., when implementing extended SPI interrupts. Only the validation change in vgic_inject_irq may affect existing functionality, as it currently checks whether the vIRQ is less than or equal to vgic_num_irqs. Since IRQ indexes start from 0 (where 32 is the first SPI), the check should behave consistently with similar logic in other places and should check if the vIRQ number is less than vgic_num_irqs. The remaining changes, which replace open-coded checks with the use of these new helper functions, do not introduce any functional changes, as the helper functions follow the current vIRQ index verification logic. Signed-off-by: Leonid Komarianskyi <leonid_komarianskyi@xxxxxxxx> --- Changes in V4: - removed redundant parentheses Changes in V3: - renamed vgic_is_valid_irq to vgic_is_valid_line and vgic_is_shared_irq to vgic_is_spi - added vgic_is_valid_line implementation for new-vgic, because vgic_is_valid_line is called from generic code. It is necessary to fix the build for new-vgic. The comments I provided are addressed (thanks), so you can add my: Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx> [snip]
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |