linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* ARM64: Question: How to map non-shareable memory
@ 2023-05-24 21:07 David Clear
  2023-05-24 21:59 ` Ard Biesheuvel
  0 siblings, 1 reply; 5+ messages in thread
From: David Clear @ 2023-05-24 21:07 UTC (permalink / raw)
  To: linux-arm-kernel

I'd like some advice on how a device driver could map normal, cacheable,
non-shareable memory (currently not supported in the kernel).

I have a device that contains areas of RAM and other internal memories
that are outside of the coherency system, and it's a hardware requirement
in this device that cacheable memory transactions to these areas be
marked as non-shareable.

In practical terms this means that Device or Normal_NC mappings work
today, but Normal (cacheable) mappings will see transaction aborts
(SErrors).

An approach that appears to work is to define a pgprot_nonshared()
macro in arch/arm64/include/asm/pgtable.h which sets the PTE SH bits to
zero, and then define an arm64-specific pgprot_modify() that carries
over the pgprot_nonshared() property, so the PTE changes aren't lost
by vm_pgprot_modify().

That's a bit low-level, so I wonder if there's a better approach. Ideally
I'd like a successful patch to be upstreamed, so I hope there's no
intrinsic resistance to supporting non-shareable mappings.

I'd appreciate your thoughts.

Regards,
David.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-25 23:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 21:07 ARM64: Question: How to map non-shareable memory David Clear
2023-05-24 21:59 ` Ard Biesheuvel
2023-05-25  0:33   ` David Clear
2023-05-25  8:30     ` Catalin Marinas
2023-05-25 23:47       ` David Clear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).