The branch main has been updated by cperciva:

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

commit a1759dca96748648a6da5f9ebd14e46836eed45e
Author:     Colin Percival <cperc...@freebsd.org>
AuthorDate: 2025-03-27 20:23:32 +0000
Commit:     Colin Percival <cperc...@freebsd.org>
CommitDate: 2025-03-28 17:58:19 +0000

    arm64: Fix off-by-one in its_init_cpu_lpi
    
    The low bits of GICR_PROPBASER are defined as
      The number of bits of LPI INTID supported, minus one, by the LPI
      Configuration table starting at Physical_Address.
    but flsl(1 << n) returns n + 1; use ilog2_long instead.
    
    PR:     285677
    Reported by:    Julien Grall
    Reviewed by:    andrew
    Sponsored by:   Amazon
    Differential Revision:  https://reviews.freebsd.org/D49542
---
 sys/arm64/arm64/gicv3_its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c
index 77d1936d8c95..546a225abf09 100644
--- a/sys/arm64/arm64/gicv3_its.c
+++ b/sys/arm64/arm64/gicv3_its.c
@@ -801,7 +801,7 @@ its_init_cpu_lpi(device_t dev, struct gicv3_its_softc *sc)
                /* Make sure changes are observable my the GIC */
                dsb(sy);
 
-               size = (flsl(LPI_CONFTAB_SIZE | GIC_FIRST_LPI) - 1);
+               size = ilog2_long(LPI_CONFTAB_SIZE | GIC_FIRST_LPI) - 1;
 
                xbaser = vtophys(sc->sc_conf_base) |
                    (GICR_PROPBASER_SHARE_IS << GICR_PROPBASER_SHARE_SHIFT) |

Reply via email to