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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD176C38145 for ; Thu, 8 Sep 2022 07:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbiIHHeU (ORCPT ); Thu, 8 Sep 2022 03:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiIHHeP (ORCPT ); Thu, 8 Sep 2022 03:34:15 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9632A9C510; Thu, 8 Sep 2022 00:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qOOipAMFA6jU/iAD0NNT6fAlhjOnSrPaO5m9WLa7Ha0=; b=XWBTcDwPn7I4lM/UNGkV9JDC7V LCGE6JzoqcxPZHavPhQOjtc8pc1L45zx/Z2uFkIMZMs3VYT4POhxsWq5PHApBJxUSSbMmk/Hr/aiv CEifLxaRKaSOiaR4y0jtY8R3Hr/YaFoxr48v8KhsNv6unvME1pwvn3iZrUgFDitZ9Xl+74K4NKKm2 NYV3WlSA02f8JTjdBIlt8QFSF2HGaTRkd6y2wSAl9os41Vtu4WbyQSZyDe6WjCofFt/kp+bWuL/9a bCdlkmqc6G0o2XCGIf4rM1CpC6pvFHO9CnZpGUmTN5oFCDVqj9AKAj24niruMjW18qgGtG/mKfiXU S1p/LumQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWC2d-00Ae5F-8k; Thu, 08 Sep 2022 07:33:39 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0B03D30004F; Thu, 8 Sep 2022 09:33:35 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A0DA92B99E10D; Thu, 8 Sep 2022 09:33:35 +0200 (CEST) Date: Thu, 8 Sep 2022 09:33:35 +0200 From: Peter Zijlstra To: guoren@kernel.org Cc: arnd@arndb.de, palmer@rivosinc.com, tglx@linutronix.de, luto@kernel.org, conor.dooley@microchip.com, heiko@sntech.de, jszhang@kernel.org, lazyparser@gmail.com, falcon@tinylab.org, chenhuacai@kernel.org, apatel@ventanamicro.com, atishp@atishpatra.org, palmer@dabbelt.com, paul.walmsley@sifive.com, bigeasy@linutronix.de, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Guo Ren Subject: Re: [PATCH V4 4/8] riscv: traps: Add noinstr to prevent instrumentation inserted Message-ID: References: <20220908022506.1275799-1-guoren@kernel.org> <20220908022506.1275799-5-guoren@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908022506.1275799-5-guoren@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 07, 2022 at 10:25:02PM -0400, guoren@kernel.org wrote: > From: Guo Ren > > Without noinstr the compiler is free to insert instrumentation (think > all the k*SAN, KCov, GCov, ftrace etc..) which can call code we're not > yet ready to run this early in the entry path, for instance it could > rely on RCU which isn't on yet, or expect lockdep state. (by peterz) > > Link: https://lore.kernel.org/linux-riscv/YxcQ6NoPf3AH0EXe@hirez.programming.kicks-ass.net/raw > Suggested-by: Peter Zijlstra > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > --- > arch/riscv/kernel/traps.c | 8 ++++---- > arch/riscv/mm/fault.c | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c > index 635e6ec26938..3ed3dbec250d 100644 > --- a/arch/riscv/kernel/traps.c > +++ b/arch/riscv/kernel/traps.c > @@ -97,7 +97,7 @@ static void do_trap_error(struct pt_regs *regs, int signo, int code, > #define __trap_section > #endif > #define DO_ERROR_INFO(name, signo, code, str) \ > -asmlinkage __visible __trap_section void name(struct pt_regs *regs) \ > +asmlinkage __visible __trap_section void noinstr name(struct pt_regs *regs) \ But now you have __trap_section and noinstr both adding a section attribute.