CVS commit: src/sys/arch/arm/cortex
"Jared D. McNeill" <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module Name: src Committed By: jmcneill Date: Sun May 24 22:00:52 UTC 2026 Modified Files: src/sys/arch/arm/cortex: gicv3_its.c gicv3_its.h Log Message: gicv3_its: Fix ITT sizing. The ITT being allocated did not match the size specified on the MAPD command. This could cause hardware to read past the end of the ITT. The old code used a fixed offset mapping scheme to assign eventIDs (the eventID was derived from the LPI INTID). This scheme is wasteful and doesn't scale well as the ITT is essentially an array of ITEs starting with eventID 0. This change introduces per-deviceID namespaces for eventIDs and allocates them starting with 0. A fixed number of eventIDs is made available for each deviceID (MAXCPUS * 2). On a platform with an ITE size of 8 bytes, this allows the ITT to fit in a single page. The ITT is sized larger than the initial request as multiple requestors could potentially share the same deviceID (this is the case for legacy PCI devices behind a PCIe-to-PCI bridge). The size parameter of the MAPD command now matches the allocated ITT. Tested on QEMU KVM Virtual Machine and Ampere eMAG (Lenovo HR330A). To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/cortex/gicv3_its.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/cortex/gicv3_its.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.