As with r325242 use mp_maxid when iterating over CPUs in the GICv3 driver.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Andrew Turner 2017-10-31 22:12:14 +00:00
parent 651c6845c7
commit 2ed578e1db

View File

@ -343,7 +343,7 @@ gic_v3_detach(device_t dev)
for (rid = 0; rid < (sc->gic_redists.nregions + 1); rid++)
bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->gic_res[rid]);
for (i = 0; i < mp_ncpus; i++)
for (i = 0; i <= mp_maxid; i++)
free(sc->gic_redists.pcpu[i], M_GIC_V3);
free(sc->gic_res, M_GIC_V3);
@ -895,7 +895,7 @@ gic_v3_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus,
val = 0;
/* Iterate through all CPUs in set */
for (i = 0; i < mp_ncpus; i++) {
for (i = 0; i <= mp_maxid; i++) {
/* Move to the next affinity group */
if (aff != GIC_AFFINITY(i)) {
/* Send the IPI */
@ -1103,7 +1103,7 @@ gic_v3_redist_alloc(struct gic_v3_softc *sc)
u_int cpuid;
/* Allocate struct resource for all CPU's Re-Distributor registers */
for (cpuid = 0; cpuid < mp_ncpus; cpuid++)
for (cpuid = 0; cpuid <= mp_maxid; cpuid++)
if (CPU_ISSET(cpuid, &all_cpus) != 0)
sc->gic_redists.pcpu[cpuid] =
malloc(sizeof(*sc->gic_redists.pcpu[0]),