[PATCH 1/2] powerpc/sstep: Unexport analyze_instr, emulate_vsx_load, emulate_vsx_store

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE669d

7 messages, 4 authors, 2024-11-17 · open the first message on its own page

[PATCH 1/2] powerpc/sstep: Unexport analyze_instr, emulate_vsx_load, emulate_vsx_store

From: Michal Suchanek <hidden>
Date: 2024-10-01 10:09:18

There is no modular user of analyze_instr, and the latter two are only
used by sstep itself.

Signed-off-by: Michal Suchanek <redacted>
---
 arch/powerpc/lib/sstep.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e65f3fb68d06..a0557b0d9a24 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -863,7 +863,6 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
 		break;
 	}
 }
-EXPORT_SYMBOL_GPL(emulate_vsx_load);
 NOKPROBE_SYMBOL(emulate_vsx_load);
 
 void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
@@ -955,7 +954,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
 		break;
 	}
 }
-EXPORT_SYMBOL_GPL(emulate_vsx_store);
 NOKPROBE_SYMBOL(emulate_vsx_store);
 
 static nokprobe_inline int do_vsx_load(struct instruction_op *op,
@@ -3172,7 +3170,6 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
 	op->val = SRR1_PROGTRAP;
 	return 0;
 }
-EXPORT_SYMBOL_GPL(analyse_instr);
 NOKPROBE_SYMBOL(analyse_instr);
 
 /*
-- 
2.46.0

[PATCH 2/2] powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static

From: Michal Suchanek <hidden>
Date: 2024-10-01 10:09:21

These functions are not used outside of sstep.c

Fixes: 350779a29f11 ("powerpc: Handle most loads and stores in instruction emulation code")
Signed-off-by: Michal Suchanek <redacted>
---
 arch/powerpc/include/asm/sstep.h |  5 -----
 arch/powerpc/lib/sstep.c         | 10 ++++------
 2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index 50950deedb87..e3d0e714ff28 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -173,9 +173,4 @@ int emulate_step(struct pt_regs *regs, ppc_inst_t instr);
  */
 extern int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op);
 
-extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
-			     const void *mem, bool cross_endian);
-extern void emulate_vsx_store(struct instruction_op *op,
-			      const union vsx_reg *reg, void *mem,
-			      bool cross_endian);
 extern int emulate_dcbz(unsigned long ea, struct pt_regs *regs);
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index a0557b0d9a24..877123896c2e 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -780,8 +780,8 @@ static nokprobe_inline int emulate_stq(struct pt_regs *regs, unsigned long ea,
 #endif /* __powerpc64 */
 
 #ifdef CONFIG_VSX
-void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
-		      const void *mem, bool rev)
+static nokprobe_inline void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
+					     const void *mem, bool rev)
 {
 	int size, read_size;
 	int i, j;
@@ -863,10 +863,9 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
 		break;
 	}
 }
-NOKPROBE_SYMBOL(emulate_vsx_load);
 
-void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
-		       void *mem, bool rev)
+static nokprobe_inline void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
+					      void *mem, bool rev)
 {
 	int size, write_size;
 	int i, j;
@@ -954,7 +953,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
 		break;
 	}
 }
-NOKPROBE_SYMBOL(emulate_vsx_store);
 
 static nokprobe_inline int do_vsx_load(struct instruction_op *op,
 				       unsigned long ea, struct pt_regs *regs,
-- 
2.46.0

Re: [PATCH 1/2] powerpc/sstep: Unexport analyze_instr, emulate_vsx_load, emulate_vsx_store

From: Christophe Leroy <hidden>
Date: 2024-10-01 12:08:27


Le 01/10/2024 à 12:08, Michal Suchanek a écrit :
There is no modular user of analyze_instr, and the latter two are only
used by sstep itself.
analyze_instr() is used in arch/powerpc/kvm/emulate_loadstore.c which 
can be a module as far as I can see in Makefile:

common-objs-y += powerpc.o emulate_loadstore.o

kvm-book3s_64-module-objs := \
	$(common-objs-y) \
	book3s.o \
	book3s_rtas.o \
	$(kvm-book3s_64-objs-y)

kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)

config KVM_BOOK3S_64
	tristate "KVM support for PowerPC book3s_64 processors"

quoted hunk
Signed-off-by: Michal Suchanek <redacted>
---
  arch/powerpc/lib/sstep.c | 3 ---
  1 file changed, 3 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e65f3fb68d06..a0557b0d9a24 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -863,7 +863,6 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
  		break;
  	}
  }
-EXPORT_SYMBOL_GPL(emulate_vsx_load);
  NOKPROBE_SYMBOL(emulate_vsx_load);
  
  void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
@@ -955,7 +954,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
  		break;
  	}
  }
-EXPORT_SYMBOL_GPL(emulate_vsx_store);
  NOKPROBE_SYMBOL(emulate_vsx_store);
  
  static nokprobe_inline int do_vsx_load(struct instruction_op *op,
@@ -3172,7 +3170,6 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
  	op->val = SRR1_PROGTRAP;
  	return 0;
  }
-EXPORT_SYMBOL_GPL(analyse_instr);
  NOKPROBE_SYMBOL(analyse_instr);
  
  /*

Re: [PATCH 1/2] powerpc/sstep: Unexport analyze_instr, emulate_vsx_load, emulate_vsx_store

From: Paul Mackerras <hidden>
Date: 2024-10-01 12:29:24

On Tue, Oct 01, 2024 at 12:08:47PM +0200, Michal Suchanek wrote:
There is no modular user of analyze_instr, and the latter two are only
used by sstep itself.
As far as I can see, analyze_instr is still used in
arch/powerpc/kvm/emulate_loadstore.c, and that can be included in a
module, e.g., when CONFIG_KVM_BOOK3S_64 = m.  Or am I missing
something?

Paul.

Re: [PATCH 1/2] powerpc/sstep: Unexport analyze_instr, emulate_vsx_load, emulate_vsx_store

From: Michal Suchánek <hidden>
Date: 2024-10-01 12:59:39

On Tue, Oct 01, 2024 at 02:08:18PM +0200, Christophe Leroy wrote:

Le 01/10/2024 à 12:08, Michal Suchanek a écrit :
quoted
There is no modular user of analyze_instr, and the latter two are only
used by sstep itself.
analyze_instr() is used in arch/powerpc/kvm/emulate_loadstore.c which can be
a module as far as I can see in Makefile:

common-objs-y += powerpc.o emulate_loadstore.o

kvm-book3s_64-module-objs := \
	$(common-objs-y) \
	book3s.o \
	book3s_rtas.o \
	$(kvm-book3s_64-objs-y)

kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)

config KVM_BOOK3S_64
	tristate "KVM support for PowerPC book3s_64 processors"
Indeed, missed that it can be modular thruogh this indirection.

Thanks

Michal
quoted
Signed-off-by: Michal Suchanek <redacted>
---
  arch/powerpc/lib/sstep.c | 3 ---
  1 file changed, 3 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e65f3fb68d06..a0557b0d9a24 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -863,7 +863,6 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
  		break;
  	}
  }
-EXPORT_SYMBOL_GPL(emulate_vsx_load);
  NOKPROBE_SYMBOL(emulate_vsx_load);
  void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
@@ -955,7 +954,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
  		break;
  	}
  }
-EXPORT_SYMBOL_GPL(emulate_vsx_store);
  NOKPROBE_SYMBOL(emulate_vsx_store);
  static nokprobe_inline int do_vsx_load(struct instruction_op *op,
@@ -3172,7 +3170,6 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
  	op->val = SRR1_PROGTRAP;
  	return 0;
  }
-EXPORT_SYMBOL_GPL(analyse_instr);
  NOKPROBE_SYMBOL(analyse_instr);
  /*

[PATCH] powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static

From: Michal Suchanek <hidden>
Date: 2024-10-01 13:04:00

These functions are not used outside of sstep.c

Fixes: 350779a29f11 ("powerpc: Handle most loads and stores in instruction emulation code")
Signed-off-by: Michal Suchanek <redacted>
---
 arch/powerpc/include/asm/sstep.h |  5 -----
 arch/powerpc/lib/sstep.c         | 12 ++++--------
 2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h
index 50950deedb87..e3d0e714ff28 100644
--- a/arch/powerpc/include/asm/sstep.h
+++ b/arch/powerpc/include/asm/sstep.h
@@ -173,9 +173,4 @@ int emulate_step(struct pt_regs *regs, ppc_inst_t instr);
  */
 extern int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op);
 
-extern void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
-			     const void *mem, bool cross_endian);
-extern void emulate_vsx_store(struct instruction_op *op,
-			      const union vsx_reg *reg, void *mem,
-			      bool cross_endian);
 extern int emulate_dcbz(unsigned long ea, struct pt_regs *regs);
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index e65f3fb68d06..ac3ee19531d8 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -780,8 +780,8 @@ static nokprobe_inline int emulate_stq(struct pt_regs *regs, unsigned long ea,
 #endif /* __powerpc64 */
 
 #ifdef CONFIG_VSX
-void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
-		      const void *mem, bool rev)
+static nokprobe_inline void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
+					     const void *mem, bool rev)
 {
 	int size, read_size;
 	int i, j;
@@ -863,11 +863,9 @@ void emulate_vsx_load(struct instruction_op *op, union vsx_reg *reg,
 		break;
 	}
 }
-EXPORT_SYMBOL_GPL(emulate_vsx_load);
-NOKPROBE_SYMBOL(emulate_vsx_load);
 
-void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
-		       void *mem, bool rev)
+static nokprobe_inline void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
+					      void *mem, bool rev)
 {
 	int size, write_size;
 	int i, j;
@@ -955,8 +953,6 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
 		break;
 	}
 }
-EXPORT_SYMBOL_GPL(emulate_vsx_store);
-NOKPROBE_SYMBOL(emulate_vsx_store);
 
 static nokprobe_inline int do_vsx_load(struct instruction_op *op,
 				       unsigned long ea, struct pt_regs *regs,
-- 
2.46.1

Re: [PATCH] powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static

From: Michael Ellerman <hidden>
Date: 2024-11-17 12:25:34

On Tue, 01 Oct 2024 15:03:49 +0200, Michal Suchanek wrote:
These functions are not used outside of sstep.c
Applied to powerpc/next.

[1/1] powerpc/sstep: make emulate_vsx_load and emulate_vsx_store static
      https://git.kernel.org/powerpc/c/a26c4dbb3d9c1821cb0fc11cb2dbc32d5bf3463b

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help