From patchwork Fri Nov 19 06:09:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 12693102 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 67B41C433F5 for ; Fri, 19 Nov 2021 06:11:18 +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 3288261A6C for ; Fri, 19 Nov 2021 06:11:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3288261A6C 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=hm4B+xlY6+d7YFQfO+sr5HoMsqEr8vCfC+EBMcnRugw=; b=c0/ 38HfFObpZ0BK+g1YcLqUoPhCQUdw8LGQ1I1WDUfGFObOrgcU21chWJswGV0ixYdbAs+2CdZBsDOQ4 a6Grg0TsxYT6tvYNppv80A8PzsvfDBeampoHox6LhA5H88SU9JHun11aZMrylHveXFQAh/a5a6VOH 05AUhOdE7Dpc5QPYTS/rMDpUR+rtvatbtqIHRJ9IMZB0WzujQrA4egsnJtXx+dxt0N7LU6tkwZFcK cUJIcOOiHnCHoJhaQ2Z9H+xq/mjz49MOek4ERaWzrmGVLkDq0RFzAHekHF1rgSeB7GfkVp5yMfRUi CGzlU5V51WIvzqJJ0QZtId3+x2RKeQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnx5e-009W14-42; Fri, 19 Nov 2021 06:09:38 +0000 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnx5Z-009W0a-VY for linux-arm-kernel@lists.infradead.org; Fri, 19 Nov 2021 06:09:35 +0000 Received: by mail-pl1-x64a.google.com with SMTP id v18-20020a170902e8d200b00141df2da949so4036015plg.10 for ; Thu, 18 Nov 2021 22:09:33 -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=+9SvjvPH+1XZQmF0msmTEjP/GX4VdZDmY49zD4WdbuQ=; b=bBH0K2TMuUpEyD6KitGXxd0NSK3hKsM9FrxsWwvTT/Ips1xmoVS1eyZeAsRZEuiLGR SZQjH1YDF+MmK+4HiwOk4i5ezZ4LeYxdaWM7Uo9/UYGkdN35wxP7+YeF8VWWDaMioNRx I7MtGEzo4tZtFWvG25O+TfU0kiGNH4pvITVUerShEdrAqh7XKZSK4GtMM3ynNkYhDBpq jS5LDvevYsBXkSF3Dz0en5wel8fPe5+zoxbAXS2pJA2XrCkast3DsCMa8Hvl2NS8qvCT sm4M72lCT1Jq2VMsXcxSwg5zw4fmhTBhFrXHBYfCwUXYqhnggdvxP8XcKsD7GEt/fElt PjcA== 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=+9SvjvPH+1XZQmF0msmTEjP/GX4VdZDmY49zD4WdbuQ=; b=ogazcHXr0MgkG3ldwVmhOubPdHEuog/A2UupFPFHr8MDWSwGl1TsIQU3QYe5JFr3C6 NCjdHJzMFZEDVKquRL3EertwRMmh5N45x0BKLAZ4FZw3yvXqNAeqCBKU4EPRXUBmwUeG DerK34hN91QP8uMQd2yPbZrgfzEd4upLAtEXNetcBi5U7i0lNZIeBJN+2ZV6l19IKSMb XxwOfVxqPCDJb29AtGruPsAe2iA7TPA675c3OWgEXD6IinNxP2pzy+mRrvGXU7W1bTM4 FYfPxhaJTGqlhSS31vcMGYE2gCk3xJDA4oGmDkOipLGb9v7qHsPykDUzqYb/Wm13KtHT pvOw== X-Gm-Message-State: AOAM532RmDisDvGlA1Z1BBMZzcD2uwqipgkaLlPljb/io2aNu1zmwuC3 HjbTCXpYzG+T0iEOrBautqgbhPpaNIM= X-Google-Smtp-Source: ABdhPJxSxOiz1Rjc4phoDGRvK/7T6zY6yd4SZbwMfuYMaRaEyYnvwbNn6J9m3Vbq8lPt/9EDBmJbIR2g16s= X-Received: from reiji-vws-sp.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:3d59]) (user=reijiw job=sendgmr) by 2002:a17:902:7c8a:b0:143:bb4a:7bb3 with SMTP id y10-20020a1709027c8a00b00143bb4a7bb3mr58383397pll.46.1637302172599; Thu, 18 Nov 2021 22:09:32 -0800 (PST) Date: Thu, 18 Nov 2021 22:09:25 -0800 Message-Id: <20211119060927.3185381-1-reijiw@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.0.rc2.393.gf8c9666880-goog Subject: [PATCH v3 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, guanghuifeng@linux.alibaba.com, 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-20211118_220934_060762_E11F3169 X-CRM114-Status: UNSURE ( 8.69 ) 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. v3: - Use stnp instead of stp in clear_page(). v2: https://lore.kernel.org/all/20211108071149.823570-1-reijiw@google.com/ - 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(-) base-commit: fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf