mbox series

[v3,0/4] riscv, mm: detect svnapot cpu support at runtime

Message ID 20220822125904.3972860-1-panqinglin2020@iscas.ac.cn (mailing list archive)
Headers show
Series riscv, mm: detect svnapot cpu support at runtime | expand

Message

Qinglin Pan Aug. 22, 2022, 12:59 p.m. UTC
From: Qinglin Pan <panqinglin2020@iscas.ac.cn>

Svnapot is a RISC-V extension for marking contiguous 4K pages as a non-4K
page. This patch set is for using Svnapot in Linux Kernel's boot process
and hugetlb fs.

This patchset adds a Kconfig item for using Svnapot in
"Platform type"->"Svnapot support". Its default value is off, and people can set
it on if they allow kernel to detect Svnapot hardware support and leverage it.

Tested on:
  - qemu rv64 with "Svnapot support" off and svnapot=true.
  - qemu rv64 with "Svnapot support" on and svnapot=true.
  - qemu rv64 with "Svnapot support" off and svnapot=false.
  - qemu rv64 with "Svnapot support" on and svnapot=false.

Changes in v2:
  - detect Svnapot hardware support at boot time.
Changes in v3:
  - do linear mapping again if has_svnapot

Qinglin Pan (4):
  mm: modify pte format for Svnapot
  mm: support Svnapot in physical page linear-mapping
  mm: support Svnapot in hugetlb page
  mm: support Svnapot in huge vmap

 arch/riscv/Kconfig                   |  10 +-
 arch/riscv/include/asm/errata_list.h |  24 ++-
 arch/riscv/include/asm/hugetlb.h     |  31 +++-
 arch/riscv/include/asm/hwcap.h       |   1 +
 arch/riscv/include/asm/mmu.h         |   1 +
 arch/riscv/include/asm/page.h        |   2 +-
 arch/riscv/include/asm/pgtable-64.h  |  14 ++
 arch/riscv/include/asm/pgtable.h     |  67 +++++++-
 arch/riscv/include/asm/vmalloc.h     |  20 +++
 arch/riscv/kernel/cpu.c              |   1 +
 arch/riscv/kernel/cpufeature.c       |  17 ++
 arch/riscv/kernel/setup.c            |  11 +-
 arch/riscv/mm/hugetlbpage.c          | 239 ++++++++++++++++++++++++++-
 arch/riscv/mm/init.c                 |  47 ++++--
 14 files changed, 461 insertions(+), 24 deletions(-)

Comments

Conor Dooley Aug. 22, 2022, 1:09 p.m. UTC | #1
Hey,

On 22/08/2022 13:59, panqinglin2020@iscas.ac.cn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> From: Qinglin Pan <panqinglin2020@iscas.ac.cn>
> 
> Svnapot is a RISC-V extension for marking contiguous 4K pages as a non-4K
> page. This patch set is for using Svnapot in Linux Kernel's boot process
> and hugetlb fs.
> 
> This patchset adds a Kconfig item for using Svnapot in
> "Platform type"->"Svnapot support". Its default value is off, and people can set
> it on if they allow kernel to detect Svnapot hardware support and leverage it.
> 
> Tested on:
>    - qemu rv64 with "Svnapot support" off and svnapot=true.
>    - qemu rv64 with "Svnapot support" on and svnapot=true.
>    - qemu rv64 with "Svnapot support" off and svnapot=false.
>    - qemu rv64 with "Svnapot support" on and svnapot=false.

I applied this to v6.0-rc1 and got a bunch of checkpatch complaints.
Some of the CHECK level ones may be invalid, but could you see to
the others please?
Thanks,
Conor.


./scripts/checkpatch.pl --strict --terse -g v6.0-rc1..HEAD
93b854a885f0b34bef287db048fc4f4505a05ab2:6: WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
93b854a885f0b34bef287db048fc4f4505a05ab2:69: CHECK: Macro argument reuse '_val' - possible side-effects?
93b854a885f0b34bef287db048fc4f4505a05ab2:114: CHECK: Prefer using the BIT macro
93b854a885f0b34bef287db048fc4f4505a05ab2:117: CHECK: Prefer using the BIT macro
93b854a885f0b34bef287db048fc4f4505a05ab2:119: CHECK: Prefer using the BIT macro
93b854a885f0b34bef287db048fc4f4505a05ab2:133: ERROR: open brace '{' following function definitions go on the next line
93b854a885f0b34bef287db048fc4f4505a05ab2:135: WARNING: Missing a blank line after declarations
93b854a885f0b34bef287db048fc4f4505a05ab2:163: WARNING: Missing a blank line after declarations
93b854a885f0b34bef287db048fc4f4505a05ab2:164: CHECK: Alignment should match open parenthesis
93b854a885f0b34bef287db048fc4f4505a05ab2:197: CHECK: Please use a blank line after function/struct/union/enum declarations
total: 1 errors, 3 warnings, 6 checks, 157 lines checked
fd3c74a08431b73897fc61bc7081082d4fd267d9:80: WARNING: Missing a blank line after declarations
fd3c74a08431b73897fc61bc7081082d4fd267d9:91: WARNING: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()
total: 0 errors, 2 warnings, 0 checks, 113 lines checked
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:73: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:74: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:77: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:80: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:83: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:84: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:86: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:90: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:93: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:96: CHECK: extern prototypes should be avoided in .h files
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:97: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:126: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:212: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:226: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:235: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:251: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:278: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:291: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:308: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:325: CHECK: Alignment should match open parenthesis
bac3dfa35183e296fce1b6bc4b57f2bcaa63e4cc:335: CHECK: Alignment should match open parenthesis
total: 0 errors, 0 warnings, 21 checks, 311 lines checked
50b1c316e41a52532295929bb02e857431bdf15e:90: CHECK: Consider using #include <linux/pgtable.h> instead of <asm/pgtable.h>
50b1c316e41a52532295929bb02e857431bdf15e:95: CHECK: Alignment should match open parenthesis
50b1c316e41a52532295929bb02e857431bdf15e:102: CHECK: Logical continuations should be on the previous line
total: 0 errors, 0 warnings, 3 checks, 74 lines checked

> 
> Changes in v2:
>    - detect Svnapot hardware support at boot time.
> Changes in v3:
>    - do linear mapping again if has_svnapot
> 
> Qinglin Pan (4):
>    mm: modify pte format for Svnapot
>    mm: support Svnapot in physical page linear-mapping
>    mm: support Svnapot in hugetlb page
>    mm: support Svnapot in huge vmap
> 
>   arch/riscv/Kconfig                   |  10 +-
>   arch/riscv/include/asm/errata_list.h |  24 ++-
>   arch/riscv/include/asm/hugetlb.h     |  31 +++-
>   arch/riscv/include/asm/hwcap.h       |   1 +
>   arch/riscv/include/asm/mmu.h         |   1 +
>   arch/riscv/include/asm/page.h        |   2 +-
>   arch/riscv/include/asm/pgtable-64.h  |  14 ++
>   arch/riscv/include/asm/pgtable.h     |  67 +++++++-
>   arch/riscv/include/asm/vmalloc.h     |  20 +++
>   arch/riscv/kernel/cpu.c              |   1 +
>   arch/riscv/kernel/cpufeature.c       |  17 ++
>   arch/riscv/kernel/setup.c            |  11 +-
>   arch/riscv/mm/hugetlbpage.c          | 239 ++++++++++++++++++++++++++-
>   arch/riscv/mm/init.c                 |  47 ++++--
>   14 files changed, 461 insertions(+), 24 deletions(-)
> 
> --
> 2.35.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv