[RFC PATCH 07/10] powerpc/powernv: Add OPAL_FIND_VM_AREA API

Nicholas Piggin npiggin at gmail.com
Sat May 2 21:19:11 AEST 2020


This will be used in the next patch.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 arch/powerpc/include/asm/opal-api.h        | 15 ++++++++++++++-
 arch/powerpc/include/asm/opal.h            |  2 ++
 arch/powerpc/platforms/powernv/opal-call.c |  1 +
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index 018d4734c323..0be5ff4e51b5 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -217,7 +217,8 @@
 #define OPAL_ADDR_TO_SYM			181
 #define OPAL_SYM_TO_ADDR			182
 #define OPAL_REPORT_TRAP			183
-#define OPAL_LAST				183
+#define OPAL_FIND_VM_AREA			184
+#define OPAL_LAST				184
 
 #define QUIESCE_HOLD			1 /* Spin all calls at entry */
 #define QUIESCE_REJECT			2 /* Fail all calls with OPAL_BUSY */
@@ -1189,6 +1190,18 @@ struct opal_mpipl_fadump {
 #define OPAL_TRAP_WARN	2
 #define OPAL_TRAP_PANIC	3
 
+#define OS_VM_FLAG_READ		0x1
+#define OS_VM_FLAG_WRITE	0x2
+#define OS_VM_FLAG_EXECUTE	0x4
+#define OS_VM_FLAG_CI		0x8
+
+struct opal_vm_area {
+	__be64  address;
+	__be64  length;
+	__be64  pa;
+	__be64  vm_flags;
+};
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __OPAL_API_H */
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index dc77c2d5e036..199b5582b700 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -405,6 +405,8 @@ void opal_powercap_init(void);
 void opal_psr_init(void);
 void opal_sensor_groups_init(void);
 
+int64_t opal_find_vm_area(uint64_t addr, struct opal_vm_area *opal_vm_area);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_OPAL_H */
diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
index 32857254d268..e62a74dfb3d0 100644
--- a/arch/powerpc/platforms/powernv/opal-call.c
+++ b/arch/powerpc/platforms/powernv/opal-call.c
@@ -332,3 +332,4 @@ OPAL_CALL(opal_secvar_enqueue_update,		OPAL_SECVAR_ENQUEUE_UPDATE);
 OPAL_CALL(opal_addr_to_sym,			OPAL_ADDR_TO_SYM);
 OPAL_CALL(opal_sym_to_addr,			OPAL_SYM_TO_ADDR);
 OPAL_CALL(opal_report_trap,			OPAL_REPORT_TRAP);
+OPAL_CALL(opal_find_vm_area,			OPAL_FIND_VM_AREA);
-- 
2.23.0



More information about the Linuxppc-dev mailing list