Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754773Ab3GJVtI (ORCPT ); Wed, 10 Jul 2013 17:49:08 -0400 Received: from mail.skyhub.de ([78.46.96.112]:35885 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162Ab3GJVtF (ORCPT ); Wed, 10 Jul 2013 17:49:05 -0400 Date: Wed, 10 Jul 2013 23:48:48 +0200 From: Borislav Petkov To: "H. Peter Anvin" Cc: Jiri Kosina , Masami Hiramatsu , Steven Rostedt , Jason Baron , Borislav Petkov , linux-kernel@vger.kernel.org Subject: Re: [RFC] [PATCH 1/2 v2] x86: introduce int3-based instruction patching Message-ID: <20130710214848.GB14879@pd.tnic> References: <51DDD3E9.6090601@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51DDD3E9.6090601@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1246 Lines: 34 On Wed, Jul 10, 2013 at 02:36:41PM -0700, H. Peter Anvin wrote: > I'm wondering if it would be easier/more general to just return to the > instruction. The "more general" bit would allow this to be used for > other things, like alternatives, and perhaps eventually dynamic call > patching. Well, the aspect of not using stop_machine in alternatives is a don't care because there we do text_poke_early on the BSP anyway. However, there we toggle interrupts so it would probably be interesting to see whether a non-interrupt-disabling variant would be faster. > Returning to the instruction will, in effect, be a busy-wait for > the faulted CPU until the patch is complete; more or less what > stop_machine would do, but only for a CPU which actually strays into > the affected region. Oh, something like we patch in a two-byte jump first: 1: jmp 1b until we finish patching the rest? Ha, interesting :). -- Regards/Gruss, Boris. Sent from a fat crate under my desk. Formatting is fine. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/