From patchwork Fri Nov 22 11:25:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11257871 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 F39FB14DB for ; Fri, 22 Nov 2019 11:26:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0F3C20674 for ; Fri, 22 Nov 2019 11:26:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qRP3MQz5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0F3C20674 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 692696B04CC; Fri, 22 Nov 2019 06:26:47 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5F2A56B04CD; Fri, 22 Nov 2019 06:26:47 -0500 (EST) 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 4E1D96B04CE; Fri, 22 Nov 2019 06:26:47 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 371D66B04CC for ; Fri, 22 Nov 2019 06:26:47 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id BAD85181AEF31 for ; Fri, 22 Nov 2019 11:26:46 +0000 (UTC) X-FDA: 76183686012.22.bit23_eb2201a5d22 X-Spam-Summary: 2,0,0,4e715ecafa3115b5,d41d8cd98f00b204,39mxxxqykcnm5a723g5dd5a3.1dba7cjm-bb9kz19.dg5@flex--glider.bounces.google.com,:vegard.nossum@oracle.com:akpm@linux-foundation.org:dvyukov@google.com::glider@google.com:viro@zeniv.linux.org.uk:adilger.kernel@dilger.ca:andreyknvl@google.com: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:elver@google.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@li X-HE-Tag: bit23_eb2201a5d22 X-Filterd-Recvd-Size: 5275 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Nov 2019 11:26:46 +0000 (UTC) Received: by mail-wm1-f74.google.com with SMTP id p19so2038077wma.8 for ; Fri, 22 Nov 2019 03:26:46 -0800 (PST) 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=Bm8EU8dMInFr+H8RGzk2ADf7FzgkFWR7rlaMHy6Wmzc=; b=qRP3MQz5EZ66x4rDBTwIkcLp77Sj/oX9/GIBegHHru+vLUW9NYzVgN4bi2q/hSu+Rq /Njvwjs/Ohe7EJkAy9qtOWw0vnC2ePZ+FunK8i4oGYFYI6aYU9pOm1pym9Spd3zZA1cE aTOSTUmrxeseoKOrqQ6e8v/qx7dazi/uAyg0pLCWPZIjsMQR/1LFHmeozfCKjlqQOwTK HJeAIFyQhOsdynSd1sksKPaeWfr5/VzcU+i18ZOM/zzfernKMAorOu/WD6MR/rDYz4TA 2crMvbhWnp0lxcU2tz8TgixR8B69ElbmRiQF8Y6b5NF+PkkJotGRTr8r9yFbmXM9eeHg tL0g== 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=Bm8EU8dMInFr+H8RGzk2ADf7FzgkFWR7rlaMHy6Wmzc=; b=gSnYJfc2a2su2YiSwF0bL9z59aaYR6d8WSH5dbfv/mGoBdAxH3nyaBqqJtk3qbwXbm 1suB5VbCrDRnEFGU6z6EipSbTh2tIvW2maFIEQvZP9C9oXWxe+U1/oJxuVqi7nLC5LVZ VnJUToBMpH7/SBj8jd3Ab40mSikAH95qjBSFv4WCITaW+3goIhE7Vh41VVRZFy9PdDF5 FftY+fYp07B+Sz5oRUn58s2OTApJoz2f38SXeckzyAxaiV+AzYcnW+Df0KNybfpr4+a5 6SzHtmIKK1D2HOOfAH2GCNn1rT7XAGpYMeHUwCEiThvOT+V4U2iaQqxdWs8q1xXmA5ga PMGg== X-Gm-Message-State: APjAAAUo3qIIAKP8qCH/GBcLpAapXBpDVLStnwDz/8/vQm1SiXu6ru20 J17Q6X3CiuONwT3FyOUitUz/ruJs+yQ= X-Google-Smtp-Source: APXvYqwRpXQVDvZ6FkyX5BTZXTCYlVHOsIrM90I+Rhd4YdR5xgvDoBaLE7wGoEGJdN6vWPdyOEXNPgPFao4= X-Received: by 2002:adf:e50e:: with SMTP id j14mr15859782wrm.179.1574422004898; Fri, 22 Nov 2019 03:26:44 -0800 (PST) Date: Fri, 22 Nov 2019 12:25:51 +0100 In-Reply-To: <20191122112621.204798-1-glider@google.com> Message-Id: <20191122112621.204798-7-glider@google.com> Mime-Version: 1.0 References: <20191122112621.204798-1-glider@google.com> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog Subject: [PATCH RFC v3 06/36] kmsan: gfp: introduce __GFP_NO_KMSAN_SHADOW From: glider@google.com To: Vegard Nossum , Andrew Morton , Dmitry Vyukov , linux-mm@kvack.org Cc: glider@google.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, andreyknvl@google.com, 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, elver@google.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: 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)) /**