@@ -21,6 +21,7 @@
#include <xen/list.h>
#include <xen/mm.h>
#include <xen/spinlock.h>
+#include <asm/gic_v3_defs.h>
#define VGIC_V3_MAX_CPUS 255
#define VGIC_V2_MAX_CPUS 8
@@ -136,6 +137,10 @@ struct vgic_dist {
paddr_t csize; /* CPU interface size */
paddr_t vbase; /* virtual CPU interface base address */
+ /* for compatibility with guests DT creation*/
+ uint32_t nr_regions;
+ struct rdist_region *rdist_regions;
+
/* distributor enabled */
bool enabled;
@@ -257,6 +257,10 @@ int vgic_v3_map_resources(struct domain *d)
/* Allocate memory for Re-distributor regions */
rdist_count = vgic_v3_max_rdist_count(d);
+ /*For compatibility with hwdom dt node creation*/
+ d->arch.vgic.nr_regions = rdist_count;
+ d->arch.vgic.rdist_regions = xzalloc_array(struct rdist_region, rdist_count);
+
/*
* For domain using the host memory layout, it gets the hardware
* address.
@@ -268,6 +272,8 @@ int vgic_v3_map_resources(struct domain *d)
for ( i = 0; i < vgic_v3_hw_data.nr_rdist_regions; i++ )
{
+ d->arch.vgic.rdist_regions[i].base = vgic_v3_hw_data.regions[i].base;
+ d->arch.vgic.rdist_regions[i].size = vgic_v3_hw_data.regions[i].size;
vgic_v3_set_redist_base(d, i, vgic_v3_hw_data.regions[i].base,
vgic_v3_hw_data.regions[i].size /
GICV3_GICR_SIZE);
@@ -276,6 +282,8 @@ int vgic_v3_map_resources(struct domain *d)
else
{
d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
+ d->arch.vgic.rdist_regions[0].base = GUEST_GICV3_GICR0_BASE;
+ d->arch.vgic.rdist_regions[0].size = GUEST_GICV3_GICR0_SIZE;
/* A single Re-distributor region is mapped for the guest. */
BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1);
Guests DT creation requires redist regions to be stored in the specific variables in struct vgic_dist. But in new VGIC a linked list is used for that. To not clutter the DT creation code with ifdefs, add alternative storage for redist regions in struct vgic_dist. Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com> --- xen/arch/arm/include/asm/new_vgic.h | 5 +++++ xen/arch/arm/vgic/vgic-v3.c | 8 ++++++++ 2 files changed, 13 insertions(+)