linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 0/2] riscv: add RISC-V Svpbmt Standard Extension supports
@ 2021-11-29  1:40 wefu
  2021-11-29  1:40 ` [PATCH V4 1/2] dt-bindings: riscv: add MMU Standard Extensions support for Svpbmt wefu
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: wefu @ 2021-11-29  1:40 UTC (permalink / raw)
  To: anup.patel, atishp04, palmer, guoren, christoph.muellner,
	philipp.tomsich, hch, liush, wefu, lazyparser, drew
  Cc: linux-riscv, linux-kernel, taiten.peng, aniket.ponkshe,
	heinrich.schuchardt, gordan.markus, guoren, arnd, wens, maxime,
	dlustig, gfavor, andrea.mondelli, behrensj, xinhaoqu, huffman,
	mick, allen.baum, jscheid, rtrauben

From: Fu Wei <wefu@redhat.com>

This patch follows the  RISC-V standard Svpbmt extension in 
privilege spec to solve the non-coherent SOC DMA synchronization
issues.

The svpbmt PTE format:
| 63 | 62-61 | 60-8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
  N     MT     RSW    D   A   G   U   X   W   R   V
        ^

Of the Reserved bits [63:54] in a leaf PTE, the bits [62:61] are used as
the MT (aka MemType) field. This field specifies one of three memory types
as shown in the following table:
MemType     RISC-V Description
----------  ------------------------------------------------
00 - PMA    Normal Cacheable, No change to implied PMA memory type
01 - NC     Non-cacheable, idempotent, weakly-ordered Main Memory
10 - IO     Non-cacheable, non-idempotent, strongly-ordered I/O memory
11 - Rsvd   Reserved for future standard use

The standard protection_map[] needn't be modified because the "PMA"
type keeps the highest bits zero.
And the whole modification is limited in the arch/riscv/* and using
a global variable(__svpbmt) as _PAGE_MASK/IO/NOCACHE for pgprot_noncached
(&writecombine) in pgtable.h. We also add _PAGE_CHG_MASK to filter
PFN than before.

Enable it in devicetree - (Add "riscv,svpbmt" in the mmu of cpu node)
 - mmu:
     riscv,svpmbt

Wei Fu (2):
  dt-bindings: riscv: add MMU Standard Extensions support for Svpbmt
  riscv: add RISC-V Svpbmt extension supports

 .../devicetree/bindings/riscv/cpus.yaml       | 10 +++++
 arch/riscv/include/asm/fixmap.h               |  2 +-
 arch/riscv/include/asm/pgtable-64.h           | 21 ++++++++--
 arch/riscv/include/asm/pgtable-bits.h         | 39 ++++++++++++++++++-
 arch/riscv/include/asm/pgtable.h              | 39 ++++++++++++++-----
 arch/riscv/kernel/cpufeature.c                | 35 +++++++++++++++++
 arch/riscv/mm/init.c                          |  5 +++
 7 files changed, 136 insertions(+), 15 deletions(-)

-- 
2.25.4


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

end of thread, other threads:[~2021-12-03  9:12 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29  1:40 [PATCH V4 0/2] riscv: add RISC-V Svpbmt Standard Extension supports wefu
2021-11-29  1:40 ` [PATCH V4 1/2] dt-bindings: riscv: add MMU Standard Extensions support for Svpbmt wefu
2021-11-29  8:54   ` Heinrich Schuchardt
2021-11-29 12:06     ` Heiko Stübner
2021-11-30 12:07       ` Heiko Stübner
2021-11-30 13:17         ` Jessica Clarke
2021-11-30 13:27           ` Heiko Stübner
2021-11-30 13:59             ` Jessica Clarke
2021-11-30 15:01               ` Philipp Tomsich
2021-11-30 16:12                 ` Jessica Clarke
2021-12-01  1:21                   ` Atish Patra
2021-12-01  3:06                     ` Tsukasa OI
2021-12-01  8:15                       ` Atish Patra
2021-12-01  8:30                         ` Heiko Stübner
     [not found]                           ` <CAELrHRDb9oeu_FokyhUFQ+Yu27=4xqvPdz4=08MXQzh3Bj2Myw@mail.gmail.com>
2021-12-01 10:20                             ` Heiko Stübner
2021-12-01 11:05                               ` Philipp Tomsich
2021-12-01 13:39                                 ` Jessica Clarke
2021-12-02  1:31                         ` Tsukasa OI
2021-12-02  1:55                           ` Atish Patra
2021-12-01 13:28                     ` Heiko Stübner
2021-12-02  1:59                       ` Atish Patra
2021-11-30 18:45   ` Heiko Stübner
2021-12-01  2:58     ` Wei Fu
2021-11-29  1:40 ` [PATCH V4 2/2] riscv: add RISC-V Svpbmt extension supports wefu
2021-11-29 10:48   ` Alexandre Ghiti
2021-11-29 13:36   ` Jisheng Zhang
2021-12-01  5:05     ` Wei Fu
2021-12-01  6:18       ` Anup Patel
2021-12-01 13:29         ` Jisheng Zhang
2021-12-03  9:12         ` Wei Fu
2021-11-30 10:18   ` Guo Ren
2021-12-01  3:03     ` Wei Fu
2021-11-30 18:46   ` Heiko Stübner
2021-12-01  3:00     ` Wei Fu
2021-11-29 13:33 ` [PATCH V4 0/2] riscv: add RISC-V Svpbmt Standard Extension supports Jisheng Zhang

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