From patchwork Mon May 17 07:51:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12261049 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 4B7F3C43460 for ; Mon, 17 May 2021 07:59:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D66B76105A for ; Mon, 17 May 2021 07:59:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D66B76105A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:From:Subject:References:Mime-Version: Message-Id:In-Reply-To:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YOe1Fy1yE9s5NTc/3iJq36v/Um1plAPfyh50UJxe74Y=; b=TBPhbNmoy8fWbM jPHaEuZQvMbolXcCg9QyMPHmOIRW8ITCOcslZ69NC1Vc6ZA8GscFdTiptD0g/2kK2eyVYXMvIzsLU SVoqERivhaB8V86M8i4LTHNpfoWIf+t/o58h1CT8xo7x0TiZJO38SSJvmk8nAVj98zppf0dr0JMyf qCDAiCdTdqaqbHag9znYtMHmGbQRfUSon8Oa2yrme/gMOgzWaY0b7CprvXPwWJGxviXIRJUjZnv/Y XJZbXLIcOM4nxZtNH8QlAcvA6GxjOz8fOqOs68Xx8zq5KimpQenb3E19Lgrbhsr6ctSCSs4dd3qRW wiNv4A94vyt8Qr+fAjog==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liY7n-00E7mO-EM; Mon, 17 May 2021 07:57:21 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liY2P-00E6Xu-QX for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 07:51:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=C9s07ZFSU6Iz8OXT01veCpRVIEgdS9WmWKM99th16f4=; b=o0anNCb0xlO/YYFzbltnaN+OgK LtKKRw5Rbfypilu7sgnlAaMDPzZZB/J5yTnbNSiwGg684X9Tzu+6MQR3nNXC+m/dp3bdibzgvJWdZ mKZr77Hyy6MFZAHxItbDvujDRSXGmAz8WaFe6sZWZRpQs4/cl6+PJq5FWo2/tVskpInYu3vGimlvq wvYgO25QNsDvCjYH2FH9fC/x/sZ+msqaBjrYZ8GcYQkL1IkVJ6oWQQmxECvgekIc260KTM5Zf8a+K HRpx49L097K564Wrh4OhJ2rWkd2UiruZWEW+wN8dCrKqwOOLb9/Dhk80sexYYESUcnFBywC3m5Q65 EqWqTmpQ==; Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liY2N-00DYwl-6C for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 07:51:40 +0000 Received: by mail-qk1-x74a.google.com with SMTP id n142-20020a3727940000b02902fa8eadfa9eso4185199qkn.7 for ; Mon, 17 May 2021 00:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=C9s07ZFSU6Iz8OXT01veCpRVIEgdS9WmWKM99th16f4=; b=GDjcdatW9PrKhnGr9FQguP4GJBAXbbtqdJMmiYeUN5bI4uXX86NaghUO2E7Hnla924 dMuY1IxgKnPoPtA23T5V3xKciGwmmuTeMQfBg8Z8IsrnqYomzQLtsd17Qv/0nG9zZaoM Wt69xXFFymGeesJUvEjt4NDRz037G3hQJtXgow4aWXyV/FUU78GBX5No3K8JQUrkVb3g qEfqEh4giMlEovh8byZ0+mC/zt5EKU7UCozOUdDF+JkzSlWeMnK0qzUHPW6Lgw8uDnRo OWQL0Kg9oXJxg0ERhX8wkCTTQRUHQjxFRtf5Mebu0biP+UdJ0dQItSx8HyghcC9wIOPS hTlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=C9s07ZFSU6Iz8OXT01veCpRVIEgdS9WmWKM99th16f4=; b=N9s7gzY2r4gvlq/3uKd6bHjyceSCTW9Mv/VP1RFWtEaHambNklwlRMMlTw9Zbe+LJJ EJDFccCK1OZPeNo5NpLwFPcmSfCclQVq5UDSFTiJGpwbNJ9l3byKhUkDWuyLtqczD7dM Zad4X25GljveH0QSeomtiIS1TxH8tYQmB7M6+g5hdxe7rO8xqUbOFOggYMlciTkZFPTd MiEYRjCskV40+H/ZWXEg7NNzh9lAcIR6bGPHjJzBUyAzGWQuasH2buJfHoIzEJ2ZAqNY qwvo3G9EF4815LbCvvYi+tbZyX+S8/zpJDY10fUTXcUcmr9N35IKpuTnCA98RbeyjJ2m +WwA== X-Gm-Message-State: AOAM532sIVfw5euYHPhspLr/5va9vKd7jc11TTyQNpGdEjMq2OLGd/1G WpH8nNx/WszgKGbGR8Gp6XflcCbrSYqPWwjEAjwsXDU8HTkgaIHkZcHvCZLK29/Wt5gP1FB0EWC c+TFrDbWuBvi/WHrKoFUjDqGdeS14dt8P0GkBd0FQvG0g920LOqggVBodeSipGgErDcxq52qWv7 edPQ== X-Google-Smtp-Source: ABdhPJyPD3ygDOSDCVJm8iczxHJ5dpDxACXMwiJ5Qih5OMMFmCgofWLBGs5Dv7rZ05rH+6rilZ8H9U654Q== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:6214:851:: with SMTP id dg17mr58818565qvb.56.1621237896650; Mon, 17 May 2021 00:51:36 -0700 (PDT) Date: Mon, 17 May 2021 08:51:13 +0100 In-Reply-To: <20210517075124.152151-1-tabba@google.com> Message-Id: <20210517075124.152151-6-tabba@google.com> Mime-Version: 1.0 References: <20210517075124.152151-1-tabba@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH v2 05/16] arm64: Remove uaccess toggle from __flush_cache_range macro From: Fuad Tabba To: linux-arm-kernel@lists.infradead.org Cc: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, ardb@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, robin.murphy@arm.com, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_005139_245944_4FF44D26 X-CRM114-Status: UNSURE ( 9.60 ) 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 The uaccess toggle isn't part of the cache maintenance operation. Move it directly to where it's needed. No functional change intended. Signed-off-by: Fuad Tabba --- arch/arm64/mm/cache.S | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index 6babaaf34f17..d74b20cd6449 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -26,9 +26,6 @@ * - needs_uaccess - (macro parameter) might access user space memory */ .macro __flush_cache_range, needs_uaccess - .if \needs_uaccess - uaccess_ttbr0_enable x2, x3, x4 - .endif alternative_if ARM64_HAS_CACHE_IDC dsb ishst b 7f @@ -55,9 +52,6 @@ alternative_else_nop_endif invalidate_icache_by_line x0, x1, x2, x3, \needs_uaccess, 9f 8: mov x0, #0 1: - .if \needs_uaccess - uaccess_ttbr0_disable x1, x2 - .endif ret .if \needs_uaccess @@ -92,7 +86,9 @@ SYM_FUNC_END(__flush_icache_range) * - end - virtual end address of region */ SYM_FUNC_START(__flush_cache_user_range) + uaccess_ttbr0_enable x2, x3, x4 __flush_cache_range needs_uaccess=1 + uaccess_ttbr0_disable x1, x2 SYM_FUNC_END(__flush_cache_user_range) /*