riscv: Implement svpbmt via alternatives

A patchset in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Thu, 9 Dec 2021 19:45:34 +0100

This series takes Guo Ren's / Wei Fu's series and modifies it to use the alternatives framework to do runtime-patching of the affected code paths. For this, we implement a non-soc-vendor cpufeature structure parallel to the vendor-erratas. I do plan to send this to the public lists tomorrow for a first round of review, so if you find time, please take a look. Missing is applying alternatives to modules. That is something I'll still need to figure out. Tests I did: - log (generated) PAGE-values for both cases (svpbmt, non-svpbmt) - regular qemu - Qemu with https://lore.kernel.org/all/20211128135255.22089-4-liweiwei@iscas.ac.cn/ and qemu_fdt_setprop_string(mc->fdt, cpu_name, "mmu", "riscv,svpbmt"); in virt - count and log the amount of patched code locations (177) Guo Ren (1): riscv: Fixup _PAGE_CHG_MASK usage in pgtable Heiko Stuebner (2): riscv: add cpufeature handling via alternatives riscv: remove FIXMAP_PAGE_IO and fall back to its default value 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/errata/Makefile | 1 + arch/riscv/errata/alternative.c | 3 + arch/riscv/errata/cpufeatures.c | 87 +++++++++++++++++++ arch/riscv/include/asm/alternative.h | 1 + arch/riscv/include/asm/errata_list.h | 13 +++ arch/riscv/include/asm/fixmap.h | 2 - arch/riscv/include/asm/pgtable-32.h | 10 +++ arch/riscv/include/asm/pgtable-64.h | 65 +++++++++++++- arch/riscv/include/asm/pgtable-bits.h | 4 - arch/riscv/include/asm/pgtable.h | 38 ++++++-- 11 files changed, 216 insertions(+), 18 deletions(-) create mode 100644 arch/riscv/errata/cpufeatures.c -- 2.30.2

Patches in this set

Statistics

  • 5 individual patches
  • 217 lines added
  • 19 lines removed
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...