]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[riscv] Correct page table stride calculation
authorMichael Brown <mcb30@ipxe.org>
Mon, 27 Oct 2025 14:04:08 +0000 (14:04 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 27 Oct 2025 14:22:16 +0000 (14:22 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/riscv/core/svpage.c

index 0728289b0df2e6b26d254c3833ce4db4ad3107e4..c0fa8b4452be21697085a898d4fd932ddf03759c 100644 (file)
@@ -150,7 +150,7 @@ static void * svpage_map ( physaddr_t phys, size_t len, unsigned long attrs ) {
                           sizeof ( page_table.pte[0] ) ) );
 
        /* Round up number of pages to a power of two */
-       stride = ( 1 << ( fls ( count ) - 1 ) );
+       stride = ( 1 << fls ( count - 1 ) );
        assert ( count <= stride );
 
        /* Allocate pages */