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 X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9535CC4338F for ; Tue, 27 Jul 2021 18:56:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 581B260F6E for ; Tue, 27 Jul 2021 18:56:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 581B260F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YkPSJKmeMYiMXdFU+v9H8LwzVFzgf3gWe4Gn3ZntNfI=; b=1hXiDERnE4QHgg 6EMOKckY5fw4k1uiFu0dJld4GhhrcTQnvSyZi8Mk2Tk5QAiYuTsEvQfsmTYKT/bPEeeBuFzx9yA1y bRuVYC/UM86pcMDCBN4025D9vHKAhMx1TOl0OUCz4ckje7OlSTbksfozBTIs2rnbzh23YQ0m04r9M RxQJKfYn1GXcezklDecyMyqTZoXaIPFz1J/nM3pKMorgmpPN0JR1KA8eRvNzzXhxr01Hq7p3Qio9T 03vOcZZb83Sj0ZNQyMmyl2uSiilHivJK3ThYcD506POmQsBosizXflIwK8LGbIJXFsgjjqGWExdiL 1VIQHcE4dmNpahCRfxbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8SDt-00G2nI-Ew; Tue, 27 Jul 2021 18:54:38 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8SDe-00G2lR-Ub for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 18:54:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0CF7160FC0; Tue, 27 Jul 2021 18:54:20 +0000 (UTC) Date: Tue, 27 Jul 2021 19:54:18 +0100 From: Catalin Marinas To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, andreyknvl@gmail.com, dvyukov@google.com, glider@google.com, pcc@google.com, ryabinin.a.a@gmail.com, vincenzo.frascino@arm.com, will@kernel.org Subject: Re: [PATCH 3/3] arm64: kasan: mte: remove redundant mte_report_once logic Message-ID: <20210727185418.GU13920@arm.com> References: <20210714143843.56537-1-mark.rutland@arm.com> <20210714143843.56537-4-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210714143843.56537-4-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_115423_074964_A69147AC X-CRM114-Status: GOOD ( 17.64 ) 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 Wed, Jul 14, 2021 at 03:38:43PM +0100, Mark Rutland wrote: > We have special logic to suppress MTE tag check fault reporting, based > on a global `mte_report_once` and `reported` variables. These can be > used to suppress calling kasan_report() when taking a tag check fault, > but do not prevent taking the fault in the first place, nor does they > affect the way we disable tag checks upon taking a fault. > > The core KASAN code already defaults to reporting a single fault, and > has a `multi_shot` control to permit reporting multiple faults. The only > place we transiently alter `mte_report_once` is in lib/test_kasan.c, > where we also the `multi_shot` state as the same time. Thus > `mte_report_once` and `reported` are redundant, and can be removed. > > When a tag check fault is taken, tag checking will be disabled by > `do_tag_recovery` and must be explicitly re-enabled if desired. The test > code does this by calling kasan_enable_tagging_sync(). > > This patch removes the redundant mte_report_once() logic and associated > variables. The first "reported" variable was added to avoid calling kasan_report on each CPU as we are lazily disabling tag checking when faults are triggered. The subsequent mte_report_once() was added to avoid setting "reported" during the kasan tests and missing the real faults later on. I wasn't aware that kasan already has its own logic to prevent multiple reports. The kasan tests enable multi-shot first, so KASAN_BIT_REPORTED wouldn't be set by report_enabled(). I think this patch makes sense. Reviewed-by: Catalin Marinas (and I can queue them through the arm64 tree if I get the acks from the kasan maintainers) -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel