Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4958423pxb; Thu, 14 Oct 2021 15:49:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjNajp8UWhkMPJiqkyi2qbjDrlFvFVn3PWsjOTPR6kcJRPvFenczTm5N4mPWHPhoTlVmsw X-Received: by 2002:a50:d8c2:: with SMTP id y2mr12625458edj.360.1634251772841; Thu, 14 Oct 2021 15:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634251772; cv=none; d=google.com; s=arc-20160816; b=VZRiUrGecdBIJOyYfeLlx0nm07gF+UCJdv40Y6XIFA8pCs9G6q+6kIOYHxSAGu8bHs akfku07ejeKUyRoS/Ek6wMaulJZwaCIzGBAvEYy9vyUzT9DUKCMsrveCpbeBjVdpYuv1 wnS6726i+JRsgzp6lgClJNrFkXiTkHkKli3qa5FvNXyrliWnuNj8rzdfJFZAq6vNIK/Z YO3TNkYyxZAcHMYGHvL+rWhQuJ/ebHgdYI3dKmNRLA0vZjyGhfn14Rq2rqFQX2P8D6px mBirZoSzo3EEIg8F8ii2Ze1YQiMMgwaLx1pmR3odCnlnUXChiERr9+AdybTObrWetqHd EHdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4Q08MJAaZlA776YK6MXdrO/QEwzpx3n27ZLpuwXkThw=; b=RWOSjCKQlIwQ8Nq/mTM9g5q7hxzMxIrVhyde0ftYnpTJQ/WG+g/18jq+Yc1i8xTSzR +EUHpoE/5chbysHwdoSDmnNtvo9kZBXNSYorndfvttuIwQEaBty55acGfQDdS1jf5Ssk Ya80CvTVIem2A0VveUExOCyOwchiUrc/8Pm8uS/pyHKsUGQ3X2N9yPECe7p4u/q8et+d NQ6NQti5KVEXVBnO1WE5i3LsZhXOt+aXtWGqAu18HPZ6PISU124NF2nDKfsmt+ZuzkVa Q7wT31mcI6RPjaLL27B/YEtlYiN6DTy5m5U7emIgUkDITQS48xInjjax/yQ75eYp/jDY b++A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pxjIkxUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si5202834edf.574.2021.10.14.15.49.06; Thu, 14 Oct 2021 15:49:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pxjIkxUa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbhJNSby (ORCPT + 99 others); Thu, 14 Oct 2021 14:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhJNSbx (ORCPT ); Thu, 14 Oct 2021 14:31:53 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C981C061570 for ; Thu, 14 Oct 2021 11:29:48 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id p16so31043741lfa.2 for ; Thu, 14 Oct 2021 11:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Q08MJAaZlA776YK6MXdrO/QEwzpx3n27ZLpuwXkThw=; b=pxjIkxUamfFNklraVabacOoKg9PxYf64xqV6vkb+E8xtgwBcjApEw8QVlqy8y9NQc4 l7t4KRR713efMFF2eby6vS9A+DT8bI2rw+y8gyiqq9I7uaj9rK3jW4cPoqpTSB8BcOMM PsGMLXiAgyfp64xQxCnaZG6itTW5tkL0De5/qQmrNMY1L2NhgG3wgAMFlXfBArAITK3B e4uJXWX0Vy0c4BIrZzmS8F1OpV5d5WcyZY/ryQH0pdxhogPSkxjpLO8TOV+cmdraiib4 rHgNFKCgJ9Vl1KAFxP5Ujp2ufyOs/I2qupsTcKXWOTrwfwJcd0gYHojDuURacGpV+DPx TFxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Q08MJAaZlA776YK6MXdrO/QEwzpx3n27ZLpuwXkThw=; b=8BVSH9baqRerAtfE3JN+3IPJ+2LBOIW31WbRtjz0E5aKyxFafKc8kZaaA3RPczVc5L 3qo/2gdDYJqR6JJzIljke22GlwP1CP43Rpl64JOoCXJDphlHaW4eJey/4e6plDksg5tf 23ZJTj8Wc5FldKW5XvL60dvKJU5nqbEs3X1Izd8VcDv7icBb1t5dTdWA4MURVri5oNzu Wz+38Pcp75+6NLIid3I0akZqs4sx06XhJSH7vM2jco2puVeJLotqE7gs23BX+pooG4Vl IN2XC3iOc+UzIh7nmHU0eNULMRjJwcctimj1QFrsXW0Ff1ZXty1C6UidbDzZjfMn2Rgw GEEw== X-Gm-Message-State: AOAM532tdKlwZULJSxLV2nVAmjPWUT3NfE8ppmpvRDxRx8hhqQn2Taj9 4aH17gXIcrAYTyEXnbnho/+ZO6AljWtpPhQyNb0J/w== X-Received: by 2002:a2e:81d6:: with SMTP id s22mr7447338ljg.128.1634236186376; Thu, 14 Oct 2021 11:29:46 -0700 (PDT) MIME-Version: 1.0 References: <20211014031413.14471-1-jiangshanlai@gmail.com> <20211014033414.16321-1-jiangshanlai@gmail.com> In-Reply-To: <20211014033414.16321-1-jiangshanlai@gmail.com> From: Nick Desaulniers Date: Thu, 14 Oct 2021 11:29:34 -0700 Message-ID: Subject: Re: [PATCH V3 06/49] compiler_types.h: Add __noinstr_section() for noinstr To: Lai Jiangshan , Miguel Ojeda Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Lai Jiangshan , Borislav Petkov , Kees Cook , Nathan Chancellor , "Peter Zijlstra (Intel)" , Sami Tolvanen , Masahiro Yamada , Marco Elver , Arnd Bergmann , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 8:34 PM Lai Jiangshan wrote: > > From: Lai Jiangshan > > And it will be extended for C entry code. > > Cc: Borislav Petkov > Reviewed-by: Kees Cook > Signed-off-by: Lai Jiangshan > --- > include/linux/compiler_types.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h > index b6ff83a714ca..3c77631c68bd 100644 > --- a/include/linux/compiler_types.h > +++ b/include/linux/compiler_types.h > @@ -208,10 +208,12 @@ struct ftrace_likely_data { > #endif > > /* Section for code which can't be instrumented at all */ > -#define noinstr \ > - noinline notrace __attribute((__section__(".noinstr.text"))) \ > +#define __noinstr_section(section) \ > + noinline notrace __attribute((__section__(section))) \ Can we use __section(section) here (from include/linux/compiler_attributes.h)? I kind of can't stand seeing attributes open coded. > __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage > > +#define noinstr __noinstr_section(".noinstr.text") > + > #endif /* __KERNEL__ */ > > #endif /* __ASSEMBLY__ */ > -- > 2.19.1.6.gb485710b > -- Thanks, ~Nick Desaulniers