From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Ye Liu <ye.liu@linux.dev>, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
rppt@kernel.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, david@redhat.com, harry.yoo@oracle.com,
riel@surriel.com, vbabka@suse.cz, liuye@kylinos.cn
Subject: Re: [PATCH 1/3] mm/io-mapping: precompute remap protection flags for clarity
Date: Mon, 28 Apr 2025 17:45:13 +0530 [thread overview]
Message-ID: <e3ff5b41-85ed-4a42-aaf0-ab4f16006aab@arm.com> (raw)
In-Reply-To: <20250427100442.958352-2-ye.liu@linux.dev>
On 4/27/25 15:34, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
>
> In io_mapping_map_user(), precompute the page protection flags in a local
> variable before calling remap_pfn_range_notrack().
>
> No functional change.
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> ---
> mm/io-mapping.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/mm/io-mapping.c b/mm/io-mapping.c
> index 01b362799930..f44a6a134712 100644
> --- a/mm/io-mapping.c
> +++ b/mm/io-mapping.c
> @@ -21,9 +21,10 @@ int io_mapping_map_user(struct io_mapping *iomap, struct vm_area_struct *vma,
> if (WARN_ON_ONCE((vma->vm_flags & expected_flags) != expected_flags))
> return -EINVAL;
>
> + pgprot_t remap_prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> + (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK));
> +
> /* We rely on prevalidation of the io-mapping to skip track_pfn(). */
> - return remap_pfn_range_notrack(vma, addr, pfn, size,
> - __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) |
> - (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK)));
> + return remap_pfn_range_notrack(vma, addr, pfn, size, remap_prot);
> }
> EXPORT_SYMBOL_GPL(io_mapping_map_user);
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
next prev parent reply other threads:[~2025-04-28 12:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 10:04 [PATCH 0/3] mm: small cleanups for io-mapping, debug_page_alloc and numa Ye Liu
2025-04-27 10:04 ` [PATCH 1/3] mm/io-mapping: precompute remap protection flags for clarity Ye Liu
2025-04-28 7:18 ` David Hildenbrand
2025-04-28 12:15 ` Anshuman Khandual [this message]
2025-04-29 6:33 ` Mike Rapoport
2025-04-27 10:04 ` [PATCH 2/3] mm/debug_page_alloc: improve error message for invalid guardpage minorder Ye Liu
2025-04-28 7:21 ` David Hildenbrand
2025-04-28 12:24 ` Anshuman Khandual
2025-04-29 7:29 ` Mike Rapoport
2025-04-27 10:04 ` [PATCH 3/3] mm/numa: remove unnecessary local variable in alloc_node_data() Ye Liu
2025-04-28 7:22 ` David Hildenbrand
2025-04-29 4:03 ` Anshuman Khandual
2025-04-29 6:32 ` Mike Rapoport
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=e3ff5b41-85ed-4a42-aaf0-ab4f16006aab@arm.com \
--to=anshuman.khandual@arm.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=lorenzo.stoakes@oracle.com \
--cc=riel@surriel.com \
--cc=rppt@kernel.org \
--cc=vbabka@suse.cz \
--cc=ye.liu@linux.dev \
/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