Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1523982pxb; Tue, 26 Oct 2021 10:33:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiIhU/L1z8GQfeVttQd8d1YAfMVRSqXPkLVJoLMZYV1IYZo1br1uu5Ssaxx97hGMnpDWiV X-Received: by 2002:a17:902:c407:b0:13f:68f:6753 with SMTP id k7-20020a170902c40700b0013f068f6753mr23268862plk.39.1635269592568; Tue, 26 Oct 2021 10:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635269592; cv=none; d=google.com; s=arc-20160816; b=Wh4wVKT++TusnDYGl14b4XYGUBXA+MEZjsLJaYmjDrLUOLVpcncGZFII/TYV068lsQ nd3DZMERphdlQXkD+8bCAAIDJEPDFRYGe+KmwOOQ29J6lOUqMv4guazE2lN5+4HkHD1h xPVKB0rbMcBWBy7rij46MPdEfWZvOJrt55JQTg8vj80PigpI+bcqzrxHGHnTV5WGL9HD 0S4HLb+43U1rSWfI5VyihfnyKAyLluVoXDfFQDENl80nfnzkOGbsqkYDHMVGfSUppyaD BPIxsIzuOJjvlruZ//kKoJBWJFeQrvbsCqCL11JsnDWxgk/Be4wNDZchgpk5TgxcGhnR 5Jow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yohk6bB6weZvIQ6DqBBBe5OJOa5DqldDKQ6ZoRfyBW8=; b=ctBxY+BMQKOjtuT9a4GaN5of6aXRHiC8CkgmLSjb/O3eztq6lhgFo+NZx/YXqD64OQ LNskb6lY+N2lto2qs1sh6IxZX6Ff30H+9PV6Pxw1zc0pGiCPN4KULa8hajQW8vI7CXcv 6OPmnmTGpwkvwpK3rCuElXhK4AYEnsjK6rCjvIC+rDTpRY1pfR7prDmX6oj4YO290aQU yDCyvQxyJjG8no6WofY4wxZPcuUWjq70zd4lk/peRZLVSmABeFR6wAbXUgbtRa0gqLDu AvW5nXOIN6fWy1YWcjUtAqcbgSW9KGUaOvZUh9/6nFw12p4h4m6kxG5znmz1Z+5IQOxD r8DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TI5LxOXH; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v202si1399417pgb.363.2021.10.26.10.32.57; Tue, 26 Oct 2021 10:33:12 -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=@gmail.com header.s=20210112 header.b=TI5LxOXH; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236485AbhJZOYI (ORCPT + 99 others); Tue, 26 Oct 2021 10:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235492AbhJZOYH (ORCPT ); Tue, 26 Oct 2021 10:24:07 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC38DC061767 for ; Tue, 26 Oct 2021 07:21:43 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id c4so14280346pgv.11 for ; Tue, 26 Oct 2021 07:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yohk6bB6weZvIQ6DqBBBe5OJOa5DqldDKQ6ZoRfyBW8=; b=TI5LxOXH+Ej34Xgd61KMUpF77i7dYBG+Cu4msQfkRqWG1WwJTRKcJlAKinREbHC3l5 WKibpY+0MxJR6OOgW9OqXyNzHGpBPyDrjoARbt/NIFSB7VDo8tSn/qXOjX/dqiMgmMgC ZyzaH9fSS93RUG6qzOMtL6SGfJCu/QBOXU8nNdzS56Rgxm2jPsr/fynBVakzKO1lOnim LHmPkoGAg3h+7cquVZX0W43ZV1K24d5KNs4TElYCK+zK32UiNjtVAVMd2FngxhWldxpI Oj4HritkXFuLSuR9rVPFOaWr3Ifxpe887kbZAyyyT0y1OJkm4gAcBkz9P06hQ9aHtLRj 2jVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yohk6bB6weZvIQ6DqBBBe5OJOa5DqldDKQ6ZoRfyBW8=; b=26RTJVLYbG6GD3adgDbKDTZ9CTN2Z1ZXvlt2n/6C24r0PhZtPMb2Ps+dC2Z+u1nD0U Qfs12muXJ3bWCDQieQ3woarAfjuIu7grhN9Z39H5WIi4VtuBl9vWm1Wn9+iExKjERfvf DXSssjgaZuqgZRxwZurDnjS4jVQ0sYKJwGzsXF+qD9qNa8y4S1EIAZL+cS+GUOSFhJR4 e+2knoUq9nZLso749zG2ou7cY7/qUvvlHm/t9BpVb8Uouu3lYoDRFIeCm+4Lj1NcTJzU BZSiQndzv2EpCPYzRj/vrQLrFZz1Vqbld9JQOrkkAurnHiaa7P95+trcLcpH+FGUY3m9 Cocw== X-Gm-Message-State: AOAM531BV6A5nX8H0kEv4vp28ExtkW5Z+OQsqQnTVvz3CPU78/nMLj9k 1bCh53bCWYbPgHU1Ze8+a24v3J+TnWs= X-Received: by 2002:a62:e514:0:b0:47c:12f6:3aae with SMTP id n20-20020a62e514000000b0047c12f63aaemr3635707pff.26.1635258103256; Tue, 26 Oct 2021 07:21:43 -0700 (PDT) Received: from localhost ([47.88.5.130]) by smtp.gmail.com with ESMTPSA id h24sm23429671pfn.180.2021.10.26.07.21.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 07:21:42 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Lai Jiangshan , Borislav Petkov , Miguel Ojeda , Kees Cook , Nathan Chancellor , Miguel Ojeda , Nick Desaulniers , "Peter Zijlstra (Intel)" , Sami Tolvanen , Masahiro Yamada , Marco Elver , Arnd Bergmann , Ard Biesheuvel Subject: [PATCH V4 06/50] compiler_types.h: Add __noinstr_section() for noinstr Date: Tue, 26 Oct 2021 22:20:14 +0800 Message-Id: <20211026142058.17702-2-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211026141420.17138-1-jiangshanlai@gmail.com> References: <20211026141420.17138-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lai Jiangshan And it will be extended for C entry code. Cc: Borislav Petkov Cc: Miguel Ojeda Reviewed-by: Kees Cook Suggested-by: Nick Desaulniers Suggested-by: Peter Zijlstra Signed-off-by: Lai Jiangshan --- include/linux/compiler_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index b6ff83a714ca..df6f7252047e 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -208,9 +208,11 @@ struct ftrace_likely_data { #endif /* Section for code which can't be instrumented at all */ -#define noinstr \ - noinline notrace __attribute((__section__(".noinstr.text"))) \ - __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage +#define __noinstr_section(section) \ + noinline notrace __section(section) __no_profile \ + __no_kcsan __no_sanitize_address __no_sanitize_coverage + +#define noinstr __noinstr_section(".noinstr.text") #endif /* __KERNEL__ */ -- 2.19.1.6.gb485710b