From mboxrd@z Thu Jan 1 00:00:00 1970 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. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6995C433EF for ; Tue, 14 Dec 2021 22:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cRoU2PAc3s6mrEl9VFdBdjjZdnMXw7z7yYP8WSnf0B8=; b=IcrBGxsSpTUUJo SDsUi2rQzXC7cb3PzwTJiMnUUuP8cekaLhdTLJS6vniFW6pukDk/esMkAw/eYT7aE+Shjq3wqDuul YRFCCTgzBq6ZG/PQ4HaVw+b6MYEbCLN8+aFiyGBpspw8MlyF8N6W47aKW9dZtUqhDzXK5laUukFyO Je6WNrmp1L+cme1CzswBcEee1qDY3YS4nRCe67mqpHNrn8Qvh2vqEGnAxjm7iT76kHxYNHBYzHG+s m1hm9YAzNoB25/aXgqvwNEoUPt305nFcRkP7fzrE+o/rEdAk1cSpOHIDd6J6Tjw6wni4BMo+5MLWG hdB2KGOMQ9fNNXctNNHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxFyr-00Fu2O-Ii; Tue, 14 Dec 2021 22:09:05 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxFyn-00Fu1l-89 for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 22:09:02 +0000 Received: by mail-io1-xd2e.google.com with SMTP id c3so26841981iob.6 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=IiUIlaG7Ya1nS0Q7K+NYLeVU0kGHhDO0ovTh+K7Z91OOeBa8w01ubeut8AYfIWVHzB DqyxO1hgKAgq6igflsbAr5b85CzB5ms2bV9mFrWRLUybrHNIpEZzpFIZKGR6RM9EqAeH YxjgwPBNyW7BKGtRrjkFH8QC1mHWaHivdAfCtKpnMDoWVAt79l347av7V8mZLmXkp2wn ERnvPYPsrXyz3OiNLEpbH7ZlqTOlPU3MTsCF+A8Z9bIh6DLf3mXSVUdTt8HcqUay8Xt9 76Qa5xdNwdmHK+0YjBiXK5BCQbSKkfabsyfzYITwpNAju7ZrpU750sENGgR4AxXH1k2y mNNw== X-Gm-Message-State: AOAM530dpYlpaJYRMeUUihleQTOG4TtmfI+Uj9L/xQg3QB1KauklZltv 29Bkp3ysyYYoByL9Th1nO4vNSbfo9NyXIkFco+I= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_140901_328740_19A745BA X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel