RISC-V: Implement arch specific PMEM APIs
authorAnup Patel <apatel@ventanamicro.com>
Mon, 14 Nov 2022 09:05:35 +0000 (14:35 +0530)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 8 Dec 2022 23:43:59 +0000 (15:43 -0800)
commita49ab905a1fc8630a94221f9a06ce0dafb266576
tree6fcc7c4b66ac7efb898e7b9d2fdee2f3f3976e37
parentb91676fc16cd384a81e3af52c641aa61985cc231
RISC-V: Implement arch specific PMEM APIs

The NVDIMM PMEM driver expects arch specific APIs for cache maintenance
and if arch does not provide these APIs then NVDIMM PMEM driver will
always use MEMREMAP_WT to map persistent memory which in-turn maps as
UC memory type defined by the RISC-V Svpbmt specification.

Now that the Svpbmt and Zicbom support is available in RISC-V kernel,
we implement PMEM APIs using ALT_CMO_OP() macros so that the NVDIMM
PMEM driver can use MEMREMAP_WB to map persistent memory.

Co-developed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221114090536.1662624-3-apatel@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/mm/Makefile
arch/riscv/mm/pmem.c [new file with mode: 0644]