[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1621839068-31738-2-git-send-email-guoren@kernel.org>
Date: Mon, 24 May 2021 06:51:07 +0000
From: guoren@...nel.org
To: guoren@...nel.org, anup.patel@....com, palmerdabbelt@...gle.com,
arnd@...db.de
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-sunxi@...ts.linux.dev,
Guo Ren <guoren@...ux.alibaba.com>
Subject: [PATCH 2/3] riscv: Fixup PAGE_UP in asm/page.h
From: Guo Ren <guoren@...ux.alibaba.com>
Current PAGE_UP implementation is wrong. PAGE_UP(0) should be
0x1000, but current implementation will give out 0.
Although the current PAGE_UP isn't used, it will soon be used in
tlb_flush optimization.
Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
Cc: Anup Patel <anup.patel@....com>
Cc: Palmer Dabbelt <palmerdabbelt@...gle.com>
---
arch/riscv/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h
index 6a7761c..c611b20 100644
--- a/arch/riscv/include/asm/page.h
+++ b/arch/riscv/include/asm/page.h
@@ -37,7 +37,7 @@
#ifndef __ASSEMBLY__
-#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
+#define PAGE_UP(addr) (((addr)+(PAGE_SIZE))&(~((PAGE_SIZE)-1)))
#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
/* align addr on a size boundary - adjust address up/down if needed */
--
2.7.4
Powered by blists - more mailing lists