Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp222704ybf; Wed, 26 Feb 2020 11:53:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzDLXstMlYdyY5rs9ZagBxWQeor4hzt2a17CsvHByoF44kgRmyV50lK+5rxz2sWKWXUz3j6 X-Received: by 2002:a9d:34c:: with SMTP id 70mr348287otv.174.1582746792277; Wed, 26 Feb 2020 11:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582746792; cv=none; d=google.com; s=arc-20160816; b=P6CGc7dh5aZzN3SC18POckfRg9Fwsz9LeVwJc7SQCyUM8V0WzhqlJHXMjyp8wGZ0aZ D8MFZ3Eq3ieo4AIlCfuU/itOHgIoeomTmAfX58V8dGb0C463ZU1EOv+11/M57tIFavSp q3hi0ntYDsIGzDNOiMbIynTOO1qeZ2vTZdKkKbi5Hx82dprqMc7QUeBm3EcXVNKT4JJ+ 4FkuSrGkulxH0vxIAf5tW3FxPiH4I7ixA+0+cSPiY45c5/p4RlD7vuxjte2zWyM8YoLP 61MIWpChNaA0abuHxcsY2qCOVNqq6CQ4qcajEhZ+HhnLsXjRlO9kMS/Qf5HSQiJStqev ktMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=jdPbgO3XJCjDf4OWzb8yIOL93YegwDPO5ylzO6nTXvk=; b=TEcDMYe88k337Z6Z0hUTSgE2pFHXMtDUomPjN7ad3mgXEWoL5KW3JchEhERRcgctQh bWnh7eD4K5ASDL17xOMmVEtZ9aFWOdgCK2ny4wX+0SSpMnye6dnfudphM6wARmv9CFxJ Mrm/TGqwu2h2BnxuQKHWa7nouBedeqjBYIUiBAAA6RQ4/HYCjVbJLTFPZUUR8DkCfACY 2/EkQx1wVsDRIUspkf1GWhaZm3/0Asqr0k+5ZNOW1jvUZ1tKrfb7jgeiLYGU9oDBUK1F TouQM0qRmoVu5+ZY/EnW0NjA4sDGRzBK0UyDvw3sBasJY57VSbK+GCGQ6EuFQJTZkQuZ /s5A== ARC-Authentication-Results: i=1; mx.google.com; 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 f23si236296oto.205.2020.02.26.11.52.58; Wed, 26 Feb 2020 11:53:12 -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; 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 S1727258AbgBZTvS convert rfc822-to-8bit (ORCPT + 99 others); Wed, 26 Feb 2020 14:51:18 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:59365 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbgBZTvS (ORCPT ); Wed, 26 Feb 2020 14:51:18 -0500 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j72hx-0005Qo-QL; Wed, 26 Feb 2020 20:51:01 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 3C141104099; Wed, 26 Feb 2020 20:51:01 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski , Peter Zijlstra Cc: Andy Lutomirski , LKML , x86@kernel.org, Steven Rostedt , Brian Gerst , Juergen Gross , Paolo Bonzini , Arnd Bergmann Subject: Re: [patch 4/8] x86/entry: Move irq tracing on syscall entry to C-code In-Reply-To: <83D8A083-792A-4A82-985C-CAC33BC702DB@amacapital.net> References: <20200226081726.GQ18400@hirez.programming.kicks-ass.net> <83D8A083-792A-4A82-985C-CAC33BC702DB@amacapital.net> Date: Wed, 26 Feb 2020 20:51:01 +0100 Message-ID: <87sgixb00q.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: >> On Feb 26, 2020, at 12:17 AM, Peter Zijlstra wrote: >> On Tue, Feb 25, 2020 at 09:43:46PM -0800, Andy Lutomirski wrote: >>> 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. >>> >>> Did you perhaps mean to do this *after* enter_from_user_mode()? >> >> 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. >> >> Specifically for #PF, because we need read_cr2() before this. See later >> patches. > > Indeed. I’m fine with this patch, but I still don’t understand what > the changelog is about. Yeah, the changelog is not really helpful. Let me fix that. > And I’m still rather baffled by most of the notrace annotations in the > series. As discussed on IRC, this might be too broad, but then I rather have the actual C-entry points neither traceable nor probable in general and relax this by calling functions which can be traced and probed. My rationale for this decision was that enter_from_user_mode() is marked notrace/noprobe as well, so I kept the protection scope the same as we had in the ASM maze which is marked noprobe already. Thanks, tglx