[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200514192738.nolajgjg56of4nat@treble>
Date: Thu, 14 May 2020 14:27:38 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Pavel Machek <pavel@...x.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Miroslav Benes <mbenes@...e.cz>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...nel.org>, Dave Jones <dsj@...com>,
Jann Horn <jannh@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vince Weaver <vincent.weaver@...ne.edu>
Subject: Re: [PATCH 4.19 37/48] x86/entry/64: Fix unwind hints in register
clearing code
On Wed, May 13, 2020 at 11:48:56PM +0200, Pavel Machek wrote:
> On Wed 2020-05-13 11:45:03, Greg Kroah-Hartman wrote:
> > From: Josh Poimboeuf <jpoimboe@...hat.com>
> >
> > commit 06a9750edcffa808494d56da939085c35904e618 upstream.
> >
> > The PUSH_AND_CLEAR_REGS macro zeroes each register immediately after
> > pushing it. If an NMI or exception hits after a register is cleared,
> > but before the UNWIND_HINT_REGS annotation, the ORC unwinder will
> > wrongly think the previous value of the register was zero. This can
> > confuse the unwinding process and cause it to exit early.
> >
> > Because ORC is simpler than DWARF, there are a limited number of unwind
> > annotation states, so it's not possible to add an individual unwind hint
> > after each push/clear combination. Instead, the register clearing
> > instructions need to be consolidated and moved to after the
> > UNWIND_HINT_REGS annotation.
>
> This actually makes kernel entry/exit slower, due to poor instruction
> scheduling. And that is a bit of hot path... Is it strictly
> neccessary? Not everyone needs ORC scheduler. Should it be somehow
> optional?
I didn't measure a difference beyond the noise level, did you?
--
Josh
Powered by blists - more mailing lists