From patchwork Fri Oct 18 09:42:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11197977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95F6613B1 for ; Fri, 18 Oct 2019 09:43:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 631D820820 for ; Fri, 18 Oct 2019 09:43:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="M1OHTJFs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 631D820820 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E9FF88E0021; Fri, 18 Oct 2019 05:43:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E6F758E0003; Fri, 18 Oct 2019 05:43:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5E7F8E0021; Fri, 18 Oct 2019 05:43:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id B611A8E0003 for ; Fri, 18 Oct 2019 05:43:32 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 5B085FB7D for ; Fri, 18 Oct 2019 09:43:32 +0000 (UTC) X-FDA: 76056417864.02.drain46_7627fb41a9548 X-Spam-Summary: 2,0,0,92efe5750802bb21,d41d8cd98f00b204,3q4mpxqykco4wbytuhweewbu.secbydkn-ccalqsa.ehw@flex--glider.bounces.google.com,:glider@google.com:vegard.nossum@oracle.com:schwidefsky@de.ibm.com:aryabinin@virtuozzo.com:dvyukov@google.com:,RULES_HIT:41:152:355:379:541:800:960:967:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1535:1543:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2525:2553:2559:2563:2682:2685:2859:2899:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3152:3354:3865:3866:3867:3868:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6119:6120:6261:6653:7901:8603:9025:9969:10004:10400:11026:11232:11473:11657:11658:11914:12043:12114:12296:12297:12438:12555:12698:12737:12895:13180:13229:13255:13846:14096:14097:14181:14394:14659:14721:21080:21365:21444:21451:21627:30029:30054:30064:30070:30090,0,RBL:error,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF :fp,MSBL X-HE-Tag: drain46_7627fb41a9548 X-Filterd-Recvd-Size: 5867 Received: from mail-qk1-f202.google.com (mail-qk1-f202.google.com [209.85.222.202]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Oct 2019 09:43:31 +0000 (UTC) Received: by mail-qk1-f202.google.com with SMTP id v143so4911393qka.21 for ; Fri, 18 Oct 2019 02:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=5sJ27FR/T7ltMjmEdKxnPYRQomCfdE3/RtdupJGc9Xw=; b=M1OHTJFs+TZpQ19jfDEAmHPoTbxVEF+/eF74bWLnxpDUcAqRT+sBul+V3jnyqrTZqk RauYRUDnMBALHzWc5grRJ2RA4ZVbGoVebmr2vsvUVDUx67VF1Ob5O7FKbBOkoQ3Yz5fV vmoGOPuaFJEY4lOkWMRNcd1bX+VgVPgwRb/ehjwdxqr3ndaEZS89wXfwYVIwqUfTzDEP EcHZgq35GaIfXl6AM3kF20q9B1CvDT0q4QJcZEtCl7JG16nX8gTS8Nut7iHTX7B275Ho ufgJ3rEMCfWPzzmYqL1m18q6nyTxKxj6KwXQoDB7qQfiqqJa9nv9wO2oE8Ut01YbS8ah KdPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=5sJ27FR/T7ltMjmEdKxnPYRQomCfdE3/RtdupJGc9Xw=; b=E1ZdgRcvISxvkQzk3xAPi1qGelL+hM9JkvUjGhkqUp334autaR8frFI2C+qqFD/tAb vLErik9SY/OmhDq3+4kaz+MGTnRX910QzWGP80MTgs6ot/PpC6TeKIIrlU+iVM0c6h40 LnH/GzpV8SOoDdIQrVo4TSO2UdPjuEE/khUm8O8CLu8siQ/zPGy5pVwGQAwSg7HPTInF HANxSzxSgyBglkwKIFrMs0rnZ04S0knl2twfjqn1dAePLa80XYf8erPu/jsB9mdL+3Zq Bdx/v2JrCtlRTW4kqoHtnyK8BR8S3h1Ue7NMsS9B+N3/auV+QUxn+k8I0r3Qluglg/7H qYDw== X-Gm-Message-State: APjAAAXj8rRGrulPAc/XKUU3SWT+z2ainNY0yyxYCXbelZv6jeRzRcFT BkMG6NrZ8U0HefI46e84mZBAWwMgDgE= X-Google-Smtp-Source: APXvYqyavxHEp1nzbSg6Ww9DlPfuLJHY0wvX/cPVxTvlVuC/U/WnhHWLdFAe0N6I+KNl8mE/kPDX71PoUHw= X-Received: by 2002:ac8:47c7:: with SMTP id d7mr9020364qtr.29.1571391811179; Fri, 18 Oct 2019 02:43:31 -0700 (PDT) Date: Fri, 18 Oct 2019 11:42:44 +0200 In-Reply-To: <20191018094304.37056-1-glider@google.com> Message-Id: <20191018094304.37056-7-glider@google.com> Mime-Version: 1.0 References: <20191018094304.37056-1-glider@google.com> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog Subject: [PATCH RFC v1 06/26] kasan: compiler.h: rename __no_kasan_or_inline into __no_memory_tool_or_inline From: glider@google.com To: Alexander Potapenko Cc: Vegard Nossum , Martin Schwidefsky , Andrey Ryabinin , Dmitry Vyukov , linux-mm@kvack.org X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: As we use it for KMSAN as well now, let's change the name to be more generic. Signed-off-by: Alexander Potapenko To: Alexander Potapenko Cc: Vegard Nossum Cc: Martin Schwidefsky Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: linux-mm@kvack.org --- Note that __no_kasan_or_inline is currently used only on S390, and KMSAN patches don't introduce uses of __no_memory_tool_or_inline, so this patch can be landed later if needed. Change-Id: I842d88b841bf1c75ab659b0016a808c6dcf7cdae --- arch/s390/include/asm/processor.h | 4 ++-- include/linux/compiler.h | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 51a0e4a2dc96..6bee92331fcd 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -214,7 +214,7 @@ static inline unsigned long current_stack_pointer(void) return sp; } -static __no_kasan_or_inline unsigned short stap(void) +static __no_memory_tool_or_inline unsigned short stap(void) { unsigned short cpu_address; @@ -253,7 +253,7 @@ static inline void __load_psw(psw_t psw) * Set PSW mask to specified value, while leaving the * PSW addr pointing to the next instruction. */ -static __no_kasan_or_inline void __load_psw_mask(unsigned long mask) +static __no_memory_tool_or_inline void __load_psw_mask(unsigned long mask) { unsigned long addr; psw_t psw; diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5e88e7e33abe..4a594bd1bc47 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -199,19 +199,21 @@ void __read_once_size(const volatile void *p, void *res, int size) __READ_ONCE_SIZE; } -#ifdef CONFIG_KASAN +#if defined(CONFIG_KASAN) /* * We can't declare function 'inline' because __no_sanitize_address confilcts * with inlining. Attempt to inline it may cause a build failure. * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 * '__maybe_unused' allows us to avoid defined-but-not-used warnings. */ -# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused +# define __no_memory_tool_or_inline __no_sanitize_address notrace __maybe_unused +#elif defined(CONFIG_KMSAN) +# define __no_memory_tool_or_inline __no_sanitize_memory notrace __maybe_unused #else -# define __no_kasan_or_inline __always_inline +# define __no_memory_tool_or_inline __always_inline #endif -static __no_kasan_or_inline +static __no_memory_tool_or_inline void __read_once_size_nocheck(const volatile void *p, void *res, int size) { __READ_ONCE_SIZE; @@ -274,7 +276,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s */ #define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) -static __no_kasan_or_inline +static __no_memory_tool_or_inline unsigned long read_word_at_a_time(const void *addr) { kasan_check_read(addr, 1);