From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933737AbbIDNiE (ORCPT ); Fri, 4 Sep 2015 09:38:04 -0400 Received: from www.linutronix.de ([62.245.132.108]:49498 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754065AbbIDNiB (ORCPT ); Fri, 4 Sep 2015 09:38:01 -0400 Date: Fri, 4 Sep 2015 15:37:24 +0200 (CEST) From: Thomas Gleixner To: Borislav Petkov cc: "Richard W.M. Jones" , Chuck Ebbert , linux-kernel@vger.kernel.org, x86@kernel.org, Ingo Molnar , "H. Peter Anvin" Subject: Re: [BUG 4.2-rc8] Interrupt occurs while apply_alternatives() is patching the handler In-Reply-To: <20150904120238.GB23550@nazgul.tnic> Message-ID: References: <20150830223757.6e4c5c02@as> <20150901062022.GA19002@redhat.com> <20150903085046.GA19397@nazgul.tnic> <20150904120238.GB23550@nazgul.tnic> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Sep 2015, Borislav Petkov wrote: > On Thu, Sep 03, 2015 at 12:41:47PM +0200, Thomas Gleixner wrote: > > Nah. I rather put the local_irq_save into optimize_nops(). All other > > callers of add_nops() are operating on a buffer and use text_poke > > after that. Aside of that optimize_nops() is missing a sync_core(). > > Whoops. > > > Updated patch below. > > Looks good, thanks. > > Hrrm, maybe optimize_nops() should work on a buffer and do > text_poke_early() too at the end, so that it doesn't differ from all the > other paths changing kernel text. So as to stuff like that doesn't get > missed next time I'm touching it. > > But with your way we don't need the additional buffer. I guess your > solution is better resource-wise. I pondered the buffer/text_poke variant, but that's too much of a hassle for a fix supposed to go to stable. Resourcewise you could use the buffer which is available in apply_alternatives anyway. Thanks, tglx