Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4800889ybv; Wed, 26 Feb 2020 03:20:52 -0800 (PST) X-Google-Smtp-Source: APXvYqw/Kkcr4X+wzvUWGebdjUjlKWWCfwtKRg7FglU6dnyoiaG4U1REbR4yi6soHIqvYPrpVULx X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr2491286ote.36.1582716052055; Wed, 26 Feb 2020 03:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582716052; cv=none; d=google.com; s=arc-20160816; b=HU3UawWYrwANW30kN68lvGs6R9uxdZYWnDCIJgyay/E/8p48hi8Xc9HbZ51Ss+2XpP WCKq5ZhPVx/z6HhfOQUMiI6qwo5vjEbNrUnoiT77gPEf/JuodsCEYCQmIxEgsqhZLWEo w34VdDgKlQWrSc4/6DqjYLnM9D/3xgBXd/50iTMZ4BaLyx1VHol4oEDSYHZS0x4FL3lV g/yix+eVA97wPXDKmuTEOrxHP8EZlreMpaZBECWZdjPldO0zb8Dm3Jm3qUGIeg8PGcSg vkiQkyAQ3/K65BfRP78l3hgi4e1Uq9Ssz+QP/Kr0d5StBdXmQV7INsddu7eXOvUm40hl 7DKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=cNtk5E6yBg6B3/z5M+SkvidmF9inEE+2d6uICsSh8LM=; b=R33MVztyS0iM5mvivzQ9afDecJmA3V50Koplxlm/MUmgaTnl4SOlAv7fjI9KeILeoz 7xsKFwFYio3Fs8hw2gOC7+e9UseKQGPEjiTJffB0aw8yHvtjAZY7wV31GuLjzbBPQs2o gnuGnIpnr/QkYf6WnH6FdYv+sIsvHfDpn7BrQ0zWwsOuaQEKichiEJkVPCexyT/Bszo+ ZOEYYvXI8osyF4KD7QylNtw633Oph94MQvxZ1E2up4Dfdt5ntWquW7oUm9q0TR3ZxFkT u7iqkN/zamOAlSw49DNAsvhd0Hf9FmCba6IaT5/69IE1D/d/anAQcg5v0VKxE4O5tOyc rn9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=h2WHtBI0; 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 n7si924602otk.277.2020.02.26.03.20.39; Wed, 26 Feb 2020 03:20:52 -0800 (PST) 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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=h2WHtBI0; 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 S1728153AbgBZLU3 (ORCPT + 99 others); Wed, 26 Feb 2020 06:20:29 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42739 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgBZLU3 (ORCPT ); Wed, 26 Feb 2020 06:20:29 -0500 Received: by mail-pf1-f196.google.com with SMTP id 4so1297874pfz.9 for ; Wed, 26 Feb 2020 03:20:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=cNtk5E6yBg6B3/z5M+SkvidmF9inEE+2d6uICsSh8LM=; b=h2WHtBI07xgxSUSkOp2ZStJaBUlbMbinoEAoe8rZvsKwosN/034yfIaYTuV/R/miue ItQp+1jcSZIOE7SImU0IYxQxmoP9HUatZzweHXMat62gS11374o0ZdCRV4wxdBH37sDO 2S8Qchnz4UzanC9KJnFySulPN0I6EBvzhOw/SBrd0SYiXrmzmtkFNgIiF43Gz9rKPchh S17IMmCwoH1hqK7I26vBPylFyMROZujoiv+B9hxje49SLNch/02+A5MbqBFRndth/iC/ Eyqji9euLlNOhh+vIadIuL0yW77v3i5CMpq6HrFus+9cnnwWPEeo2uYUHKAYPEGXPBxx ZMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=cNtk5E6yBg6B3/z5M+SkvidmF9inEE+2d6uICsSh8LM=; b=i/lYdsMTtiVG8cZxtc37z+/wrLhwIZQYHt80lXXQRcOTaANI7taBvQwemPZJDoqQTd 4lmNdnzX4u/VNLf8LcbCue0P1e34/UMhRvgsOc9Zt97tBW2fvdfy3/TNCpmeo0bLPmv1 IyuplLge+CMR3dNkYLYI7Y2hypOvrKyhUamn2vJy89OeRTT1WFvm/09eAOBbrlp2m0xK 3rUwFlTaU1ygF+ZKyJJ5rl/gwotFNho0fd4YPubGWTfYNG1TLtt+Hb7GYTAqt/9JqQhi xrKUK1aSTF/Xvm6/zRUQZCSsyNSEaUuuyqYJPYmds5TjTdtvAwTfN2apiAPEARqk2scA I6Og== X-Gm-Message-State: APjAAAUj6YfgxshWWzkThJ5bMt9oI148EqRzGaQ/XEImPCEb2g0cbGmp YEobApONoaSUnLuytETKMwmNQw== X-Received: by 2002:a63:ba05:: with SMTP id k5mr3335463pgf.174.1582716027000; Wed, 26 Feb 2020 03:20:27 -0800 (PST) Received: from ?IPv6:2601:646:c200:1ef2:b477:69e0:6292:cf08? ([2601:646:c200:1ef2:b477:69e0:6292:cf08]) by smtp.gmail.com with ESMTPSA id q11sm2708049pff.111.2020.02.26.03.20.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Feb 2020 03:20:26 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [patch 4/8] x86/entry: Move irq tracing on syscall entry to C-code Date: Wed, 26 Feb 2020 03:20:25 -0800 Message-Id: <83D8A083-792A-4A82-985C-CAC33BC702DB@amacapital.net> References: <20200226081726.GQ18400@hirez.programming.kicks-ass.net> Cc: Andy Lutomirski , Thomas Gleixner , LKML , x86@kernel.org, Steven Rostedt , Brian Gerst , Juergen Gross , Paolo Bonzini , Arnd Bergmann In-Reply-To: <20200226081726.GQ18400@hirez.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Feb 26, 2020, at 12:17 AM, Peter Zijlstra wrote:= >=20 > =EF=BB=BFOn Tue, Feb 25, 2020 at 09:43:46PM -0800, Andy Lutomirski wrote: >>> On 2/25/20 2:08 PM, Thomas Gleixner wrote: >>> Now that the C entry points are safe, move the irq flags tracing code in= to >>> the entry helper. >>=20 >> I'm so confused. >>=20 >>>=20 >>> Signed-off-by: Thomas Gleixner >>> --- >>> arch/x86/entry/common.c | 5 +++++ >>> arch/x86/entry/entry_32.S | 12 ------------ >>> arch/x86/entry/entry_64.S | 2 -- >>> arch/x86/entry/entry_64_compat.S | 18 ------------------ >>> 4 files changed, 5 insertions(+), 32 deletions(-) >>>=20 >>> --- a/arch/x86/entry/common.c >>> +++ b/arch/x86/entry/common.c >>> @@ -57,6 +57,11 @@ static inline void enter_from_user_mode( >>> */ >>> static __always_inline void syscall_entry_fixups(void) >>> { >>> + /* >>> + * Usermode is traced as interrupts enabled, but the syscall entry >>> + * mechanisms disable interrupts. Tell the tracer. >>> + */ >>> + trace_hardirqs_off(); >>=20 >> Your earlier patches suggest quite strongly that tracing isn't safe >> until enter_from_user_mode(). But trace_hardirqs_off() calls >> trace_irq_disable_rcuidle(), which looks [0] like a tracepoint. >>=20 >> Did you perhaps mean to do this *after* enter_from_user_mode()? >=20 > aside from the fact that enter_from_user_mode() itself also has a > tracepoint, the crucial detail is that we must not trace/kprobe the > function calling this. >=20 > Specifically for #PF, because we need read_cr2() before this. See later > patches. Indeed. I=E2=80=99m fine with this patch, but I still don=E2=80=99t understa= nd what the changelog is about. And I=E2=80=99m still rather baffled by most= of the notrace annotations in the series.=