Skip to content

Commit

Permalink
riscv: changing T-Head PBMT attributes
Browse files Browse the repository at this point in the history
Originall the T-Head PBMT implementation in the kernel is intended for
D1, thus the Sharable bit is not set. In addition, the Bufferable bit
is not set for writecombine situation.

Set these bits in the T-Head PBMT attributes definition.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
  • Loading branch information
Icenowy authored and RevySR committed Sep 13, 2024
1 parent 94ca55e commit dfbaf89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/riscv/include/asm/pgtable-64.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ enum napot_cont_order {
/*
* [63:59] T-Head Memory Type definitions:
*
* 00000 - NC Weakly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable
* 00010 - NC Weakly-ordered, Non-cacheable, Non-bufferable, Shareable, Non-trustable
* 01110 - PMA Weakly-ordered, Cacheable, Bufferable, Shareable, Non-trustable
* 10000 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable
* 10010 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Shareable, Non-trustable
*/
#define _PAGE_PMA_THEAD ((1UL << 62) | (1UL << 61) | (1UL << 60))
#define _PAGE_NOCACHE_THEAD 0UL
#define _PAGE_IO_THEAD (1UL << 63)
#define _PAGE_NOCACHE_THEAD ((1UL << 61) | (1UL << 60))
#define _PAGE_IO_THEAD ((1UL << 63) | (1UL << 60))
#define _PAGE_MTMASK_THEAD (_PAGE_PMA_THEAD | _PAGE_IO_THEAD | (1UL << 59))

static inline u64 riscv_page_mtmask(void)
Expand Down

0 comments on commit dfbaf89

Please sign in to comment.