Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5260605yba; Tue, 30 Apr 2019 11:41:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAkf+FRU5FfOydczSVRBowzVpnsb1B2TSgM45akzqSHk8Yyf6sBfGkpS8Vat5w6KXDzENm X-Received: by 2002:aa7:9aaa:: with SMTP id x10mr29931062pfi.225.1556649713697; Tue, 30 Apr 2019 11:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556649713; cv=none; d=google.com; s=arc-20160816; b=n4t0uA9VsKBFtj+ngnMT+lMEuVY9OP1u7bEojechPGjzaeWnIncbC0eiFfY0tq/WGI z/LpFWRJiiemeI30Lp4mGD7eLgRAWYePwwbSTQ9zaVZYHD/XByYiQwPxNZgYFyfi7Gam 0kMUwURzkalIDvBLxov+78K10lT+IAmqzmYsvW/oRoR/a0wZSf9XtFO66fUR7TB1gLIg rc24U3T+fiiWor42zz+6PwSOm9mWcz6TVSDrb0vlk2U4iQU/bvUEK71ddHelzBte7Ogd tLMAm7ERf3ctqrmJa4zvZtqHiCn47ZXvRYpYwdLVXYpLFVPuMfoY0A9RjAtyLBWWZqET eF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uKQ5wQDmcWGNS5cFgE6sknQ1Vaz0sJXUmzUNGiZJEQw=; b=yBv2c+SiFd/Qiv+beIXP9NU5sLhTntorTiH+z1WUwxLDERJgTTO12xfbAgElb6GFVK QzLUXDWmTuQ96OAw8R1Gr6uZhWhvKfwmFNCaNXE88LdDoQYhz5ptx3M6uP/FX2o0lPC+ qSRKCB8qsfgRqYrb1rcyD7vkKQ9Ty7MtEcIznoZCLR1cb/wmBK3tDm0h36OtqmQED/in TLoTj1YB2wOQ51avsPDrpwNy0eqcbYm0i7tIRxu0HsnnnLX9RO1XFdDN6RkU+AwWwoyS yzEqFVQqtaGSsU2wzO1gNzwe2ztrL8O4X55YNZSTRZ1eeqeii/K1PfFGzSaPvLVfsQVi v7Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cA+Fnbmk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16si36737031pgb.501.2019.04.30.11.41.38; Tue, 30 Apr 2019 11:41:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cA+Fnbmk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbfD3SjS (ORCPT + 99 others); Tue, 30 Apr 2019 14:39:18 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34767 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfD3SjS (ORCPT ); Tue, 30 Apr 2019 14:39:18 -0400 Received: by mail-lj1-f195.google.com with SMTP id s7so11036256ljh.1 for ; Tue, 30 Apr 2019 11:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uKQ5wQDmcWGNS5cFgE6sknQ1Vaz0sJXUmzUNGiZJEQw=; b=cA+Fnbmk0I5OJp9OtlS1S8PhpJVuthIr36z1RS/i4PikRfFVCqQc79YE883gVNbbQX rU4NivMUS9CGP8EKH0Hrd/XaBHYNd2ifkjss3yQ02d2fuubygig5Isugs+12vrC+6Brv XyP/4uH/8t46MMd0PxWi8jRHESv+uau/CAOfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uKQ5wQDmcWGNS5cFgE6sknQ1Vaz0sJXUmzUNGiZJEQw=; b=eXY7WqXXB6vSqzohjSt1J+MIUbaOy1C9G9YH0QS55xqV1Sb5r3LsDJcPkWEDbGUShY 0MsFJwQilCBE0baFBexWZXJdebRp4h1MLdgI95TU6BQ9GuBywWd6G+59QO+WtxiT+ME5 nEnYu6/GcEfOYjWqkrGh3QAjKJByLBuOeXHVm7+HmbcMc7dvevmhxtBI9IrZ5ZBi5LSO zbxGqMEjH4hRQq989vye9GlQcav5hj4Z/L7uYuvMOScrv8eojfCy6ypjjGqC0SOGMScl 4c1lHVCzdkDiDDONF8z0NIHG5hbCscg2KnzF0HzEistfKb4NTOjyfwUsuc4rEeZeqoAP jcjw== X-Gm-Message-State: APjAAAUrLfZCkL6NRy8lYYOhci+32y1K3SElMfKR6NtlP1Z2KfMvcYrQ tgIjcubAuDbvFVhWrixXQhUWbAa9jWI= X-Received: by 2002:a2e:655a:: with SMTP id z87mr1840427ljb.150.1556649555644; Tue, 30 Apr 2019 11:39:15 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id y7sm7622532ljy.65.2019.04.30.11.39.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 11:39:15 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id y8so7350924ljd.3 for ; Tue, 30 Apr 2019 11:39:15 -0700 (PDT) X-Received: by 2002:a2e:22c4:: with SMTP id i187mr36309820lji.94.1556649217849; Tue, 30 Apr 2019 11:33:37 -0700 (PDT) MIME-Version: 1.0 References: <20190428133826.3e142cfd@oasis.local.home> <20190430135602.GD2589@hirez.programming.kicks-ass.net> <20190430130359.330e895b@gandalf.local.home> <20190430132024.0f03f5b8@gandalf.local.home> <20190430134913.4e29ce72@gandalf.local.home> In-Reply-To: <20190430134913.4e29ce72@gandalf.local.home> From: Linus Torvalds Date: Tue, 30 Apr 2019 11:33:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] ftrace/x86: Emulate call function while updating in breakpoint handler To: Steven Rostedt Cc: Andy Lutomirski , Peter Zijlstra , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "the arch/x86 maintainers" , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , Linux List Kernel Mailing , live-patching@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 30, 2019 at 10:49 AM Steven Rostedt wrote: > > + > +asm( > + ".text\n" > + > + /* Trampoline for function update with interrupts enabled */ > + ".global ftrace_emulate_call_irqoff\n" > + ".type ftrace_emulate_call_irqoff, @function\n" > + "ftrace_emulate_call_irqoff:\n\t" > + "push %gs:ftrace_bp_call_return\n\t" Well, as mentioned in my original suggestion, this won't work on 32-bit, or on UP. They have different models for per-cpu data (32-bti uses %fs, and UP doesn't use a segment override at all). Maybe we just don't care about UP at all for this code, of course. And maybe we can make the decision to also make 32-bit just not use this either - so maybe the code is ok per se, just needs to make sure it never triggers for the cases that it's not written for.. > + "ftrace_emulate_call_update_irqoff:\n\t" > + "push %gs:ftrace_bp_call_return\n\t" > + "sti\n\t" > + "jmp *ftrace_update_func_call\n" .. and this should then use the "push push sti ret" model instead. Plus get updated for objtool complaints. Anyway, since Andy really likes the entry code change, can we have that patch in parallel and judge the difference that way? Iirc, that was x86-64 specific too. Linus