[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] ARM: GICv3: copy Dom0 GICv3 reg property from host DT



Hi Andre,

On 30/01/18 09:35, Andre Przywara wrote:
@@ -1173,27 +1172,21 @@ static int gicv3_make_hwdom_dt_node(const struct domain 
*d,
      if ( res )
          return res;
- len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
+    new_len = dt_cells_to_size(dt_n_addr_cells(gic) + dt_n_size_cells(gic));
      /*
       * GIC has two memory regions: Distributor + rdist regions
       * CPU interface and virtual cpu interfaces accessesed as System registers
       * So cells are created only for Distributor and rdist regions
       */
-    len = len * (d->arch.vgic.nr_regions + 1);
-    new_cells = xzalloc_bytes(len);
-    if ( new_cells == NULL )
-        return -FDT_ERR_XEN(ENOMEM);
-
-    tmp = new_cells;
-
-    dt_set_range(&tmp, gic, d->arch.vgic.dbase, SZ_64K);
+    new_len = new_len * (d->arch.vgic.nr_regions + 1);
- for ( i = 0; i < d->arch.vgic.nr_regions; i++ )
-        dt_set_range(&tmp, gic, d->arch.vgic.rdist_regions[i].base,
-                     d->arch.vgic.rdist_regions[i].size);
+    hw_reg = dt_get_property(gic, "reg", &len);
+    if ( !hw_reg )
+        return -FDT_ERR_XEN(ENOENT);
+    if ( new_len > len )
+       return -FDT_ERR_XEN(ERANGE);

The indentation looks wrong here.

With that fixed:

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

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.