All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Clear <dclear@amd.com>
To: <linux-arm-kernel@lists.infradead.org>
Subject: ARM64: Question: How to map non-shareable memory
Date: Wed, 24 May 2023 14:07:38 -0700	[thread overview]
Message-ID: <20230524210738.69492-1-dclear@amd.com> (raw)

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

             reply	other threads:[~2023-05-24 21:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 21:07 David Clear [this message]
2023-05-24 21:59 ` ARM64: Question: How to map non-shareable memory Ard Biesheuvel
2023-05-25  0:33   ` David Clear
2023-05-25  8:30     ` Catalin Marinas
2023-05-25 23:47       ` David Clear

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=20230524210738.69492-1-dclear@amd.com \
    --to=dclear@amd.com \
    --cc=linux-arm-kernel@lists.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 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.