[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230428043158.r5omehiaqawcac2y@treble>
Date: Thu, 27 Apr 2023 21:31:58 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vernon Lovejoy <vlovejoy@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/show_trace_log_lvl: ensure stack pointer is aligned,
again
On Thu, Apr 27, 2023 at 04:00:54PM +0200, Oleg Nesterov wrote:
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index 0bf6779187dd..71ab445a29c3 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -214,6 +214,7 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
> * - hardirq stack
> * - entry stack
> */
> + stack = PTR_ALIGN(stack, sizeof(long));
> for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
> const char *stack_name;
Seems reasonable, though 'stack' is already initialized a few lines
above this, so it would be cleaner to do the PTR_ALIGN then. Or even
better, just move it all to the for loop:
for (stack = PTR_ALIGN(stack ? : get_stack_pointer(task, regs));
stack;
stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
--
Josh
Powered by blists - more mailing lists