[PATCH] x86/traps: Make get_stack_{trace,dump}_bottom() static

Andrew Cooper posted 1 patch 1 week, 6 days ago
xen/arch/x86/include/asm/current.h | 8 --------
xen/arch/x86/traps.c               | 4 ++--
2 files changed, 2 insertions(+), 10 deletions(-)
[PATCH] x86/traps: Make get_stack_{trace,dump}_bottom() static
Posted by Andrew Cooper 1 week, 6 days ago
They have no external callers.

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau Monné <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>

This has apparently been sat around in my tree for 6 years.
---
 xen/arch/x86/include/asm/current.h | 8 --------
 xen/arch/x86/traps.c               | 4 ++--
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index fe9a86a3f7d4..875fe41d924f 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -118,14 +118,6 @@ static inline attr_const struct cpu_info *get_cpu_info(void)
 #define get_stack_bottom()                      \
     ((unsigned long)(&get_cpu_info()->guest_cpu_user_regs + 1))
 
-/*
- * Get the reasonable stack bounds for stack traces and stack dumps.  Stack
- * dumps have a slightly larger range to include exception frames in the
- * printed information.  The returned word is inside the interesting range.
- */
-unsigned long get_stack_trace_bottom(unsigned long sp);
-unsigned long get_stack_dump_bottom (unsigned long sp);
-
 #ifdef CONFIG_LIVEPATCH
 # define CHECK_FOR_LIVEPATCH_WORK "call check_for_livepatch_work;"
 #elif defined(CONFIG_DEBUG)
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 6d83162a967c..d2ca33f9e45c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -673,7 +673,7 @@ static void show_hvm_stack(struct vcpu *v, const struct cpu_user_regs *regs)
  * For the cases where the stack should not be inspected, pretend that the
  * passed stack pointer is already out of reasonable bounds.
  */
-unsigned long get_stack_trace_bottom(unsigned long sp)
+static unsigned long get_stack_trace_bottom(unsigned long sp)
 {
     switch ( get_stack_page(sp) )
     {
@@ -690,7 +690,7 @@ unsigned long get_stack_trace_bottom(unsigned long sp)
     }
 }
 
-unsigned long get_stack_dump_bottom(unsigned long sp)
+static unsigned long get_stack_dump_bottom(unsigned long sp)
 {
     switch ( get_stack_page(sp) )
     {
-- 
2.39.5


Re: [PATCH] x86/traps: Make get_stack_{trace,dump}_bottom() static
Posted by Jan Beulich 1 week, 6 days ago
On 10.11.2026 12:28, Andrew Cooper wrote:
> They have no external callers.
> 
> Suggested-by: Jan Beulich <JBeulich@suse.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>