From ec02834f489a4bcc74eaedbaad61a9a6ce1c4ca9 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Mon, 5 Dec 2016 13:55:22 -0500 Subject: [PATCH] The 32-bit MIPS PGD_ORDER() macro expects __PGD_ORDER to be signed, which it isn't now since the internal machdep->pagesize is unsigned. Without this patch, module loading fails during initialization on a kernel that has a page size of 16KB, with messages that indicate "please wait... (gathering module symbol data)" followed by "crash: invalid size request: 0 type: pgd page". (rabinv@axis.com) --- mips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mips.c b/mips.c index 30e62550..f73dfadd 100644 --- a/mips.c +++ b/mips.c @@ -28,7 +28,7 @@ typedef ulong pte_t; #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) -#define __PGD_ORDER (32 - 3 * PAGESHIFT() + PGD_T_LOG2 + PTE_T_LOG2) +#define __PGD_ORDER (32 - 3 * (int)PAGESHIFT() + PGD_T_LOG2 + PTE_T_LOG2) #define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0) #define PGD_SIZE (PAGESIZE() << PGD_ORDER)