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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 EC5EBC433EF for ; Tue, 7 Sep 2021 23:23:02 +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 B857760724 for ; Tue, 7 Sep 2021 23:23:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B857760724 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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=8nzMOVxF6NnIohwtypmOpI8ers5sw0LAtwN11I/XRSo=; b=0ARiN4rwq4akWH 6oJyY+88+pKlMgPTsa1+BgtOhdT9EXaBRlw1wQqgAc2gb6g3NW0E7mPqWhrBVPcDxYs1EjxXaJxDG F3YTvckmbTNlBNIlqv8D9UgkeK+zE4RyKF9Iv+Vf0yDsFdwomYarLklwSVML7r1AuJrO5Uvpb9vpj VFOhz/Bf6+ATCJSU3nwLdKRKIO/ysgrHm0tJ3KzSjXMYXEIk4KYxIxiCpWI7/Cpivurz1h0RYSiML bhlKux0tQVuw7MOn5UTbTehPzf6oBq60g/kRgxQLaYJXmtSITCekNcj3GavX7bFNvOt0Ma+/BaNNQ mRF//NxInW1sD+7Z27jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNkOi-0050iO-Q7; Tue, 07 Sep 2021 23:21:00 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNkOf-0050hz-0R for linux-arm-kernel@lists.infradead.org; Tue, 07 Sep 2021 23:20:58 +0000 Received: by mail-io1-xd31.google.com with SMTP id b7so725431iob.4 for ; Tue, 07 Sep 2021 16:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V9SRKWezKqa3DScf04T/IwtUu9oKRytvDRWN1QW/5N4=; b=P+GeO1iPXGIGDYMtGFjRAg4MzkBCJtQS0xCvZ+XITbZPZ/4VmkpY5wpP+aQMSzwjIm EY91P/rA7ZZkJovWTonbbXqIU0Ee1dOMkdy5SJbXeUyp7BiaiDe43EECvR4k/HQEaTGs HL+cASUO/KaIoyJpf9pvGdTWE26v7HfGPJ/4xORVgHxr6Rr6Sctga7AKb4I6V7TNMc44 qV/TCW2HomcX4eJLgmJypgZxijSzzQ6qcn8IsRgWZDWjTFpXewa5orLPzubCd19hKfSC 3rQprEZSHgCJhZOn2aKktTJv0Ih7vKYvvRXb9nvNjDyDjJJYWmktkvKvv0p1MsUh/6tm wXOg== 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=V9SRKWezKqa3DScf04T/IwtUu9oKRytvDRWN1QW/5N4=; b=jMxfsy/3+e7IUsKKKTamUU/8rqWl15BY+6xYS+uhUzCC4NYYiNZ0hWokCsHeGESPf/ /uKSrOihNzfaKjVKYdxtR1ruSUoz3rnBBK7r1nDXj+DGw09qYh+Bb6naIfGHqQKRyvIx +AcfTpAtbI5w+NcbJcE6tX+MdrGwhQLBwpMrivG//ZFrurBhSv1M6qrU5+pMc1JcmUqP aGvbF+zZVIIWB6IjYLSqUf6U1jUDZWpcK+valA5Khheoz8/G5U3LmzMFlO7iHy8ccxN+ midT3HixosCfqVzNwSoTkEWYkG9ZXvG9l0UqoompWh7zACqS2lml+RdDCvvMUj2EHJpI ssig== X-Gm-Message-State: AOAM531tQ0onlfD9nBv+CsR1fwFb3GaDz7rkBa3KmqS+++/S7xXBH3Au yHDj9I+CCYs81Z//0MyeSOd+s70wy5ZfXL2H/0lkXQ== X-Google-Smtp-Source: ABdhPJyQdDB0H5OednEHFJseqY/5MTGV143QwxgedZ2KcMYMUKY5InVv5i3hgJIja/bDdV0kWKnbJOYDSjyHZBSc5bY= X-Received: by 2002:a02:958e:: with SMTP id b14mr743355jai.123.1631056852616; Tue, 07 Sep 2021 16:20:52 -0700 (PDT) MIME-Version: 1.0 References: <20210827030748.587710-1-pcc@google.com> In-Reply-To: From: Peter Collingbourne Date: Tue, 7 Sep 2021 16:20:41 -0700 Message-ID: Subject: Re: [PATCH] arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled To: Catalin Marinas Cc: Vincenzo Frascino , Will Deacon , Andrey Konovalov , Evgenii Stepanov , Linux ARM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210907_162057_107843_75EBF152 X-CRM114-Status: GOOD ( 20.91 ) 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 Mon, Sep 6, 2021 at 10:58 AM Catalin Marinas wrote: > > On Thu, Aug 26, 2021 at 08:07:48PM -0700, Peter Collingbourne wrote: > > It is not necessary to write to GCR_EL1 on every kernel entry and > > exit when HW tag-based KASAN is disabled because the kernel will not > > execute any IRG instructions in that mode. Since accessing GCR_EL1 > > can be expensive on some microarchitectures, avoid doing so by moving > > the access to task switch when HW tag-based KASAN is disabled. > > I haven't got a chance to look at this patch yet as it was posted pretty > close to the merging window, so it wasn't on my urgent list (not a fix). > > What's the use-case exactly? Do you expect production kernels to have > KASAN_HW built in but disabled on the command line? Yes, KASAN_HW_TAGS will be enabled in the GKI, but we would still like the flexibility of allowing vendors to disable it via the command line. If they choose to do so, the overhead should be as small as possible. > I thought there's an > overhead already from kasan even without MTE. I believe that the intent is that KASAN_HW_TAGS on its own (with kasan=off or on unsupported hardware) should not introduce any significant overhead. Peter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel