Thread (44 messages) 44 messages, 9 authors, 4d ago

Re: [PATCH v3 04/11] arm64/mm: Add set_memory_device() and set_memory_normal()

From: Mike Rapoport <rppt@kernel.org>
Date: 2026-07-08 06:09:00
Also in: dri-devel, linux-devicetree, linux-iommu, linux-media, linux-mm, linux-s390, linux-tegra, lkml

On Mon, Jul 06, 2026 at 03:49:24PM +0200, Thierry Reding wrote:
On Fri, Jul 03, 2026 at 06:13:31PM +0100, Will Deacon wrote:
quoted
quoted
How about if I extract a common helper and provide set_memory_p() and
set_memory_np() in terms of those. Those are available on x86 and
PowerPC as well, so fairly standard. I suppose at that point we're
closer to set_memory_valid().
Why not just call set_direct_map_invalid_noflush() +
flush_tlb_kernel_range() for each page? We already have APIs for this.
Having a "standard" helper with a fixed and documented purposed seemed
like a preferable approach for this particular case. We also may want to
make the driver that uses this buildable as a module, in which case we'd
need to export these rather low-level APIs. And then there's also the
fact that we typically call this on a rather large region of memory
(usually something like 512 MiB), so doing it page-by-page is rather
suboptimal.
There are discussions about adding numpages to set_direct_map, e.g.

https://lore.kernel.org/linux-mm/20260410151746.61150-2-kalyazin@amazon.com/ (local)
 
-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help