Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4180788yba; Mon, 29 Apr 2019 15:15:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlQi0NWiHUvCaI7AOJzhg9rUHOzyaBgPInOHUPw6242iXsOkfzoh+wzULRgMf88yWfanTA X-Received: by 2002:a17:902:a583:: with SMTP id az3mr65691438plb.205.1556576104543; Mon, 29 Apr 2019 15:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556576104; cv=none; d=google.com; s=arc-20160816; b=GNHfzXg9xM346dJw/w/4XLHD0PR7Q0s93ZU4EBhASx4sOt6M4HcgoPO0lha2MTa/YT 37hoEIVCEE8mRlKZh+UYXzCmUgI6aQuPgoVU0X6gXI4sJhSVLAXg9ezL5XZap29vhxlN NPDrmnZPvzBgAuvKUSO8aFU7W4S89SMybDNHSB32wtHOrNHeQzy6rWMxvr4gtJ1HMFce NQvSyxamM2W/AdfCeXDStiP8mLqSvq9tdKMH7dctAV2zx+ocAlix1717Qm+BZMPMe6Hn PFP1fpSWkGPCZFrm6oBQ6cQHE2jryc0XK/bPPOi/nx1JMavrq/J/x6KtGZt/m7RApln4 Qw+g== 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=cTkJ5qHxsD8SYnb8NRVfGGysKDzTffkMwFGKzHjAIes=; b=m7vuN5iVK2EHqyOD3ZJKXwAdswLeImYCRSMUgahP94z+ivwF6nD8LucHrBUYBIbhBi Rx1yqM/QQCyc7CJKGy9GOp1pwXwcc4bh1huPEdmqu7KzF+Ne6TYBdsjsALAgEprkaoHI BXX6t9VYieDGbXVravF7aRwmjC7TRr+Mc0iAFBZWqZUZQD1KSVLSp9vSbCq0VtJ7bNI/ 36RlwAo8FbVsZMQmzxClP0F76WcpWenQalFlzljjUmedGDxLVtTewTLfqlxXxY/pwujM 7s0dW0Htv8hptWL5gIywsG7mrpHcFMq+bZIR0ApM/W0ohlCoI36PWpqX8WHQymlRIxkC +R8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="P/hvsAFB"; 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 w6si7065353pgs.119.2019.04.29.15.14.49; Mon, 29 Apr 2019 15:15:04 -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="P/hvsAFB"; 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 S1729565AbfD2WMW (ORCPT + 99 others); Mon, 29 Apr 2019 18:12:22 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38553 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728105AbfD2WMV (ORCPT ); Mon, 29 Apr 2019 18:12:21 -0400 Received: by mail-lj1-f195.google.com with SMTP id e18so4962906lja.5 for ; Mon, 29 Apr 2019 15:12:20 -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=cTkJ5qHxsD8SYnb8NRVfGGysKDzTffkMwFGKzHjAIes=; b=P/hvsAFBYFuVdRyxHJQqYZPAHZlzO7DpELqDJ8wtqrIzcq7eThvNjt852fIlr3+1hp vVyLfbe/O0jvxqP511QI0JfPRN9J+m8BMRz0pKGIgZRo0Qiu2YusRGP2+ndwrIJZA81T qOBt9kqSGLrhz0pQMSTGYNPFKlQsei2x7M0lc= 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=cTkJ5qHxsD8SYnb8NRVfGGysKDzTffkMwFGKzHjAIes=; b=BzE8y/jmEyN9QWh2Y//j/BU/pJiCDIMvticXldbenBP7bQniBTzIPN7bDkgyKdocOO 1IobUywfQ2rNLO7gSkjeJsIvfGXSL7rXoG62wyyJFrR0Q9I5rCRrJbLeaWJsphQmjMah bwek9H8lS8gzH0FAALfNnGYUgkVomq5OH9g7pqtS+4lVuPgyF6upNNlmj3ONZntMJS4e D/GuPjOsMxomLsP+OewNyomoNsBTElHiO926F9DQF0njmDk3+nfI/Hyvh+Ftw/HtDlmI SoRWg2Ns9jM/U5oF8kcsX4gpoROt/mQZz0R5TA19jeDTn7Jkw/ySMLjfgAe0xcUDEm2q tpNQ== X-Gm-Message-State: APjAAAWN5vl1RX+ez0Q2uz7iN1x2FJTfNDiLFZUwVFIhPbNfjwjqxxi3 ykMlJiMHyizELtrUfOGbQyaQNWmgBz0= X-Received: by 2002:a2e:884a:: with SMTP id z10mr24408117ljj.21.1556575939386; Mon, 29 Apr 2019 15:12:19 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id k10sm7162481ljh.86.2019.04.29.15.12.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 15:12:18 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id i68so9083061lfi.10 for ; Mon, 29 Apr 2019 15:12:18 -0700 (PDT) X-Received: by 2002:a19:48c9:: with SMTP id v192mr32975252lfa.136.1556575607339; Mon, 29 Apr 2019 15:06:47 -0700 (PDT) MIME-Version: 1.0 References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-4-nstange@suse.de> <20190427102657.GF2623@hirez.programming.kicks-ass.net> <20190428133826.3e142cfd@oasis.local.home> In-Reply-To: From: Linus Torvalds Date: Mon, 29 Apr 2019 15:06:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/4] x86/ftrace: make ftrace_int3_handler() not to skip fops invocation To: Andy Lutomirski Cc: Steven Rostedt , 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 Mon, Apr 29, 2019 at 11:57 AM Andy Lutomirski wrote: > > > > Otherwise you could never trust the whole sti shadow thing - and it very much is part of the architecture. > > Is this documented somewhere? Btw, if you really don't trust the sti shadow despite it going all the way back to the 8086, then you could instead make the irqoff code do push %gs:bp_call_return push %gs:bp_call_target sti ret which just keeps interrupts explicitly disabled over the whole use of the percpu data. The actual "ret" instruction doesn't matter, it's not going to change in this model (where the code isn't dynamically generated or changed). So I claim that it will still be protected by the sti shadow, but when written that way it doesn't actually matter, and you could reschedule immediately after the sti (getting an interrupt there might make the stack frame look odd, but it doesn't really affect anything else) Linus