From: Vincent Donnefort <vdonnefort@google.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: catalin.marinas@arm.com, will@kernel.org,
akpm@linux-foundation.org, sudeep.holla@kernel.org,
jenswi@kernel.org, robh@kernel.org, mark.rutland@arm.com,
sumit.garg@kernel.org, ardb@kernel.org,
thierry.reding@kernel.org, david@kernel.org,
danielmentz@google.com, linux-arm-kernel@lists.infradead.org,
linux-mm@kvack.org, op-tee@lists.trustedfirmware.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 03/10] set_memory.h: Introduce can_set_direct_map_range()
Date: Mon, 7 Sep 2026 10:52:43 +0100 [thread overview]
Message-ID: <ap6Ja02S5IDqWRHC@google.com> (raw)
In-Reply-To: <ap3BVr5hHwA499gu@kernel.org>
On Sun, Sep 06, 2026 at 10:39:02PM +0300, Mike Rapoport wrote:
> On Wed, Sep 02, 2026 at 11:47:05AM +0100, Vincent Donnefort wrote:
> > While can_set_direct_map() tells whether the direct map can be modified
> > globally, can_set_direct_map_range() checks if a specific range can be
> > modified. e.g. if mapped at PTE-level.
>
> set_direct_map are going to have number of pages parameter soon:
>
> https://lore.kernel.org/all/20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org
>
> so this check can be a part of arm64::set_direct_map
ack.
>
> I wouldn't expose can_set_direct_map_range() as a public API and rely on
> the callers to "Do The Right Thing".
ack.
Thanks for having a look at the series.
--
Vincent
>
> > Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> >
> > diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h
> > index 3030d9245f5a..88175c3fa751 100644
> > --- a/include/linux/set_memory.h
> > +++ b/include/linux/set_memory.h
> > @@ -44,6 +44,12 @@ static inline bool kernel_page_present(struct page *page)
> > {
> > return true;
> > }
> > +
> > +static inline bool can_set_direct_map_range(struct page *page,
> > + unsigned long nr_pages)
> > +{
> > + return false;
> > +}
> > #else /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
> > /*
> > * Some architectures, e.g. ARM64 can disable direct map modifications at
> > @@ -56,6 +62,14 @@ static inline bool can_set_direct_map(void)
> > }
> > #define can_set_direct_map can_set_direct_map
> > #endif
> > +
> > +#ifndef can_set_direct_map_range
> > +static inline bool can_set_direct_map_range(struct page *page, unsigned long nr_pages)
> > +{
> > + return can_set_direct_map();
> > +}
> > +#define can_set_direct_map_range can_set_direct_map_range
> > +#endif
> > #endif /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
> >
> > #ifdef CONFIG_X86_64
> > --
> > 2.55.0.970.g62bdec98f9-goog
> >
>
> --
> Sincerely yours,
> Mike.
WARNING: multiple messages have this Message-ID (diff)
From: Vincent Donnefort via OP-TEE <op-tee@lists.trustedfirmware.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: catalin.marinas@arm.com, will@kernel.org,
akpm@linux-foundation.org, sudeep.holla@kernel.org,
jenswi@kernel.org, robh@kernel.org, mark.rutland@arm.com,
sumit.garg@kernel.org, ardb@kernel.org,
thierry.reding@kernel.org, david@kernel.org,
danielmentz@google.com, linux-arm-kernel@lists.infradead.org,
linux-mm@kvack.org, op-tee@lists.trustedfirmware.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 03/10] set_memory.h: Introduce can_set_direct_map_range()
Date: Mon, 7 Sep 2026 10:52:43 +0100 [thread overview]
Message-ID: <ap6Ja02S5IDqWRHC@google.com> (raw)
In-Reply-To: <ap3BVr5hHwA499gu@kernel.org>
On Sun, Sep 06, 2026 at 10:39:02PM +0300, Mike Rapoport wrote:
> On Wed, Sep 02, 2026 at 11:47:05AM +0100, Vincent Donnefort wrote:
> > While can_set_direct_map() tells whether the direct map can be modified
> > globally, can_set_direct_map_range() checks if a specific range can be
> > modified. e.g. if mapped at PTE-level.
>
> set_direct_map are going to have number of pages parameter soon:
>
> https://lore.kernel.org/all/20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org
>
> so this check can be a part of arm64::set_direct_map
ack.
>
> I wouldn't expose can_set_direct_map_range() as a public API and rely on
> the callers to "Do The Right Thing".
ack.
Thanks for having a look at the series.
--
Vincent
>
> > Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> >
> > diff --git a/include/linux/set_memory.h b/include/linux/set_memory.h
> > index 3030d9245f5a..88175c3fa751 100644
> > --- a/include/linux/set_memory.h
> > +++ b/include/linux/set_memory.h
> > @@ -44,6 +44,12 @@ static inline bool kernel_page_present(struct page *page)
> > {
> > return true;
> > }
> > +
> > +static inline bool can_set_direct_map_range(struct page *page,
> > + unsigned long nr_pages)
> > +{
> > + return false;
> > +}
> > #else /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
> > /*
> > * Some architectures, e.g. ARM64 can disable direct map modifications at
> > @@ -56,6 +62,14 @@ static inline bool can_set_direct_map(void)
> > }
> > #define can_set_direct_map can_set_direct_map
> > #endif
> > +
> > +#ifndef can_set_direct_map_range
> > +static inline bool can_set_direct_map_range(struct page *page, unsigned long nr_pages)
> > +{
> > + return can_set_direct_map();
> > +}
> > +#define can_set_direct_map_range can_set_direct_map_range
> > +#endif
> > #endif /* CONFIG_ARCH_HAS_SET_DIRECT_MAP */
> >
> > #ifdef CONFIG_X86_64
> > --
> > 2.55.0.970.g62bdec98f9-goog
> >
>
> --
> Sincerely yours,
> Mike.
next prev parent reply other threads:[~2026-09-07 9:52 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:47 [PATCH v9 00/10] arm64: Unmap FF-A lent memory from direct map Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 01/10] memblock: Introduce MEMBLOCK_LLMAP Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-06 19:33 ` Mike Rapoport via OP-TEE
2026-09-06 19:33 ` Mike Rapoport
2026-09-07 9:50 ` Vincent Donnefort via OP-TEE
2026-09-07 9:50 ` Vincent Donnefort
2026-09-08 7:40 ` Mike Rapoport
2026-09-08 7:40 ` Mike Rapoport via OP-TEE
2026-09-08 9:18 ` Thierry Reding
2026-09-08 9:18 ` Thierry Reding via OP-TEE
2026-09-08 10:17 ` Mike Rapoport via OP-TEE
2026-09-08 10:17 ` Mike Rapoport
2026-09-02 10:47 ` [PATCH v9 02/10] of: reserved_mem: Introduce "ll-map" property Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 11:02 ` sashiko-bot
2026-09-02 17:24 ` Rob Herring
2026-09-02 17:24 ` Rob Herring via OP-TEE
2026-09-03 10:03 ` Vincent Donnefort
2026-09-03 10:03 ` Vincent Donnefort via OP-TEE
2026-09-07 14:00 ` Thierry Reding
2026-09-07 14:00 ` Thierry Reding via OP-TEE
2026-09-07 17:03 ` Vincent Donnefort
2026-09-07 17:03 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 03/10] set_memory.h: Introduce can_set_direct_map_range() Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-06 19:39 ` Mike Rapoport via OP-TEE
2026-09-06 19:39 ` Mike Rapoport
2026-09-07 9:52 ` Vincent Donnefort [this message]
2026-09-07 9:52 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 04/10] set_memory.h: Introduce __set_direct_map*() Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 05/10] arm64: can_set_direct_map() if BBML3 Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 11:09 ` sashiko-bot
2026-09-02 10:47 ` [PATCH v9 06/10] arm64: Implement can_set_direct_map_range() Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 11:06 ` sashiko-bot
2026-09-02 10:47 ` [PATCH v9 07/10] arm64: Implement __set_direct_map*() Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-08 9:27 ` Thierry Reding
2026-09-08 9:27 ` Thierry Reding via OP-TEE
2026-09-02 10:47 ` [PATCH v9 08/10] arm64: Add support for MEMBLOCK_LLMAP Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 09/10] firmware: arm_ffa: Introduce ffa-lend-pool Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 11:06 ` sashiko-bot
2026-09-02 17:38 ` Rob Herring
2026-09-02 17:38 ` Rob Herring via OP-TEE
2026-09-03 10:10 ` Vincent Donnefort
2026-09-03 10:10 ` Vincent Donnefort via OP-TEE
2026-09-02 10:47 ` [PATCH v9 10/10] optee: Add support for arm,ffa-lend-pool Vincent Donnefort
2026-09-02 10:47 ` Vincent Donnefort via OP-TEE
2026-09-02 11:09 ` sashiko-bot
2026-09-02 13:27 ` [PATCH v9 00/10] arm64: Unmap FF-A lent memory from direct map Vincent Donnefort
2026-09-02 13:27 ` Vincent Donnefort via OP-TEE
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=ap6Ja02S5IDqWRHC@google.com \
--to=vdonnefort@google.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=danielmentz@google.com \
--cc=david@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jenswi@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=op-tee@lists.trustedfirmware.org \
--cc=robh@kernel.org \
--cc=rppt@kernel.org \
--cc=sudeep.holla@kernel.org \
--cc=sumit.garg@kernel.org \
--cc=thierry.reding@kernel.org \
--cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.