From: Zong Li <zong.li@sifive.com>
To: palmer@dabbelt.com, paul.walmsley@sifive.com,
aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Zong Li <zong.li@sifive.com>
Subject: [PATCH 0/2] riscv: mm: add support for CONFIG_DEBUG_VIRTUAL
Date: Thu, 2 Jan 2020 11:12:38 +0800 [thread overview]
Message-ID: <20200102031240.44484-1-zong.li@sifive.com> (raw)
This patch implements CONFIG_DEBUG_VIRTUAL to do additional checks on
virt_to_phys and __pa_symbol calls. virt_to_phys used for linear mapping
check, and __pa_symbol used for kernel symbol check. In current RISC-V,
kernel image maps to linear mapping area. If CONFIG_DEBUG_VIRTUAL is
disable, these two functions calculate the offset on the address feded
directly without any checks.
Zong Li (2):
riscv: mm: add support for CONFIG_DEBUG_VIRTUAL
riscv: mm: use __pa_symbol for kernel symbols
arch/riscv/Kconfig | 1 +
arch/riscv/include/asm/page.h | 16 +++++++++++++--
arch/riscv/mm/Makefile | 2 ++
arch/riscv/mm/init.c | 12 ++++++------
arch/riscv/mm/physaddr.c | 37 +++++++++++++++++++++++++++++++++++
5 files changed, 60 insertions(+), 8 deletions(-)
create mode 100644 arch/riscv/mm/physaddr.c
--
2.24.1
next reply other threads:[~2020-01-02 3:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-02 3:12 Zong Li [this message]
2020-01-02 3:12 ` [PATCH 1/2] riscv: mm: add support for CONFIG_DEBUG_VIRTUAL Zong Li
2020-01-22 4:38 ` Paul Walmsley
2020-01-02 3:12 ` [PATCH 2/2] riscv: mm: use __pa_symbol for kernel symbols Zong Li
2020-01-02 3:31 ` Anup Patel
2020-01-02 3:49 ` Zong Li
2020-01-04 0:11 ` Paul Walmsley
2020-01-22 21:10 ` [PATCH 1/2] riscv: mm: add support for CONFIG_DEBUG_VIRTUAL Palmer Dabbelt
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=20200102031240.44484-1-zong.li@sifive.com \
--to=zong.li@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@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;
as well as URLs for NNTP newsgroup(s).