diff mbox series

[XEN,2/4] arm/vgic: Move get/put irq to a wider scope

Message ID 89ca664d00a3cdcf3f68d8ae0c4a6c7b76965120.1698225630.git.mykyta_poturai@epam.com (mailing list archive)
State Superseded
Headers show
Series arm: Add GICv3 support to the New VGIC | expand

Commit Message

Mykyta Poturai Oct. 25, 2023, 10:13 a.m. UTC
We will need GICv3 code to access get/put irq to inject LPIs for new
VGIC similar to how the old one uses irq_to_pending now. So move
get/put irq to the same header file.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
 xen/arch/arm/include/asm/vgic.h | 6 ++++++
 xen/arch/arm/vgic/vgic.h        | 3 ---
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Wei Chen Oct. 26, 2023, 9:25 a.m. UTC | #1
Hi Mykyta,


On 2023/10/25 18:13, Mykyta Poturai wrote:
> We will need GICv3 code to access get/put irq to inject LPIs for new
> VGIC similar to how the old one uses irq_to_pending now. So move
> get/put irq to the same header file.
> 
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
> ---
>   xen/arch/arm/include/asm/vgic.h | 6 ++++++
>   xen/arch/arm/vgic/vgic.h        | 3 ---
>   2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
> index 922779ce14..7216ce82b7 100644
> --- a/xen/arch/arm/include/asm/vgic.h
> +++ b/xen/arch/arm/include/asm/vgic.h
> @@ -387,6 +387,12 @@ void vgic_sync_from_lrs(struct vcpu *v);
>   
>   int vgic_vcpu_pending_irq(struct vcpu *v);
>   
> +#ifdef CONFIG_NEW_VGIC
> +struct vgic_irq *vgic_get_irq(struct domain *d, struct vcpu *vcpu,
> +                              uint32_t intid);
> +void vgic_put_irq(struct domain *d, struct vgic_irq *irq);
> +#endif
> +

When we move the put/get here and protect it with the CONFIG_NEW_VGIC, 
will the irq_to_pending also become invalid?
Similar to:
#if CONFIG_NEW_VGIC
struct vgic_irq *vgic_get_irq(struct domain *d, struct vcpu *vcpu,
                               uint32_t intid);
void vgic_put_irq(struct domain *d, struct vgic_irq *irq);
#else
extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
#endif

If so, subsequent changes to this file will be confusing. Can we add a 
wrapper header file and include the specific vgic implementation header 
file through the CONFIG_NEW_VGIC macro?

Cheers,
Wei Chen

>   #endif /* __ASM_ARM_VGIC_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/vgic/vgic.h b/xen/arch/arm/vgic/vgic.h
> index 534b24bcd3..c6bc3509a5 100644
> --- a/xen/arch/arm/vgic/vgic.h
> +++ b/xen/arch/arm/vgic/vgic.h
> @@ -45,9 +45,6 @@ static inline bool vgic_irq_is_mapped_level(struct vgic_irq *irq)
>       return irq->config == VGIC_CONFIG_LEVEL && irq->hw;
>   }
>   
> -struct vgic_irq *vgic_get_irq(struct domain *d, struct vcpu *vcpu,
> -                              uint32_t intid);
> -void vgic_put_irq(struct domain *d, struct vgic_irq *irq);
>   void vgic_queue_irq_unlock(struct domain *d, struct vgic_irq *irq,
>                              unsigned long flags);
>   void vgic_kick_vcpus(struct domain *d);
diff mbox series

Patch

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 922779ce14..7216ce82b7 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -387,6 +387,12 @@  void vgic_sync_from_lrs(struct vcpu *v);
 
 int vgic_vcpu_pending_irq(struct vcpu *v);
 
+#ifdef CONFIG_NEW_VGIC
+struct vgic_irq *vgic_get_irq(struct domain *d, struct vcpu *vcpu,
+                              uint32_t intid);
+void vgic_put_irq(struct domain *d, struct vgic_irq *irq);
+#endif
+
 #endif /* __ASM_ARM_VGIC_H__ */
 
 /*
diff --git a/xen/arch/arm/vgic/vgic.h b/xen/arch/arm/vgic/vgic.h
index 534b24bcd3..c6bc3509a5 100644
--- a/xen/arch/arm/vgic/vgic.h
+++ b/xen/arch/arm/vgic/vgic.h
@@ -45,9 +45,6 @@  static inline bool vgic_irq_is_mapped_level(struct vgic_irq *irq)
     return irq->config == VGIC_CONFIG_LEVEL && irq->hw;
 }
 
-struct vgic_irq *vgic_get_irq(struct domain *d, struct vcpu *vcpu,
-                              uint32_t intid);
-void vgic_put_irq(struct domain *d, struct vgic_irq *irq);
 void vgic_queue_irq_unlock(struct domain *d, struct vgic_irq *irq,
                            unsigned long flags);
 void vgic_kick_vcpus(struct domain *d);