Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp217866pxb; Wed, 23 Mar 2022 16:43:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwObbfSpS87o3w4rvoS5SygxenvWZQg8PkaiksHEQ8g9BzPq/uxmWJv9jGFNRW6CUTK7aj6 X-Received: by 2002:a17:90a:f2cd:b0:1c6:5a37:69ab with SMTP id gt13-20020a17090af2cd00b001c65a3769abmr2650015pjb.224.1648078985120; Wed, 23 Mar 2022 16:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648078985; cv=none; d=google.com; s=arc-20160816; b=JGp+I98blIcscJXClE//jwINDvDzK0xaopIGaUS58gn8lQhcj9QcRy9n85kPk0u2uD N0Sk1brlCRK25P8gLgOLcieKzGAxqAb9deHzqyfca168hsUSB41HaOOWUyui8dga1HNz QgNmwzECXCb2obqBpEHlZrP9+tHdIyagaOxefbr91EeFEkvKyDBhV0GKtNgAp0/6MZys Wz/+sPl9G0KHfEA+XwaE0u9PkdFVNtjXZftMxGQCuIQz5e5gfX7q6/RCGcqlNPTvk2+p sGRHApyeZerk522ixCqZnLw8NjetuW/V1amkwyQEeI+KyYYfelHB+zu5/Oj5TiCR2Z9z 2W4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=fbCwVVRphwKFhHFjdgqzv4b5jAPDrPw5EXg1eflzqcM=; b=z+DuvZCgiFnCqOXCAtrZT6+vWh3Q0yIdimyyOX+YCf1NOPsoUSkeSweGMjLr2Ft1Hn z+N/bIbWgQKWyRFDvtt2zXYXo+zdiKPicb2I0y2vexygZ739g4zPNMnxbHsm5KkNTMdN KUFEhfSsQ1Glvb/2PdGUSuqkCGTvlKVhAaj7usiw3ktbG01ywJnB285tjeuadt6E1EEv YfhjRh/QIr3MeJ1utlhRuEm9gxZr7xkqKkbqLE/9505Sbsgwqe72oQGikSSYchubWWxj qvlQo7y82DYm6zq7v3jkZizLpbLEyhv6VCxi0VSmwHBcVDVUJ3f1nOhR95rKoVAE9cGa gsXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lTyix5ma; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902f60200b00154abdc081csi3159625plg.192.2022.03.23.16.42.51; Wed, 23 Mar 2022 16:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lTyix5ma; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236463AbiCWNEG (ORCPT + 99 others); Wed, 23 Mar 2022 09:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236412AbiCWNEF (ORCPT ); Wed, 23 Mar 2022 09:04:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B01F7CDC4 for ; Wed, 23 Mar 2022 06:02:36 -0700 (PDT) Date: Wed, 23 Mar 2022 14:02:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1648040554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fbCwVVRphwKFhHFjdgqzv4b5jAPDrPw5EXg1eflzqcM=; b=lTyix5maivfLw8E8Po9Y8v0iZkkEthoVdWxUAkacnuW0EcVIUXUU/gXp86tc8gzJW1L/9d IE1sZhoeNDz/df5gmlbGLLgOMTkZ7b0Yhuv+nx3cNEniAygTwrvIyC5v8oJZ+oBJdZeEGh eJ+CIs/Un9nFcO9gJcTYcTsVa2IBBjBC9hb8oc1PTPzF333H+1LoX0mqXANdTWMhr2sCG9 WtR1y5ljZeyMxVkZEXbLcOHnuqZtIqFtcbSVpB/Jwdl5jjlEHi60d+fg4LteatHl3lNSrA wnMrsAbczhw5//ay4CFJisdm3qQh3CXF9MZ0xzyihH1ZU+FEqdBJcVYSf7p+vg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1648040554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fbCwVVRphwKFhHFjdgqzv4b5jAPDrPw5EXg1eflzqcM=; b=VOsTdu5ZLZW0Wq76l4BUB69GXQpUMxEHlRDyF0Lcl3AtX6x/7peY+Wd+sltN7+9itzrpzd Dlkn6n4Th6PRY5Dw== From: Sebastian Andrzej Siewior To: Vlastimil Babka Cc: andrey.konovalov@linux.dev, Andrew Morton , Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH v6 27/39] kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS Message-ID: References: <44e5738a584c11801b2b8f1231898918efc8634a.1643047180.git.andreyknvl@google.com> <63704e10-18cf-9a82-cffb-052c6046ba7d@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <63704e10-18cf-9a82-cffb-052c6046ba7d@suse.cz> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-03-23 12:48:29 [+0100], Vlastimil Babka wrote: > > +#ifdef CONFIG_KASAN_HW_TAGS > > #define ___GFP_SKIP_KASAN_POISON 0x1000000u > > +#else > > +#define ___GFP_SKIP_KASAN_POISON 0 > > +#endif > > #ifdef CONFIG_LOCKDEP > > #define ___GFP_NOLOCKDEP 0x2000000u > > #else > > @@ -251,7 +255,9 @@ struct vm_area_struct; > > #define __GFP_NOLOCKDEP ((__force gfp_t)___GFP_NOLOCKDEP) > > > > /* Room for N __GFP_FOO bits */ > > -#define __GFP_BITS_SHIFT (25 + IS_ENABLED(CONFIG_LOCKDEP)) > > +#define __GFP_BITS_SHIFT (24 + \ > > + IS_ENABLED(CONFIG_KASAN_HW_TAGS) + \ > > + IS_ENABLED(CONFIG_LOCKDEP)) > > This breaks __GFP_NOLOCKDEP, see: > https://lore.kernel.org/all/YjoJ4CzB3yfWSV1F@linutronix.de/ This could work because ___GFP_NOLOCKDEP is still 0x2000000u. In ("kasan, page_alloc: allow skipping memory init for HW_TAGS") https://lore.kernel.org/all/0d53efeff345de7d708e0baa0d8829167772521e.1643047180.git.andreyknvl@google.com/ This is replaced with 0x8000000u which breaks lockdep. Sebastian