Re: [PATCH 2/3] irqchip/gic-v3: allocate one SGI for MSHV

Wei Liu
2025-11-26T22:25:19Z

On Tue, Nov 25, 2025 at 05:01:23PM +0000, Anirudh Raybharam wrote:
> From: Anirudh Rayabharam <anirudh@anirudhrb.com>
[...]
> /* SMCCC hypercall parameters */
> #define HV_SMCCC_FUNC_NUMBER 1
> #define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 3de351e66ee8..56013dd0564c 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -35,6 +35,7 @@
> #include <asm/exception.h>
> #include <asm/smp_plat.h>
> #include <asm/virt.h>
> +#include <asm/mshyperv.h>
>
> #include "irq-gic-common.h"
>
> @@ -1456,8 +1457,24 @@ static void __init gic_smp_init(void)
> .fwnode = gic_data.fwnode,
> .param_count = 1,
> };
> + /* Register all 8 non-secure SGIs */
> + const int NR_SMP_SGIS = 8;
> + int nr_sgis = NR_SMP_SGIS;
> int base_sgi;
>
> + /*
> + * Allocate one more SGI for use by Hyper-V. This is only needed when
> + * Linux is running in a parent partition. Hyper-V will use this interrupt
> + * to notify the parent partition of intercepts.
> + *
> + * When running on Hyper-V, it is okay to use SGIs 8-15. They're not reserved
> + * for secure firmware.
> + */
> +#if IS_ENABLED(CONFIG_HYPERV)
> + if (hv_parent_partition())
> + nr_sgis += 1;
> +#endif
> +

This is far too intrusive. Let's take Marc's feedback and work with the
hypervisor team to resolve this properly.

Wei