From patchwork Thu May 20 12:44:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12270203 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, 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 0ECBCC433ED for ; Thu, 20 May 2021 12:51:03 +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 8F87F61001 for ; Thu, 20 May 2021 12:51:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F87F61001 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=t7mEzqEwl3W3FNeIpYhJdLtmZ0YU18zcXXuk68+0OCM=; b=PXF1FG1v4rjOos AWSwuZb0ybKc1/9ioRj+eK9V2rXbGHKuDTLvrSx2GRkke42UA26T6surIHMOfpxuomCWsm2M3aECs kTza/gEBfszSKGFqWoMJANwoYto2D0uzmE6bundeS4UD4kZplxLAdSwV/Etqsm3BqMPtZPxHKerzz fEZijqU5uPk9o6BdYsXkYENoH/02ztNlQ7vKke2Iblnu4gBIvxT2LGdcAsFkMMz37KTPat5wnXDx2 g7WCr6i+zTHrf3Ju5nlYqWqfy9FAKzQmpcMIzFuZLUtDREnlHFoQ53PlOGCc2LpynVUzop4GYi/gF D3YJjNXdjRp2vz4svRHQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji7F-000xYh-LD; Thu, 20 May 2021 12:49:29 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji2a-000u2t-PM for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:44:40 +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=OZNPucg3lMOHZSQE7fP/86DhLlvq3G94MWPFTy7jSkM=; b=U6jLIlJb466FDxYzmP0kYAiVqP wZ6SX67m7WcaIJ/iLJTkoZlE0VBSWDT/CxcsNhEktafSuxyje1XupCGdblw09Ggeqvj+0uurwsE+7 FidowoReeuXTLxuBcUxj0zZOlC5+UNoAiPq3WzR+vax56wtqEy4Hd/JaeUOWYhCS6Lw6dnPFx+e10 JkJvHj2F/UwMUxdzgIZ/JcY8yzAbpbGM1mawHTdElC4Kn0EBExrNTrXWPvh7ZfzFNz/hJ5X4VN1sw lH/1KyKfWj1C78lLS8AZzizqfvPqCPb2Zfz7p3caLrhhK5vmQe/85194cUqoKUZR3SKMs/N2uoqHs 9CZBtdGA==; Received: from mail-wm1-x34a.google.com ([2a00:1450:4864:20::34a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lji2Y-00GKgL-6D for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:44:39 +0000 Received: by mail-wm1-x34a.google.com with SMTP id z1-20020a1c7e010000b0290179806d11d4so1185098wmc.3 for ; Thu, 20 May 2021 05:44: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=OZNPucg3lMOHZSQE7fP/86DhLlvq3G94MWPFTy7jSkM=; b=IJNbKM2LNEHFehc2kcQ89mDybUlCpQe3ZWMaP6ZSA23tvZ3Dmk3NkvLwgmcJmIe4lj tKlk4Rkw5m1RyUw1DxgZS/11C8/EYqHAmBYakzoQhWA9aegnbah7yVLRaFW+uaDJWVR7 kEuIGy5ZEyHrgrcn4lROm0VlmIJVrT3EJ3qEQKRRNbepqIx/fJ7Dgm3FuKHFTL0Ah6KZ faQc90rxwyFFpTnut1ZZRoRPKIJf1DwMnI/Sp8bM/NiPKcfZjyVjl+Hdn11xJmqPsMbo XjPlloNx5awzH+e5OzJGNi6V4MyNoZ+EW58J96Rbhkh/nkc41zKJd8Fvko+ZQBNo5gKw ZoCA== 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=OZNPucg3lMOHZSQE7fP/86DhLlvq3G94MWPFTy7jSkM=; b=aiVNuUoMPmC8UkMK02l9k6n40gtpfbpUVWbaLDFKQo3mQ46XhDDjKrRvS/fDsQUsrO F/LV4jpM0MJDEknHBZVJB6CtRrviFs6aGj093ZrvI024nWjwL29QK72SofwwFTPxTfZ/ fnbn7Nk/3oau/TnP1oR+mivfBr75wF9T3aUI3Imng/x2uYAhE7qrWbFoNoxHdz6WHjVv 8bclXXue5rhkeoJtJd0leNKGucDBmtVuSB+sKkC164UBSeFa7B52DMp2wdcT7b7yHJBx Dwsm7W63MDQ5asR1Q0ycW82gCjHS+UXJhLjhiJAUGsOyXXu03jZyzdaMHHW3Z5iAdt57 BpqQ== X-Gm-Message-State: AOAM5334ViZyzn/Jjr4H0mmpK8o5VTb4VfNzpXOti6hm/WscJI6wt+oY fPSNiUOjo3osWWjy8F7ai9T/wIXDd2te+aJUo9xe8SIq0gxEo7WZ1k2+LRGEVjduY+Kke8V0xiG gzjBQ3oIbsLArd0jApJH1OP+8o4tdHafUp6VjeJSoGgkgzX3C4E65sm98koZNnlVWG4rUQi3+sw dk1g== X-Google-Smtp-Source: ABdhPJyuRtRXr/bofhUW1lbOmxF7n0dCyxD+BilItdApL89YW0OFrZ0wLEnhTHneUTpOgfWCwkdXk+nXXA== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a7b:c090:: with SMTP id r16mr4015969wmh.112.1621514675927; Thu, 20 May 2021 05:44:35 -0700 (PDT) Date: Thu, 20 May 2021 13:44:01 +0100 In-Reply-To: <20210520124406.2731873-1-tabba@google.com> Message-Id: <20210520124406.2731873-14-tabba@google.com> Mime-Version: 1.0 References: <20210520124406.2731873-1-tabba@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH v3 13/18] arm64: __clean_dcache_area_poc to take end parameter instead of size 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-20210520_054438_250874_20C03E6D X-CRM114-Status: GOOD ( 15.35 ) 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 To be consistent with other functions with similar names and functionality in cacheflush.h, cache.S, and cachetlb.rst, change to specify the range in terms of start and end, as opposed to start and size. Because the code is shared with __dma_clean_area, it changes the parameters for that as well. However, __dma_clean_area is local to cache.S, so no other users are affected. No functional change intended. Reported-by: Will Deacon Signed-off-by: Fuad Tabba Acked-by: Mark Rutland --- arch/arm64/include/asm/cacheflush.h | 2 +- arch/arm64/kernel/efi-entry.S | 5 +++-- arch/arm64/mm/cache.S | 16 +++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index 695f88864784..3255878d6f30 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -60,7 +60,7 @@ extern void __flush_icache_range(unsigned long start, unsigned long end); extern void invalidate_icache_range(unsigned long start, unsigned long end); extern void __flush_dcache_area(unsigned long start, unsigned long end); extern void __inval_dcache_area(unsigned long start, unsigned long end); -extern void __clean_dcache_area_poc(void *addr, size_t len); +extern void __clean_dcache_area_poc(unsigned long start, unsigned long end); extern void __clean_dcache_area_pop(void *addr, size_t len); extern void __clean_dcache_area_pou(void *addr, size_t len); extern long __flush_cache_user_range(unsigned long start, unsigned long end); diff --git a/arch/arm64/kernel/efi-entry.S b/arch/arm64/kernel/efi-entry.S index 0073b24b5d25..72e6a580290a 100644 --- a/arch/arm64/kernel/efi-entry.S +++ b/arch/arm64/kernel/efi-entry.S @@ -28,6 +28,7 @@ SYM_CODE_START(efi_enter_kernel) * stale icache entries from before relocation. */ ldr w1, =kernel_size + add x1, x0, x1 bl __clean_dcache_area_poc ic ialluis @@ -36,7 +37,7 @@ SYM_CODE_START(efi_enter_kernel) * so that we can safely disable the MMU and caches. */ adr x0, 0f - ldr w1, 3f + adr x1, 3f bl __clean_dcache_area_poc 0: /* Turn off Dcache and MMU */ @@ -65,4 +66,4 @@ SYM_CODE_START(efi_enter_kernel) mov x3, xzr br x19 SYM_CODE_END(efi_enter_kernel) -3: .long . - 0b +3: diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index 35abc8d77c4e..9a9c44bb26d2 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -178,24 +178,23 @@ SYM_FUNC_END_PI(__inval_dcache_area) SYM_FUNC_END(__dma_inv_area) /* - * __clean_dcache_area_poc(kaddr, size) + * __clean_dcache_area_poc(start, end) * - * Ensure that any D-cache lines for the interval [kaddr, kaddr+size) + * Ensure that any D-cache lines for the interval [start, end) * are cleaned to the PoC. * - * - kaddr - kernel address - * - size - size in question + * - start - virtual start address of region + * - end - virtual end address of region */ SYM_FUNC_START_LOCAL(__dma_clean_area) SYM_FUNC_START_PI(__clean_dcache_area_poc) /* FALLTHROUGH */ /* - * __dma_clean_area(start, size) + * __dma_clean_area(start, end) * - start - virtual start address of region - * - size - size in question + * - end - virtual end address of region */ - add x1, x0, x1 dcache_by_line_op cvac, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__clean_dcache_area_poc) @@ -211,10 +210,10 @@ SYM_FUNC_END(__dma_clean_area) * - size - size in question */ SYM_FUNC_START_PI(__clean_dcache_area_pop) + add x1, x0, x1 alternative_if_not ARM64_HAS_DCPOP b __clean_dcache_area_poc alternative_else_nop_endif - add x1, x0, x1 dcache_by_line_op cvap, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__clean_dcache_area_pop) @@ -243,7 +242,6 @@ SYM_FUNC_START_PI(__dma_map_area) add x1, x0, x1 cmp w2, #DMA_FROM_DEVICE b.eq __dma_inv_area - sub x1, x1, x0 b __dma_clean_area SYM_FUNC_END_PI(__dma_map_area)