linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: Align shared mappings to avoid cache aliasing
@ 2019-11-15 19:23 Marc Gauthier
  2019-11-15 19:23 ` [PATCH 1/2] riscv: Align shared mappings to SHMLBA Marc Gauthier
  2019-11-15 19:23 ` [PATCH 2/2] riscv: Set SHMLBA according to cache geometry Marc Gauthier
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Gauthier @ 2019-11-15 19:23 UTC (permalink / raw)
  To: linux-riscv; +Cc: Marc Gauthier

Ensure optimal performance on larger VIPT caches by aligning shared
mappings to the maximum cache "span" (line size * number of sets) of
all CPU L1 instruction and data caches (L2 and up are rarely VIPT).
If the device tree does not provide cache parameters, use a conservative
16 KB alignment:  only large enough to avoid aliasing in most VIPT caches.

Tested on Linux 5.4-rc7 in simulation.

Signed-off-by: Marc Gauthier <consult-mg@gstardust.com>

Marc Gauthier (2):
  riscv: Align shared mappings to SHMLBA
  riscv: Set SHMLBA according to cache geometry

 arch/riscv/include/asm/pgtable.h  |   4 ++
 arch/riscv/include/asm/shmparam.h |  12 ++++
 arch/riscv/kernel/cacheinfo.c     |  49 +++++++++++++
 arch/riscv/kernel/sys_riscv.c     | 112 ++++++++++++++++++++++++++++++
 4 files changed, 177 insertions(+)
 create mode 100644 arch/riscv/include/asm/shmparam.h

-- 
2.17.1


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

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

end of thread, other threads:[~2019-11-15 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 19:23 [PATCH 0/2] riscv: Align shared mappings to avoid cache aliasing Marc Gauthier
2019-11-15 19:23 ` [PATCH 1/2] riscv: Align shared mappings to SHMLBA Marc Gauthier
2019-11-15 19:23 ` [PATCH 2/2] riscv: Set SHMLBA according to cache geometry Marc Gauthier

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).