Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE6B8C433F5 for ; Tue, 14 Dec 2021 22:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232536AbhLNWJB (ORCPT ); Tue, 14 Dec 2021 17:09:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbhLNWJA (ORCPT ); Tue, 14 Dec 2021 17:09:00 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40804C061574 for ; Tue, 14 Dec 2021 14:09:00 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id y16so26824988ioc.8 for ; Tue, 14 Dec 2021 14:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tP6csCLv+Ba35Rqxl/QI5p1YOyxnicuG22GVHFYUF1U=; b=Cc38oMKWk2brJxZDGoC8suov16Oq0YtG58O6cq6oiQTqRNg/SL4mIz90EmLVAnObiB T7MdVO+WibnifiPKGbqd2HGhMmcWOMEn2wfqt1mhmUPmVvzMluNpItXKYi7r4obpZ14+ vEFYVpcIlu/68azAW/1nmUbUNTCpl7nYCIhSlSC4KANXjv8kfbJKMVYOKmujbfqthcLf W4/BnybqvyIUBWy+8dQwZfyl/Sc2sVvnLpTESUfTCtXCnh6Hl6KPPW8y2+aFdxUu66nf odPDm2tHTZN8EIG9pVT3cmkNAjRykGS+FWUaUZ2ew7iGjYi7CuY5sHtqr1yl4RqnBTd8 mLbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tP6csCLv+Ba35Rqxl/QI5p1YOyxnicuG22GVHFYUF1U=; b=H31WvnDwEvaCeGJR8sovt/wc50IFtupgP5WzSdHfER0veTHCthP0J2//0UaNW2oTKS LvuJVeFqHd/Kd4WpmYrsNk9ozfGmBZj2DcwmJQpC2KhwzpeEL2NhMDlBrxAda5Txq2B6 lmXy5wrduBgywUzFq+swZsKra60HBt1dBxEmCVV7Zz97VR3xxWbmzo9MHTpYunaI4Mu1 l84B3fQdxnP3skOPGoqycYMUdBa4WavFJVa/YbFT4+mKvc5YgXoq54gwUAejgk/o7nKk 8NcN/K0hfMmncIr+/5a0TvD8e0cTc+SnBdrPkHxua48/hX3BKWwZ0pVebd8OAaOvfHT6 Sm7A== X-Gm-Message-State: AOAM533wfDptVtyypFjReLCvdfu78HVriCRbD9aJSiIQGTS0EYo4Ng2b prEgtHNVZWlze0AgEBGgzVxMPTPCDBzmdgf1L3Q= X-Google-Smtp-Source: ABdhPJwZpEx7lKlhd9sQu94o+KABcOC4exIObwhJKgQluloyoysImPofu+FfrETOdJsyEK7m/4nW5u+WBFq9eHEUhNw= X-Received: by 2002:a5e:d502:: with SMTP id e2mr5381245iom.118.1639519739580; Tue, 14 Dec 2021 14:08:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Tue, 14 Dec 2021 23:08:49 +0100 Message-ID: Subject: Re: [PATCH mm v3 29/38] kasan, vmalloc: add vmalloc tagging for HW_TAGS To: Marco Elver Cc: andrey.konovalov@linux.dev, Alexander Potapenko , Andrew Morton , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Linux Memory Management List , Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , Linux ARM , Peter Collingbourne , Evgenii Stepanov , LKML , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 14, 2021 at 8:56 PM Marco Elver wrote: > > On Mon, Dec 13, 2021 at 10:54PM +0100, andrey.konovalov@linux.dev wrote: > [...] > > > > + /* > > + * Skip page_alloc poisoning and zeroing for pages backing VM_ALLOC > > + * mappings. Only effective in HW_TAGS mode. > > + */ > > + gfp &= __GFP_SKIP_KASAN_UNPOISON & __GFP_SKIP_ZERO; > > This will turn gfp == 0 always. Should it have been > > gfp |= __GFP_SKIP_KASAN_UNPOISON | __GFP_SKIP_ZERO Oh, this is bad. Thanks for noticing! Will fix in v4. > Also, not sure it matters, but on non-KASAN builds, this will now always > generate an extra instruction. You could conditionally define GFP_SKIP* > only in the KASAN modes that need them, otherwise they become 0, so the > compiler optimizes this out. (Although I think it does does complicate > GFP_SHIFT a little?) I can implement this, but I don't think a single extra instruction per vmalloc() matters.