Messages in this thread |  | | Date | Mon, 8 Jan 2018 16:06:26 -0800 | From | Andi Kleen <> | Subject | Re: [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch |
| |
On Mon, Jan 08, 2018 at 03:56:30PM -0800, Linus Torvalds wrote: > On Mon, Jan 8, 2018 at 3:44 PM, David Woodhouse <dwmw2@infradead.org> wrote: > > > > To guard against this fill the return buffer with controlled > > content during context switch. This prevents any underflows. > > Ugh. I really dislike this patch. Everything else in the retpoline > patches makes me go "ok, that's reasonable". This one makes me go > "Eww". > > It's hacky, it's ugly, and it looks pretty expensive too.
Modern cores are quite fast at executing calls.
> > Is there really nothing more clever we can do?
We could be a cleverer in selecting how many dummy calls to do. But that would likely be fragile and hard to maintain and likely be more complicated, and I doubt it would buy that much.
Don't really have a better proposal, sorry.
-Andi
|  |