diff mbox series

[Xen-devel,02/57] ARM: vGICv3: clarify on GUEST_GICV3_RDIST_REGIONS symbol

Message ID 20180305160415.16760-3-andre.przywara@linaro.org
State Superseded
Headers show
Series New VGIC(-v2) implementation | expand

Commit Message

Andre Przywara March 5, 2018, 4:03 p.m. UTC
Normally there is only one GICv3 redistributor region, and we use
that for DomU guests using a GICv3.
Explain the background in a comment and why we need to keep the number
of hardware regions for Dom0.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---
Changelog RFC ... v1:
- Keep GUEST_GICV3_RDIST_REGIONS symbol around, just extend comments

 xen/arch/arm/vgic-v3.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Julien Grall March 5, 2018, 4:40 p.m. UTC | #1
Hi Andre,

On 05/03/18 16:03, Andre Przywara wrote:
> Normally there is only one GICv3 redistributor region, and we use
> that for DomU guests using a GICv3.
> Explain the background in a comment and why we need to keep the number
> of hardware regions for Dom0.
> 
> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

> ---
> Changelog RFC ... v1:
> - Keep GUEST_GICV3_RDIST_REGIONS symbol around, just extend comments
> 
>   xen/arch/arm/vgic-v3.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 2ad8a6be62..d5b34a7d0f 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -1632,6 +1632,16 @@ static int vgic_v3_vcpu_init(struct vcpu *v)
>   
>   static inline unsigned int vgic_v3_rdist_count(struct domain *d)
>   {
> +    /*
> +     * Normally there is only one GICv3 redistributor region.
> +     * The GICv3 DT binding provisions for multiple regions, since there are
> +     * platforms out there which need those (multi-socket systems).
> +     * For Dom0 we have to live with the MMIO layout the hardware provides,
> +     * so we have to copy the multiple regions - as the first region may not
> +     * provide enough space to hold all redistributors we need.
> +     * However DomU get a constructed memory map, so we can go with
> +     * the architected single redistributor region.
> +     */
>       return is_hardware_domain(d) ? vgic_v3_hw.nr_rdist_regions :
>                  GUEST_GICV3_RDIST_REGIONS;
>   }
> @@ -1692,7 +1702,7 @@ static int vgic_v3_domain_init(struct domain *d)
>       {
>           d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
>   
> -        /* XXX: Only one Re-distributor region mapped for the guest */
> +        /* A single Re-distributor region is mapped for the guest. */
>           BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1);
>   
>           d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;
>
diff mbox series

Patch

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 2ad8a6be62..d5b34a7d0f 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1632,6 +1632,16 @@  static int vgic_v3_vcpu_init(struct vcpu *v)
 
 static inline unsigned int vgic_v3_rdist_count(struct domain *d)
 {
+    /*
+     * Normally there is only one GICv3 redistributor region.
+     * The GICv3 DT binding provisions for multiple regions, since there are
+     * platforms out there which need those (multi-socket systems).
+     * For Dom0 we have to live with the MMIO layout the hardware provides,
+     * so we have to copy the multiple regions - as the first region may not
+     * provide enough space to hold all redistributors we need.
+     * However DomU get a constructed memory map, so we can go with
+     * the architected single redistributor region.
+     */
     return is_hardware_domain(d) ? vgic_v3_hw.nr_rdist_regions :
                GUEST_GICV3_RDIST_REGIONS;
 }
@@ -1692,7 +1702,7 @@  static int vgic_v3_domain_init(struct domain *d)
     {
         d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
 
-        /* XXX: Only one Re-distributor region mapped for the guest */
+        /* A single Re-distributor region is mapped for the guest. */
         BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1);
 
         d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;