From patchwork Wed Oct 30 14:22:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11219617 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 135981668 for ; Wed, 30 Oct 2019 14:23:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA49120656 for ; Wed, 30 Oct 2019 14:23:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UQrJdKCX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA49120656 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 172A56B0010; Wed, 30 Oct 2019 10:23:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0FBA26B0266; Wed, 30 Oct 2019 10:23:04 -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 EDE626B0269; Wed, 30 Oct 2019 10:23:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id C95946B0010 for ; Wed, 30 Oct 2019 10:23:03 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 70D9D8249980 for ; Wed, 30 Oct 2019 14:23:03 +0000 (UTC) X-FDA: 76100667846.12.alley70_37bce58ae9e48 X-Spam-Summary: 2,0,0,655843d74928547f,d41d8cd98f00b204,3xzy5xqykcngafc78laiiaf8.6igfchor-ggep46e.ila@flex--glider.bounces.google.com,:vegard.nossum@oracle.com:akpm@linux-foundation.org:dvyukov@google.com::viro@zeniv.linux.org.uk:aryabinin@virtuozzo.com:luto@kernel.org:ard.biesheuvel@linaro.org:arnd@arndb.de:hch@lst.de:dmitry.torokhov@gmail.com:edumazet@google.com:ericvh@gmail.com:gregkh@linuxfoundation.org:harry.wentland@amd.com:herbert@gondor.apana.org.au:mingo@elte.hu:axboe@kernel.dk:martin.petersen@oracle.com:schwidefsky@de.ibm.com:mst@redhat.com:monstr@monstr.eu:pmladek@suse.com:sergey.senozhatsky@gmail.com:rostedt@goodmis.org:tiwai@suse.com:tytso@mit.edu:tglx@linutronix.de:wsa@the-dreams.de:gor@linux.ibm.com:iii@linux.ibm.com:mark.rutland@arm.com:willy@infradead.org:rdunlap@infradead.org:andreyknvl@google.com:elver@google.com:glider@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:17 X-HE-Tag: alley70_37bce58ae9e48 X-Filterd-Recvd-Size: 5103 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Oct 2019 14:23:02 +0000 (UTC) Received: by mail-wr1-f74.google.com with SMTP id j17so1207524wru.13 for ; Wed, 30 Oct 2019 07:23:02 -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=zjqLA8icycEaF+lV+J+rI33Voloa3PXA51lTTa+kIJM=; b=UQrJdKCXvrvp6fRE1XmTTIky6U0f1mhLPtOAw+zJcnr66aTyQjWPDjJleHmzEjkDAC 9BUQsG4GuXHiJ2W/PG99IP/kxV1PeIwRLyF5ORySqF46pGFITVrmINlZ8o2C/Po9uEEr 3fGxi3sn1ftUW6lo9kBurbZ/NAO+eI8eQRLZB6hth6FrmCzDlauPkluZbycW/ZS7IlGN hJ369CWZu22JA0A7BsKwXmlIOksVwtjjJzqQy/LZkcApsS0enPpKOHTo9XayVZmqdQaH OB9PyRz9ATcg0RlrdXbit4+uNli8mur89u7bcYq4Hy0hGv688Hmd+IE58CaTohBGbLxq 00Ag== 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=zjqLA8icycEaF+lV+J+rI33Voloa3PXA51lTTa+kIJM=; b=DcrawsS0ramuRjSYNy1Gq79rC9QRG4clIT54mAul+f8FH8Qy1z7iPvU6Wcng3ByyZK vv4gPgDSYk3h12V4nQJs1AEWSTxYSrGmEDpEfs4+5BeQU9tEMH6PRvKRhhcbaE2EL30A rzz2+PCxuDX8fi9bzBQWh6qzFTdiDmqkWtGsxAdQBPfmydQcExw2hXfSHeDxcLk58ume dc0eYoasaoCGOCQiv9X6NLJwKyg+23YHY5jVCEgjht3UYivHtllzsV1tnM8K3D8IvP4Z KVpBhbuqSBvPM+V5GWe1tXaxDW+M0gm4f6uqeG1eAowu1hFAJarV+bafoFBeKoSpGE/Y TU2g== X-Gm-Message-State: APjAAAVDlQeUXiKbCAiokR1kERvGZe3a/qooB9pVZVtpT+83NSNUbFGj d2TvkMBHSWpTDdWpucKm7YK721jgzt0= X-Google-Smtp-Source: APXvYqy2jBLEa5gUxeoY8U+T1rJGeAelsDsZfYh7vgXH4qK2uiM6fP1EncUZd9wtfzDsH0zoBWEYupxUPWg= X-Received: by 2002:a5d:6104:: with SMTP id v4mr140850wrt.36.1572445381411; Wed, 30 Oct 2019 07:23:01 -0700 (PDT) Date: Wed, 30 Oct 2019 15:22:18 +0100 In-Reply-To: <20191030142237.249532-1-glider@google.com> Message-Id: <20191030142237.249532-7-glider@google.com> Mime-Version: 1.0 References: <20191030142237.249532-1-glider@google.com> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog Subject: [PATCH RFC v2 06/25] kmsan: gfp: introduce __GFP_NO_KMSAN_SHADOW From: glider@google.com To: Vegard Nossum , Andrew Morton , Dmitry Vyukov , linux-mm@kvack.org Cc: viro@zeniv.linux.org.uk, aryabinin@virtuozzo.com, luto@kernel.org, ard.biesheuvel@linaro.org, arnd@arndb.de, hch@lst.de, dmitry.torokhov@gmail.com, edumazet@google.com, ericvh@gmail.com, gregkh@linuxfoundation.org, harry.wentland@amd.com, herbert@gondor.apana.org.au, mingo@elte.hu, axboe@kernel.dk, martin.petersen@oracle.com, schwidefsky@de.ibm.com, mst@redhat.com, monstr@monstr.eu, pmladek@suse.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, tiwai@suse.com, tytso@mit.edu, tglx@linutronix.de, wsa@the-dreams.de, gor@linux.ibm.com, iii@linux.ibm.com, mark.rutland@arm.com, willy@infradead.org, rdunlap@infradead.org, andreyknvl@google.com, elver@google.com, Alexander Potapenko 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: Dmitry Vyukov 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 fb07b503dc45..b4e7963cd94b 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)) /**