From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50AD7C43387 for ; Fri, 11 Jan 2019 20:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2796B2133F for ; Fri, 11 Jan 2019 20:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389308AbfAKUE3 (ORCPT ); Fri, 11 Jan 2019 15:04:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41170 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732290AbfAKUE2 (ORCPT ); Fri, 11 Jan 2019 15:04:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5ACE28046C; Fri, 11 Jan 2019 20:04:28 +0000 (UTC) Received: from treble (ovpn-122-231.rdu2.redhat.com [10.10.122.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAF5C81620; Fri, 11 Jan 2019 20:04:22 +0000 (UTC) Date: Fri, 11 Jan 2019 14:04:20 -0600 From: Josh Poimboeuf To: Linus Torvalds Cc: Nadav Amit , Andy Lutomirski , Peter Zijlstra , the arch/x86 maintainers , Linux List Kernel Mailing , Ard Biesheuvel , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 0/6] Static calls Message-ID: <20190111200420.qtyffayxceysoarf@treble> References: <20190110203023.GL2861@worktop.programming.kicks-ass.net> <20190110205226.iburt6mrddsxnjpk@treble> <20190111151525.tf7lhuycyyvjjxez@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 11 Jan 2019 20:04:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 11:03:30AM -0800, Linus Torvalds wrote: > The we'd change the end of poke_int3_handler() to do something like > this instead: > > void *newip = bp_int3_handler; > .. > if (new == magic_static_call_bp_int3_handler) { > if (regs->flags &X86_FLAGS_IF) { > newip = magic_static_call_bp_int3_handler_sti; > regs->flags &= ~X86_FLAGS_IF; > } > regs->ip = (unsigned long) newip; > return 1; > > AAND now we're *really* done. > > Does anybody see any issues in this? This sounds ok, with a possible tweak: instead of the sti tricks, couldn't we just use synchronize_rcu_tasks() (as Jason suggested), to make sure the stubs are no longer used by a preempted task? But really, to me, having to create and manage all those custom trampolines still feels a lot more complex than just making a gap on the stack. -- Josh