[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251209144200.15189D45-hca@linux.ibm.com>
Date: Tue, 9 Dec 2025 15:42:00 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Alexander Gordeev <agordeev@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Mark Rutland <mark.rutland@....com>, Arnd Bergmann <arnd@...db.de>,
Jens Remus <jremus@...ux.ibm.com>,
Stefan Schulze Frielinghaus <stefansf@...ux.ibm.com>,
Juergen Christ <jchrist@...ux.ibm.com>, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org
Subject: Re: [PATCH 6/9] s390/bug: Implement __WARN_printf()
On Tue, Dec 09, 2025 at 01:35:40PM +0100, Peter Zijlstra wrote:
> On Tue, Dec 09, 2025 at 01:16:58PM +0100, Heiko Carstens wrote:
> > +#define __WARN_print_arg(flags, format, arg...) \
> > +do { \
> > + int __flags = (flags) | BUGFLAG_WARNING | BUGFLAG_ARGS; \
> > + \
> > + __WARN_trap(__WARN_bug_entry(__flags, format), ## arg); \
> > +} while (0)
>
> So on x86 I had to add:
>
> asm("");
>
> after the __WARN_trap() call above, to inhibit tail call optimization,
> because:
>
> > +void *__warn_args(struct arch_va_list *args, struct pt_regs *regs)
> > +{
> > + struct stack_frame *stack_frame;
...
> > + stack_frame = (struct stack_frame *)regs->gprs[15];
> > + args->__overflow_arg_area = stack_frame + 1;
> > + args->__reg_save_area = regs->gprs;
> > + args->__gpr = 1;
> > + return args;
> > +}
>
> that would affect the stack layout here. You don't suffer this because
> you have a link register like setup?
Yes, in case of tail call optimization everything which needs to be known to
setup va_list is passed in registers. __overflow_arg_area will then point to
garbage, but it doesn't matter since it is unused for such cases.
Powered by blists - more mailing lists