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

Re: [XEN PATCH 1/4] arm/gicv3: Move guest dist base



Hi,

On 25/10/2023 11:13, Mykyta Poturai wrote:
New vgic code relies on lower address bits to calculate intid from > the 
address offset. 0x03001000 as DIST_BASE overlaps with
VGIC_ADDR_IRQ_MASK when bits_per_irq >= 64, breaking the intid calculation.
Move DIST_BASE to a safer location to fix this.

I am a bit confused, you are referring to vGICv3 in the title but the commit message is generic enough and vGICv2 already seem to use the macro. In fact, the value for the distributor base is actualy the same as GICv3. So is this a bug for GICv2 as well? If not, can you provide more details why?

Lastly, we can control the address for a guest but not for dom0. So wouldn't it be a problem for dom0 as well? This would mean the code needs to be fixed rather than the guest GICv3 distributor base changed.

Cheers,


Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
  xen/include/public/arch-arm.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index a25e87dbda..71fa25b1d4 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -438,7 +438,7 @@ typedef uint64_t xen_callback_t;
  #define GUEST_GICC_SIZE   xen_mk_ullong(0x00002000)
/* vGIC v3 mappings */
-#define GUEST_GICV3_GICD_BASE      xen_mk_ullong(0x03001000)
+#define GUEST_GICV3_GICD_BASE      xen_mk_ullong(0x03000000)
  #define GUEST_GICV3_GICD_SIZE      xen_mk_ullong(0x00010000)
#define GUEST_GICV3_RDIST_REGIONS 1

--
Julien Grall



 


Rackspace

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