Skip to contentSkip to conversation

iommu/generic_pt: Fix the RISC-V supported feature mask

PATCH In review Andrew Jones 4 participants 4 messages Aug 18 – Aug 19

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/generic_pt: Fix the RISC-V supported feature mask

The RISC-V format advertises Svpbmt to its users, but omits the feature from PT_SUPPORTED_FEATURES. Add it there so configurations which enable Svpbmt pass generic page-table feature validation.

Fixes f196a8668797 ("iommu/riscv: Advertise Svpbmt support to generic page table")
---
 drivers/iommu/generic_pt/fmt/iommu_riscv64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/generic_pt/fmt/iommu_riscv64.c +2 -1
index b18fc4d109f5..1bb74114fb02 100644
@@ -7,7 +7,8 @@
 #define PT_SUPPORTED_FEATURES                                  \
 	(BIT(PT_FEAT_SIGN_EXTEND) | BIT(PT_FEAT_FLUSH_RANGE) | \
 	 BIT(PT_FEAT_RISCV_SVNAPOT_64K) |                      \
-	 BIT(PT_FEAT_DETAILED_GATHER))
+	 BIT(PT_FEAT_DETAILED_GATHER) |                        \
+	 BIT(PT_FEAT_RISCV_SVPBMT))
 #define PT_FORCE_ENABLED_FEATURES BIT(PT_FEAT_DETAILED_GATHER)
 
 #include "iommu_template.h"
Signature · 1 line
2.43.0
Tested-by on v1 1/1
#1 lore raw
Quoted 27 lines

The RISC-V format advertises Svpbmt to its users, but omits the feature from PT_SUPPORTED_FEATURES. Add it there so configurations which enable Svpbmt pass generic page-table feature validation.

Fixes f196a8668797 ("iommu/riscv: Advertise Svpbmt support to generic page table")

---
drivers/iommu/generic_pt/fmt/iommu_riscv64.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/generic_pt/fmt/iommu_riscv64.c +2 -1
index b18fc4d109f5..1bb74114fb02 100644
@@ -7,7 +7,8 @@
 #define PT_SUPPORTED_FEATURES                                  \
 	(BIT(PT_FEAT_SIGN_EXTEND) | BIT(PT_FEAT_FLUSH_RANGE) | \
 	 BIT(PT_FEAT_RISCV_SVNAPOT_64K) |                      \
-	 BIT(PT_FEAT_DETAILED_GATHER))
+	 BIT(PT_FEAT_DETAILED_GATHER) |                        \
+	 BIT(PT_FEAT_RISCV_SVPBMT))
 #define PT_FORCE_ENABLED_FEATURES BIT(PT_FEAT_DETAILED_GATHER)
 
 #include "iommu_template.h"
Signature · 1 line
2.43.0

Thanks for fixing this.

When I originally tested the Svpbmt support, I had CONFIG_DEBUG_GENERIC_PT enabled by default, so this issue was hidden by the debug supported-feature mask and did not show up in my testing.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Andrew Jones
Quoted 9 lines · Andrew Jones

The RISC-V format advertises Svpbmt to its users, but omits the feature from PT_SUPPORTED_FEATURES. Add it there so configurations which enable Svpbmt pass generic page-table feature validation.

Fixes f196a8668797 ("iommu/riscv: Advertise Svpbmt support to generic page table")
---
 drivers/iommu/generic_pt/fmt/iommu_riscv64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Jason

Reviewed-by on v1 1/1
#3 lore raw
In reply to Andrew Jones
Quoted 6 lines · Andrew Jones

The RISC-V format advertises Svpbmt to its users, but omits the feature from PT_SUPPORTED_FEATURES. Add it there so configurations which enable Svpbmt pass generic page-table feature validation.

Fixes f196a8668797 ("iommu/riscv: Advertise Svpbmt support to generic page table")

Thanks,
Nutty

Quoted 18 lines
---
  drivers/iommu/generic_pt/fmt/iommu_riscv64.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/generic_pt/fmt/iommu_riscv64.c +2 -1
index b18fc4d109f5..1bb74114fb02 100644
@@ -7,7 +7,8 @@
  #define PT_SUPPORTED_FEATURES                                  \
  	(BIT(PT_FEAT_SIGN_EXTEND) | BIT(PT_FEAT_FLUSH_RANGE) | \
  	 BIT(PT_FEAT_RISCV_SVNAPOT_64K) |                      \
-	 BIT(PT_FEAT_DETAILED_GATHER))
+	 BIT(PT_FEAT_DETAILED_GATHER) |                        \
+	 BIT(PT_FEAT_RISCV_SVPBMT))
  #define PT_FORCE_ENABLED_FEATURES BIT(PT_FEAT_DETAILED_GATHER)
 
  #include "iommu_template.h"