Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1959911rwb; Mon, 7 Nov 2022 07:38:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM5DOaHzlV7KVCY/spbSbpkLZA8V4sXJqEwY2A43FIl+ICZ8Bv0M55TSRtfhkFtSjME4ali8 X-Received: by 2002:a17:902:ec8e:b0:186:de89:7f66 with SMTP id x14-20020a170902ec8e00b00186de897f66mr51252287plg.160.1667835533017; Mon, 07 Nov 2022 07:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667835533; cv=none; d=google.com; s=arc-20160816; b=t1idTR5G8zzILV1esYgP0uG64ST37+c+F8EnKtLC2W2Z0WoKk6gOaiSy97SJK9nekJ CMTLZRu65BRT4HTNT9Z5CjDdEpXmoOenCqit4ac/kFW83dsRPnLb632vFv8jKH0RDSut eFaEYSruhihQtPLkVY3CjQGBb4ZQp17S0IEikZ2YUHhvQYKKOvj0/ZKhS0nN/v5s4HgH RoNANYTXdP+fh8Unht2PBY+cCrLB769OL1lzVk3G1ZpWCIcX/RR5p1Xs7s3sGwJiLUoB CukpZG2cK/6Yp1XQPg/i+POMdenVDtinIbW8IjSi6Skdvru97XnKkhBT/6wlxSC3lTxW L3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WP3EPJUkC3MsbCQ2RdpSiK0YpXdLb38+hU9Aqxzuoy0=; b=KG7HtDLulZ1Gnz4sd8LZxYRFjzhfPP2ZYEMRUZOmarCjlJzEGNmdBouqcUVjOHIDk3 Wwln9QXeUMjul6Rk5rFWvQkpI7n/MSOdgfZc4qSBr7WhC1BHnNchLWZbPlU5/JVtQS/z VbKaLSTARNEA1ZUNKERJTHxlVgV8Y7OZc0fzAVjbgD3aylzkQ0jhXQVWxOnb0DHlkz53 j9g75odxSONJyQQg2dxJKYtGySCh35XJ84sW/V0CXt4xHlXDRURV6X9t3oP492Jz6C+Y IzN7nh1fVXxqeTT2mIc6pjpe2HKL+FcFDfrgimA6Q7fRHNHrwrlARlszcSgIPmAOs0Q6 ClOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l2EcSwCD; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 33-20020a630a21000000b0046a1c6484f9si11542488pgk.218.2022.11.07.07.38.37; Mon, 07 Nov 2022 07:38:53 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=l2EcSwCD; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbiKGPTm (ORCPT + 92 others); Mon, 7 Nov 2022 10:19:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232234AbiKGPTj (ORCPT ); Mon, 7 Nov 2022 10:19:39 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE690289 for ; Mon, 7 Nov 2022 07:19:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77CC4B812A1 for ; Mon, 7 Nov 2022 15:19:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17879C433C1; Mon, 7 Nov 2022 15:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667834375; bh=NwsEDPislMlr5qAw4s2tyK4jOd4n3+iAr26wewpmChY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l2EcSwCDsuVTAF21jzZyyvSAOkaFo2MMZ5TLHFijd9fl6LuknY+iOwde6fi+KQ6pp 30S9w2uKaRIw+IKbP73hlj1GN1G4O/zc5iUjRXD+uIGf63P3FrKXRxEoN/4S1Iudx0 vE2xqStmHLj+C8661XlmeVcseCY/Ia7eCnDzH4i5rTylOLz4TJQb7Qaq6Jh7nu5V6u 6ZITmd3fjMR71u/h9G47VPO/w/4taBfbgFLQyIuO55G+NqJ/N0FpBPk//BtesCl/IR pI4EtvQ8qdjVHjts74YenVuI7SdFFO34UYRH8qZodZdP7b8SMHzK02Z4Zm+FUjoyja +QhX/QOq3YxBg== Date: Mon, 7 Nov 2022 15:19:30 +0000 From: Will Deacon To: Vincenzo Frascino Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Catalin Marinas Subject: Re: [PATCH v2] mte: Initialize tag storage to KASAN_TAG_INVALID Message-ID: <20221107151929.GB21002@willie-the-truck> References: <20220907110015.11489-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220907110015.11489-1-vincenzo.frascino@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Wed, Sep 07, 2022 at 12:00:15PM +0100, Vincenzo Frascino wrote: > When the kernel is entered on aarch64, the MTE allocation tags are in an > UNKNOWN state. > > With MTE enabled, the tags are initialized: > - When a page is allocated and the user maps it with PROT_MTE. > - On allocation, with in-kernel MTE enabled (HW_TAGS KASAN). > > If the tag pool is zeroed by the hardware at reset, it makes it > difficult to track potential places where the initialization of the > tags was missed. > > This can be observed under QEMU for aarch64, which initializes the MTE > allocation tags to zero. > > Initialize to tag storage to KASAN_TAG_INVALID to catch potential > places where the initialization of the tags was missed. > > This is done introducing a new kernel command line parameter > "mte.tags_init" that enables the debug option. > > Note: The proposed solution should be considered a debug option because > it might have performance impact on large machines at boot. > > Cc: Catalin Marinas > Cc: Will Deacon > Signed-off-by: Vincenzo Frascino > --- > arch/arm64/kernel/mte.c | 47 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) I don't really see the point in this change -- who is going to use this option? Will