git: 98ee3bb87a7a - stable/13 - arm64/gicv3: correct the size of the distributor resource

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Wed, 12 Apr 2023 17:10:40 UTC
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=98ee3bb87a7a46b2ecae96159258632b8f6f3520

commit 98ee3bb87a7a46b2ecae96159258632b8f6f3520
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2023-03-31 15:32:39 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-04-12 17:08:38 +0000

    arm64/gicv3: correct the size of the distributor resource
    
    Use the GICD_SIZE macro (0x10000), which is half the size of the current
    fixed-sized mapping (128 * 1024 == 0x20000).
    
    In ARM64 Hyper-V instances, it seems the Distributor's registers are
    located immediately preceding a range of physical memory in the bus
    address space. Thus, when ram0 is attaching and attempts to reserve
    SYS_RES_MEMORY resources corresponding to its physmem ranges, it fails,
    because the first 0x10000 bytes of this range are already owned by gic0.
    
    PR:             270415
    Reported by:    whu
    Tested by:      whu
    Differential Revision:  https://reviews.freebsd.org/D39260
    
    (cherry picked from commit 3462c371c2562a8144f4245f9967df99874e505f)
---
 sys/arm64/arm64/gic_v3_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c
index 9aaf9a783868..568e796a60cb 100644
--- a/sys/arm64/arm64/gic_v3_acpi.c
+++ b/sys/arm64/arm64/gic_v3_acpi.c
@@ -210,7 +210,7 @@ gic_v3_acpi_identify(driver_t *driver, device_t parent)
 
 	/* Add the MADT data */
 	BUS_SET_RESOURCE(parent, dev, SYS_RES_MEMORY, 0,
-	    madt_data.dist->BaseAddress, 128 * 1024);
+	    madt_data.dist->BaseAddress, GICD_SIZE);
 
 	madt_data.dev = dev;
 	madt_data.rdist_use_gicc = false;