From: Jisheng Zhang <jszhang@kernel.org>
To: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: Make vmalloc/vmemmap end equal to the start of the next region
Date: Tue, 7 Dec 2021 00:12:50 +0800 [thread overview]
Message-ID: <20211206162029.AD0E6C341C1@smtp.kernel.org> (raw)
In-Reply-To: <20211118134539.137212-1-alexandre.ghiti@canonical.com>
On Thu, 18 Nov 2021 14:45:39 +0100
Alexandre Ghiti <alexandre.ghiti@canonical.com> wrote:
> We used to define VMALLOC_END equal to the start of the next region
> *minus one* which is inconsistent with the use of this define in the
> core code (for example, see the definitions of VMALLOC_TOTAL and
> is_vmalloc_addr).
>
> And then make the definition of VMEMMAP_END consistent with VMALLOC_END
> and all other regions actually.
>
> Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> arch/riscv/include/asm/pgtable.h | 4 ++--
> arch/riscv/mm/fault.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
> index d34f3a7a9701..5155048274c2 100644
> --- a/arch/riscv/include/asm/pgtable.h
> +++ b/arch/riscv/include/asm/pgtable.h
> @@ -25,7 +25,7 @@
> #endif
>
> #define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
> -#define VMALLOC_END (PAGE_OFFSET - 1)
> +#define VMALLOC_END PAGE_OFFSET
> #define VMALLOC_START (PAGE_OFFSET - VMALLOC_SIZE)
>
> #define BPF_JIT_REGION_SIZE (SZ_128M)
> @@ -53,7 +53,7 @@
> #define VMEMMAP_SHIFT \
> (CONFIG_VA_BITS - PAGE_SHIFT - 1 + STRUCT_PAGE_MAX_SHIFT)
> #define VMEMMAP_SIZE BIT(VMEMMAP_SHIFT)
> -#define VMEMMAP_END (VMALLOC_START - 1)
> +#define VMEMMAP_END VMALLOC_START
> #define VMEMMAP_START (VMALLOC_START - VMEMMAP_SIZE)
>
> /*
> diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c
> index aa08dd2f8fae..41ae0aa8f2b8 100644
> --- a/arch/riscv/mm/fault.c
> +++ b/arch/riscv/mm/fault.c
> @@ -235,7 +235,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
> * only copy the information from the master page table,
> * nothing more.
> */
> - if (unlikely((addr >= VMALLOC_START) && (addr <= VMALLOC_END))) {
> + if (unlikely((addr >= VMALLOC_START) && (addr < VMALLOC_END))) {
> vmalloc_fault(regs, code, addr);
> return;
> }
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2021-12-06 16:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 13:45 [PATCH] riscv: Make vmalloc/vmemmap end equal to the start of the next region Alexandre Ghiti
2021-12-06 16:12 ` Jisheng Zhang [this message]
2022-01-06 4:00 ` 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=20211206162029.AD0E6C341C1@smtp.kernel.org \
--to=jszhang@kernel.org \
--cc=alexandre.ghiti@canonical.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