From: Alexandre Ghiti <alex@ghiti.fr>
To: Charlie Jenkins <charlie@rivosinc.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: conor@kernel.org, paul.walmsley@sifive.com, palmer@rivosinc.com,
aou@eecs.berkeley.edu, anup@brainfault.org,
konstantin@linuxfoundation.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
mick@ics.forth.gr, jrtc27@jrtc27.com, rdunlap@infradead.org,
alexghiti@rivosinc.com
Subject: Re: [PATCH v8 4/4] RISC-V: mm: Document mmap changes
Date: Sun, 6 Aug 2023 12:08:52 +0200 [thread overview]
Message-ID: <a8a282a3-0530-e1c0-ab54-de302236ce8a@ghiti.fr> (raw)
In-Reply-To: <20230727212647.4182407-5-charlie@rivosinc.com>
On 27/07/2023 23:26, Charlie Jenkins wrote:
> The behavior of mmap is modified with this patch series, so explain the
> changes to the mmap hint address behavior.
>
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> ---
> Documentation/riscv/vm-layout.rst | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/Documentation/riscv/vm-layout.rst b/Documentation/riscv/vm-layout.rst
> index 5462c84f4723..69ff6da1dbf8 100644
> --- a/Documentation/riscv/vm-layout.rst
> +++ b/Documentation/riscv/vm-layout.rst
> @@ -133,3 +133,25 @@ RISC-V Linux Kernel SV57
> ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF
> ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel
> __________________|____________|__________________|_________|____________________________________________________________
> +
> +
> +Userspace VAs
> +--------------------
> +To maintain compatibility with software that relies on the VA space with a
> +maximum of 48 bits the kernel will, by default, return virtual addresses to
> +userspace from a 48-bit range (sv48). This default behavior is achieved by
> +passing 0 into the hint address parameter of mmap. On CPUs with an address space
> +smaller than sv48, the CPU maximum supported address space will be the default.
> +
> +Software can "opt-in" to receiving VAs from another VA space by providing
> +a hint address to mmap. A hint address passed to mmap will cause the largest
> +address space that fits entirely into the hint to be used, unless there is no
> +space left in the address space. If there is no space available in the requested
> +address space, an address in the next smallest available address space will be
> +returned.
> +
> +For example, in order to obtain 48-bit VA space, a hint address greater than
> +:code:`1 << 47` must be provided. Note that this is 47 due to sv48 userspace
> +ending at :code:`1 << 47` and the addresses beyond this are reserved for the
> +kernel. Similarly, to obtain 57-bit VA space addresses, a hint address greater
> +than or equal to :code:`1 << 56` must be provided.
You can add:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks,
Alex
prev parent reply other threads:[~2023-08-06 10:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 21:26 [PATCH v8 0/4] RISC-V: mm: Make SV48 the default address space Charlie Jenkins
2023-07-27 21:26 ` [PATCH v8 1/4] RISC-V: mm: Restrict address space for sv39,sv48,sv57 Charlie Jenkins
2023-08-06 9:53 ` Alexandre Ghiti
2023-08-07 21:12 ` Charlie Jenkins
2023-07-27 21:26 ` [PATCH v8 2/4] RISC-V: mm: Add tests for RISC-V mm Charlie Jenkins
2023-08-06 10:06 ` Alexandre Ghiti
2023-08-07 17:53 ` Charlie Jenkins
2023-07-27 21:26 ` [PATCH v8 3/4] RISC-V: mm: Update pgtable comment documentation Charlie Jenkins
2023-07-27 21:26 ` [PATCH v8 4/4] RISC-V: mm: Document mmap changes Charlie Jenkins
2023-08-06 10:08 ` Alexandre Ghiti [this message]
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=a8a282a3-0530-e1c0-ab54-de302236ce8a@ghiti.fr \
--to=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=charlie@rivosinc.com \
--cc=conor@kernel.org \
--cc=jrtc27@jrtc27.com \
--cc=konstantin@linuxfoundation.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mick@ics.forth.gr \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=rdunlap@infradead.org \
/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®