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 D98F2C38A2D for ; Mon, 24 Oct 2022 20:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbiJXU0z (ORCPT ); Mon, 24 Oct 2022 16:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbiJXUYx (ORCPT ); Mon, 24 Oct 2022 16:24:53 -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 22ACC2E6BE; Mon, 24 Oct 2022 11:39:38 -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=PQNqs6IdtT9gCZUPfrGepUfUTCnXjYqE6ZtxOOCZbuY=; b=bZUxoZ3o+SOLm2CQBy+VttoP2B OUQg3xIogy0yBtLBjNHhw1AD98RCzB0kPet/YEkeMNmVR/Jmhxl2GbO9TFg6nk3qeBdntj9dcE/v/ nQts5mvftu6i0IDZtQ3YnguK28E+WnrwyIOrUDc2x63UPAzQ2pixygVcHRlZTrLavNxyFHLVHL2uS k14/UwfFI3DWikDyw/rSul/fVBClCA0zMSCYm8I+/lV1m1y334PA5s+FYIfGEhpNvPf/n04//nkZ8 1QoLyLZHGM65OVUTIkaIUyY+clnTYDxYiZgdNLCVFW2kkrWV6IfNI1VNDdOMV6HcwySTaqQIE5mqt xqXw/k8w==; 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 1omwDX-0063bj-GO; Mon, 24 Oct 2022 12:06:08 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7AEE33000DD; Mon, 24 Oct 2022 14:06:04 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5BAEE2018F17F; Mon, 24 Oct 2022 14:06:04 +0200 (CEST) Date: Mon, 24 Oct 2022 14:06:04 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Guo Ren , Lai Jiangshan , 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, zouyipeng@huawei.com, bigeasy@linutronix.de, David.Laight@aculab.com, chenzhongjin@huawei.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Borislav Petkov , Miguel Ojeda , Kees Cook , Nick Desaulniers Subject: Re: [PATCH V6 04/11] compiler_types.h: Add __noinstr_section() for noinstr Message-ID: References: <20221002012451.2351127-1-guoren@kernel.org> <20221002012451.2351127-5-guoren@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Mon, Oct 24, 2022 at 12:56:03PM +0100, Mark Rutland wrote: > How about we split this like: > > | /* > | * Prevent the compiler from instrumenting this code in any way > | * This does not prevent instrumentation via KPROBES, which must be > | * prevented through other means if necessary. Perhaps point to NOINSTR_TEXT in vmlinux.lds.h > | */ > | #define __no_compiler_instrument \ > | noinline notrace noinline notrace __no_kcsan \ > | __no_sanitize_address __no_sanitize_coverage > | > | /* > | * Section for code which can't be instrumented at all. > | * Any code in this section cannot be instrumented with KPROBES. > | */ > | #define noinstr __no_compiler_instrument section(".noinstr.text") > > ... then we don't need __noinstr_section(), and IMO the split is > clearer. Yeah, perhaps, no strong feelings. Note I have this in the sched-idle series as well (which I still need to rebase and repost :/).