From patchwork Wed Mar 25 16:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11458225 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 9684F14B4 for ; Wed, 25 Mar 2020 16:13:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 63F4A2073E for ; Wed, 25 Mar 2020 16:13:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="o7f2X9yD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63F4A2073E 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 0C7226B000E; Wed, 25 Mar 2020 12:13:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 09FB26B0010; Wed, 25 Mar 2020 12:13:06 -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 DE5346B0032; Wed, 25 Mar 2020 12:13:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id C6FDB6B000E for ; Wed, 25 Mar 2020 12:13:06 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A9FCB8248047 for ; Wed, 25 Mar 2020 16:13:06 +0000 (UTC) X-FDA: 76634378772.17.toes71_7269e85a52103 X-Spam-Summary: 2,0,0,cbf05d284cec9572,d41d8cd98f00b204,3ein7xgykcp0lqnijwlttlqj.htrqnsz2-rrp0fhp.twl@flex--glider.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1535:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3152:3352:3865:3867:3868:3871:3874:4250:4321:5007:6119:6261:6653:6742:6743:7903:7904:9969:10004:10400:11026:11232:11473:11658:11914:12043:12048:12297:12438:12555:12895:12986:13069:13311:13357:13846:14096:14097:14181:14394:14659:14721:21080:21365:21433:21444:21451:21627:30054:30064:30090,0,RBL:209.85.128.73:@flex--glider.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: toes71_7269e85a52103 X-Filterd-Recvd-Size: 5451 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 16:13:06 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id s14so856984wmj.9 for ; Wed, 25 Mar 2020 09:13:05 -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=ZGx4h0yBkrIi10hsQKcxrq9vFYEkrr7T4fQBSTHjMAo=; b=o7f2X9yDeq9L2bywfCdnpR8Z8mbS7aNaBrp9f7SYNVnxzRbqjUF+ssfpRDa+xbxVG+ 2+d0fDMgYrxoEUvDcLpoWnZp+U1Ya5d4HDtxhyL19C3TK17B5UAtLMKNTYk2DPVe0jWg yJRtub9CL4Z6m/3Jw4/+SgrOKdRF9sLCbeJYHSx4/0umjt6ikYN9ZIYqUZvMbKZLdD4/ yVeroNoRI4//H58YO82DijaGOlxyEiwbqy/ac+j5NIJyyCsMGpR//48rGPhyg/b6gEqW kGT5atKwuUZp842DQcj9aQxf1BzoaMuuaXfL1nOyLSkbvPgbOGennEEBQDY7CUveFe+l 97pw== 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=ZGx4h0yBkrIi10hsQKcxrq9vFYEkrr7T4fQBSTHjMAo=; b=CqXNF1+U+ZpaDxwjVWY5Es8NXsKxkV+chfPJ/D24sc1jld0kEsysmoF7uWYWkdZTR2 Yh6JpOJH/GWAGJbT41x/THjwKZhhaBBR5aPojAi4cV6ka/Sujfpx6xxTpP/fRLy0wspz vpA5wcx/kVpqLgWqbZJpQiwePng3mgKHHQySB0vIz9xbDcYwIxjTu5W/GSqhPzM09Kfi FnUz2bZmLoYzM1aj3CX2A346y+bQghBYvkFLkcyFzpojx3ladisC7l0QPM6RCUVC7jiR uhRBZDqP9IOCUF+k9MHHk2mvUSRlVlm3urs5o+HQFBtf/I5tf9RXcbIkT0r8KPZtjmm5 i5mA== X-Gm-Message-State: ANhLgQ38wMvJiK6YTMpRzzcbV9Wv+SgcruQAq0zarVnfnq9jx5t6/PeN QAxZCdRezGxdzyUC7+oo8tL0cTfKvCY= X-Google-Smtp-Source: ADFU+vtz6+NLVJfHd0LcLbwDclIwupPM+ASnjvAs/lO4mC4CwZBNbL3jxqRRYEyRHvOj0vtn94JaJjs7x6Y= X-Received: by 2002:a5d:510d:: with SMTP id s13mr4187627wrt.110.1585152784717; Wed, 25 Mar 2020 09:13:04 -0700 (PDT) Date: Wed, 25 Mar 2020 17:12:14 +0100 In-Reply-To: <20200325161249.55095-1-glider@google.com> Message-Id: <20200325161249.55095-4-glider@google.com> Mime-Version: 1.0 References: <20200325161249.55095-1-glider@google.com> X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog Subject: [PATCH v5 03/38] kmsan: gfp: introduce __GFP_NO_KMSAN_SHADOW From: glider@google.com To: Vegard Nossum , Andrew Morton , Michal Hocko , Dmitry Vyukov , Marco Elver , Andrey Konovalov , linux-mm@kvack.org Cc: glider@google.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, aryabinin@virtuozzo.com, luto@kernel.org, ard.biesheuvel@linaro.org, arnd@arndb.de, hch@infradead.org, hch@lst.de, darrick.wong@oracle.com, davem@davemloft.net, dmitry.torokhov@gmail.com, ebiggers@google.com, edumazet@google.com, ericvh@gmail.com, gregkh@linuxfoundation.org, harry.wentland@amd.com, herbert@gondor.apana.org.au, iii@linux.ibm.com, mingo@elte.hu, jasowang@redhat.com, axboe@kernel.dk, m.szyprowski@samsung.com, mark.rutland@arm.com, martin.petersen@oracle.com, schwidefsky@de.ibm.com, willy@infradead.org, mst@redhat.com, monstr@monstr.eu, pmladek@suse.com, cai@lca.pw, rdunlap@infradead.org, robin.murphy@arm.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, tiwai@suse.com, tytso@mit.edu, tglx@linutronix.de, gor@linux.ibm.com, wsa@the-dreams.de 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: This flag is to be used by KMSAN runtime to mark that newly created memory pages don't need KMSAN metadata backing them. Signed-off-by: Alexander Potapenko To: Alexander Potapenko Cc: Vegard Nossum Cc: Andrew Morton Cc: Michal Hocko Cc: Dmitry Vyukov Cc: Marco Elver Cc: Andrey Konovalov Cc: linux-mm@kvack.org --- We can't decide what to do here: - do we need to conditionally define ___GFP_NO_KMSAN_SHADOW depending on CONFIG_KMSAN like LOCKDEP does? - if KMSAN is defined, and LOCKDEP is not, do we want to "compactify" the GFP bits? Change-Id: If5d0352fd5711ad103328e2c185eb885e826423a --- include/linux/gfp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index be2754841369e..e1ab42b5e9ce2 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -44,6 +44,7 @@ struct vm_area_struct; #else #define ___GFP_NOLOCKDEP 0 #endif +#define ___GFP_NO_KMSAN_SHADOW 0x1000000u /* If the above are modified, __GFP_BITS_SHIFT may need updating */ /* @@ -212,12 +213,13 @@ struct vm_area_struct; #define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) #define __GFP_COMP ((__force gfp_t)___GFP_COMP) #define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) +#define __GFP_NO_KMSAN_SHADOW ((__force gfp_t)___GFP_NO_KMSAN_SHADOW) /* Disable lockdep for GFP context tracking */ #define __GFP_NOLOCKDEP ((__force gfp_t)___GFP_NOLOCKDEP) /* Room for N __GFP_FOO bits */ -#define __GFP_BITS_SHIFT (23 + IS_ENABLED(CONFIG_LOCKDEP)) +#define __GFP_BITS_SHIFT (25) #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) /**