From: Michael Brown Date: Mon, 27 Oct 2025 14:02:50 +0000 (+0000) Subject: [librm] Correct page table stride calculation X-Git-Tag: rolling/bin~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=426c721e32c32b084146eaf7ef90f138232f3efa;p=thirdparty%2Fipxe.git [librm] Correct page table stride calculation Signed-off-by: Michael Brown --- diff --git a/src/arch/x86/transitions/librm_mgmt.c b/src/arch/x86/transitions/librm_mgmt.c index 77aecdb7d..e51f0e649 100644 --- a/src/arch/x86/transitions/librm_mgmt.c +++ b/src/arch/x86/transitions/librm_mgmt.c @@ -307,7 +307,7 @@ static void * ioremap_pages ( unsigned long bus_addr, size_t len ) { sizeof ( io_pages.page[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 */