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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 B1FECC4338F for ; Sat, 31 Jul 2021 11:31:16 +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 6FD1B60555 for ; Sat, 31 Jul 2021 11:31:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6FD1B60555 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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: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=AUQGE6hN6kIZG7xw0qnoEKfE8J1zIejljo8yZuAuk5E=; b=LFGk9dXQ4hSaUI rD96kkBj6v4d7uTwGwn9zcND5dFEVLzY6J5nMaWbKbq8dzh/FzaNSkacyE4PDHV8MeiWkUf7WeHbb aC/+u/T7W9w6tn+T+eAzx7KfjpdDD7GKSmu4R1JguI5LzloWUzMRHt333QoVooMvbCHUXiEh5faAF BM6WJiaTSrJgE3g2P1HkdcuYZ3ZfKxPSER7Gg9la5kZguCma1wRTEtiD9txoupmvERc/zFbQlOL0H HHCa7hgn6ot3+Olrqn/msfaYJnZ4hJgT6WItGMsvgk2pm89ANO2hH97ogiy3nieFfBu9Ki3lmLf/T FF267pqTsLBQ8cGJTM4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9nAz-00BXqq-Sg; Sat, 31 Jul 2021 11:29:10 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9nAw-00BXqT-3l for linux-arm-kernel@lists.infradead.org; Sat, 31 Jul 2021 11:29:07 +0000 Received: by mail-ej1-x630.google.com with SMTP id gs8so21776303ejc.13 for ; Sat, 31 Jul 2021 04:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aKRpBk4AlZF+5JgJbfcveJwA8onj4Hxh60cHYudYM3U=; b=BlLNJYYjdj1F3n1iNIlzEFOhVKHz8TvZKD2gWAm0hFzkogyCuTCoHrIRzfsUyFNFiU qbl3sxTiVrj7IQ2oHlBeMn18XoAChp1o9osIrwce6Lotva0AhwCTVUTBTQHuoQW0Z5k7 q1LhJd0d7H3D9W1CsxluaarQ4bOq/bmgldYQpyFlREg8N5DDrnlBa5sxXHKFGJZqnVDM JMEQj8TAxroT0pdIankrr04PHWbQS1X1CIMxM3c2x/MSBw2d6DvaBePSJ3QUDfER2BFc ZsDXjiAA2ME4d4NYif3AVNyK+EY5lD91ZxydaBKG2bqgXFgf8AqcYW/dzqu4tW50yeNH Gt3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aKRpBk4AlZF+5JgJbfcveJwA8onj4Hxh60cHYudYM3U=; b=ma+ifDMnOeEqsxUUPuPvxENbXRVXVJEgTxKkzUQIqllq8rCeMP9Jyxo7s0VrDm5kG4 3Z6Qpn04MTTFPHnyQS4INX5tSVbQwBUqSNaNx0isAfV/uXtMQIsN3uDvWdFR5SbD4y6y V0/+plxTRLfnLFvT6YTPEP/5bxKAEFkdLQmLZz4/0iYN6YlJhm3OEJrF6lVzWYRQ+5U8 6axwryS524zzecE7AQ5UzXYckr0wgz7Dtd+Eo3lNJoeNKxdI+lmHTaj3o5/M8ct2RJXP w6e/l6cWe4JPuLFNxbmbGwFNTg+yVPZSLfXNiuY1rqejdQa9SzKaZku5k95Cx28xl1NE mhqA== X-Gm-Message-State: AOAM533vRitwTVrGM6ILwNenVbM9qut/YZh53HeCJuZXz1d3tyuThzXF wfuI1aBdPUPK6vBNeO5aS28FwKHBbxf75B7Q+lU= X-Google-Smtp-Source: ABdhPJynGhELcNTyHuUIGwbwfjIgU1SIujA4FyibHsYf04lKIPQHG8bhm88KIPxVtjyxMqDObrIYUaH2VxpT1SrCN4k= X-Received: by 2002:a17:906:d54c:: with SMTP id cr12mr7101465ejc.227.1627730944449; Sat, 31 Jul 2021 04:29:04 -0700 (PDT) MIME-Version: 1.0 References: <20210714143843.56537-1-mark.rutland@arm.com> <20210714143843.56537-4-mark.rutland@arm.com> <20210727185418.GU13920@arm.com> <20210731104430.GA1112@arm.com> In-Reply-To: <20210731104430.GA1112@arm.com> From: Andrey Konovalov Date: Sat, 31 Jul 2021 13:28:53 +0200 Message-ID: Subject: Re: [PATCH 3/3] arm64: kasan: mte: remove redundant mte_report_once logic To: Catalin Marinas Cc: Mark Rutland , Linux ARM , Dmitry Vyukov , Alexander Potapenko , Peter Collingbourne , Andrey Ryabinin , Vincenzo Frascino , Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210731_042906_214427_FB172789 X-CRM114-Status: GOOD ( 26.21 ) 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 Sat, Jul 31, 2021 at 12:44 PM Catalin Marinas wrote: > > On Sat, Jul 31, 2021 at 01:01:25AM +0200, Andrey Konovalov wrote: > > On Tue, Jul 27, 2021 at 8:54 PM Catalin Marinas wrote: > > > 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. > > > > So we do not need "reported" anymore? Why? > > Because kasan has its own mechanism with KASAN_BIT_REPORTED. This mechanism only works when multi_shot is disabled. But milti_shot is always enabled when running the tests. Yet I tested the series, and I don't see multiple reports for each test, so everything somehow works. But I don't understand how. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel