From: Michael Brown Date: Mon, 27 Oct 2025 14:04:08 +0000 (+0000) Subject: [riscv] Correct page table stride calculation X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ddd83069363f411881442857d5971654638a986;p=thirdparty%2Fipxe.git [riscv] Correct page table stride calculation Signed-off-by: Michael Brown --- diff --git a/src/arch/riscv/core/svpage.c b/src/arch/riscv/core/svpage.c index 0728289b0..c0fa8b445 100644 --- a/src/arch/riscv/core/svpage.c +++ b/src/arch/riscv/core/svpage.c @@ -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 */