From patchwork Mon Nov 8 07:11:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 12607927 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58914C433EF for ; Mon, 8 Nov 2021 07:15:06 +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 21AF361163 for ; Mon, 8 Nov 2021 07:15:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 21AF361163 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:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=AP7BFhRH1wgYw6trkxcx4CH7zlIzc7agN4Ip8q3M3+I=; b=eFe byKlzWmEwf/42+oVvU4gFsviWbgWHt/Bb9Fb62YQcwkyQd3Rdh4+VcsM6Kys1LHaYCiCRkrVLl23A WgdpFemCQJRK6ZUPLh5zzYe6Y2jWdYBgW/dG+n3SLr5NhH6WmR+p2/HDIbwLjxeNdZsB6qKIj3isf 0bsjY6PR3OwB+LXLizq1iEEScB7M/+1OepcWUCxjg/JfMVDYV7DsLbhU5sZwWi+ht9Txs9eu0nd+a tLwBEI5r7I2D2BljugX63zSX3aDBChsNsQyt36g08JuTgVygS1cjy9krVdcPXaDYc8u49p3fFr9X4 8H2hGON1TDIZ67VUFVmiHSuEXp7z/vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjyqN-00FXWG-9Q; Mon, 08 Nov 2021 07:13:27 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjyqI-00FXVg-TV for linux-arm-kernel@lists.infradead.org; Mon, 08 Nov 2021 07:13:24 +0000 Received: by mail-pl1-x649.google.com with SMTP id a4-20020a170902ecc400b00142562309c7so1197613plh.6 for ; Sun, 07 Nov 2021 23:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=vxkPKGKCkWVUcMdibRmmF9kRSGzJz0M3nlflHUY73Qo=; b=OnZ3dOXdFsO2XShiYdjBZlbhsRotLtLxTZCaqgEI8jTbmVE5juomzKBqwkuc3GnhCy FshQKaL0Mgf4JQ1/U0ffTlxet3MIs7E5qy63CL754LaepwU3tcxPG/Kb/99qBLZoyF/M ZfHyEJOKLofSQS/ZlM1CSfRwQU+gHBKqKMJazLdmwxbVJmzdkXScs9eeUt1M1y1ncmNG azOqsbPM6mBLLofuMtnnQQZI3EJDXQ3ec9FiifrxblGuX0wfPKSA2jPBldCv/aIX2kAB SavVqa390NE4qa36Ii3KQ4FGKTxRKYBJEWyda5RbU1/lMmcs9tHMiEHp1yDsJ0GVWE+8 pD9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=vxkPKGKCkWVUcMdibRmmF9kRSGzJz0M3nlflHUY73Qo=; b=ZB5nzMQEvQWNTkb5gEA06o2YtOkBmjl15nqYjKqp7avjchpXkYqPumkFEYTw2IaDgW x+JOS6lc28XR9RQSa/ZWKEQ7QAHtS2SUnG8BNsi2E5syNW9lbOAxtzKPOeovvjjpNjsw rSX61NrtgGFEGzw2PnqesFDeYatSx6orOrZkfcGHWtX4JCsT8nROht02BPB5NaD4SGMX jS2Ne2tTn6Y8Mvz43R45ObTx+UPbFE++1QDsv+L1JK03C+I4fYKwc51QEAB+/GV1lZ4J s6RowpKUVtQxRPE6Vfkf/PZg+4DsC9hCDFqLuFSRZyZylgnyW7+C0Zuv0VzaWvllnPm6 jY2Q== X-Gm-Message-State: AOAM5337DlkpB3IIgf9ltqhRodVqCbbT313FjGJPFeoTG3QhpIzdJxv3 XDWksAhErEJFk6ijlQzLcNFaV6fzAEU= X-Google-Smtp-Source: ABdhPJztHjDChsh1OZcngIkhgQt09QpCb+YbWPHtycKvMcRq+/tFN6Mn9gDpqElhRgD8wfdvYGanz/NNybE= X-Received: from reiji-vws-sp.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3d59]) (user=reijiw job=sendgmr) by 2002:a05:6a00:1583:b0:49f:dc1c:a0fe with SMTP id u3-20020a056a00158300b0049fdc1ca0femr3768576pfk.46.1636355601458; Sun, 07 Nov 2021 23:13:21 -0800 (PST) Date: Sun, 7 Nov 2021 23:11:47 -0800 Message-Id: <20211108071149.823570-1-reijiw@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.0.rc0.344.g81b53c2807-goog Subject: [PATCH v2 0/2] arm64: DC {ZVA,GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 From: Reiji Watanabe To: Catalin Marinas , Will Deacon Cc: Marc Zyngier , Robin Murphy , Mark Rutland , Peter Collingbourne , Evgenii Stepanov , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata , Reiji Watanabe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211107_231322_996874_A8B474A8 X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DCZID_EL0.DZP indicates whether or not use of DC {ZVA,GVA,GZVA} is prohibited. However, clear_page(), mte_set_mem_tag_range(), and mte_zero_clear_page_tags() use those instructions without checking it. Fix those functions not to use DC {ZVA,GVA,GZVA} when DCZID_EL0.DZP == 1. v2: - Fix mte_set_mem_tag_range() and mte_zero_clear_page_tags() not to use DC {GVA,GZVA} when DCZID_EL0.DZP == 1. [Mark] - Fix a typo of the comment in clear_page() [Mark] - Fix a loop of for stp in clear_page() for more consistency with the existing loop [Mark] v1: https://lore.kernel.org/all/20211026034844.1393437-1-reijiw@google.com/ Reiji Watanabe (2): arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1 arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 arch/arm64/include/asm/mte-kasan.h | 8 +++++--- arch/arm64/lib/clear_page.S | 10 ++++++++++ arch/arm64/lib/mte.S | 8 +++++++- 3 files changed, 22 insertions(+), 4 deletions(-)