From: Song Shuai <suagrfillet@gmail.com>
To: paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, akpm@linux-foundation.org,
guoren@kernel.org, alexghiti@rivosinc.com,
sergey.matyukevich@syntacore.com, david@redhat.com,
wangkefeng.wang@huawei.com, panqinglin2020@iscas.ac.cn,
woodrow.shen@sifive.com
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Song Shuai <suagrfillet@gmail.com>
Subject: [PATCH] riscv: Correct the MODULES_VADDR
Date: Tue, 1 Aug 2023 19:10:14 +0800 [thread overview]
Message-ID: <20230801111014.1432679-1-suagrfillet@gmail.com> (raw)
As Documentation/riscv/vm-layout.rst describes, the 2G-sized "modules, BPF"
area should lie right before the "kernel" area. But the current definition
of MODULES_VADDR isn't consistent with that, so correct it.
Before this patch, the size of "modules" from print_vm_layout() is not 2G.
[ 0.000000] modules : 0xffffffff2ff2f000 - 0xffffffffae600000 (2022 MB)
[ 0.000000] lowmem : 0xff60000000000000 - 0xff60000040000000 (1024 MB)
[ 0.000000] kernel : 0xffffffffae600000 - 0xffffffffffffffff (1305 MB)
After this patch, the size is 2G.
[ 0.000000] modules : 0xffffffff3a000000 - 0xffffffffba000000 (2048 MB)
[ 0.000000] lowmem : 0xff60000000000000 - 0xff60000040000000 (1024 MB)
[ 0.000000] kernel : 0xffffffffba000000 - 0xffffffffffffffff (1119 MB)
Signed-off-by: Song Shuai <suagrfillet@gmail.com>
---
arch/riscv/include/asm/pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 75970ee2bda2..7c57e17fc758 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -53,8 +53,8 @@
#ifdef CONFIG_64BIT
/* This is used to define the end of the KASAN shadow region */
#define MODULES_LOWEST_VADDR (KERNEL_LINK_ADDR - SZ_2G)
-#define MODULES_VADDR (PFN_ALIGN((unsigned long)&_end) - SZ_2G)
#define MODULES_END (PFN_ALIGN((unsigned long)&_start))
+#define MODULES_VADDR (MODULES_END - SZ_2G)
#endif
/*
--
2.20.1
next reply other threads:[~2023-08-01 11:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 11:10 Song Shuai [this message]
2023-08-01 12:05 ` Alexandre Ghiti
2023-08-01 23:20 ` Guo Ren
2023-08-02 1:05 ` Song Shuai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801111014.1432679-1-suagrfillet@gmail.com \
--to=suagrfillet@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=david@redhat.com \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=panqinglin2020@iscas.ac.cn \
--cc=paul.walmsley@sifive.com \
--cc=sergey.matyukevich@syntacore.com \
--cc=wangkefeng.wang@huawei.com \
--cc=woodrow.shen@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®