From patchwork Mon May 17 07:51:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12261117 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 71462C433ED for ; Mon, 17 May 2021 08:04:49 +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 E831E61042 for ; Mon, 17 May 2021 08:04:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E831E61042 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=UziUpr3iF4yMf/fmO7cO4ZYxskHoZ80jbncgA8Nu4YU=; b=Xm5o2vhA3Kzfzd /gQYRtxU20frxMgq0xKJYggC2OvSyx5pi2i0hEnqttkPvj/qBVjGrhKDpLjGvi8cgRbMKVOBkoRy7 y5BVq36iX7BqvbNCb1/tcXY9DBezi1HIyhIjO0GWZGF4zvWQxZ91FPEpuRG7sorkbwENiYQ99w3ev MLh8wchBDU598C6/r2iskMDCxA5Y3vrDsYeO9ROqQv3gaDC0wAPaIuCpfMkk24KQefhjWfDHG+WtI l/3qkRAykvixC55IzL6dZogthabXs9MiYKsDUxYzooegB5BnkOpXtf/9GPK0ABfmvs2CAzCTb81eR 0/vR5UO6lLs09WOUmR8Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liYC6-00E8tn-Ik; Mon, 17 May 2021 08:01:43 +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 1liY2b-00E6e4-Sr for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 07:51:54 +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=cFIYMobvfVxBSsjID/I2la04uf9rE3ub181A8Qj0oaM=; b=0nSmO9MrqnEqlMUB4unymO8Ew5 oek4lpbNtQyv1jRaV4hlPtJMMmiBxgbCSJwpZE1u6Gd42q/Ww2QhXEMs6OIe/Q6bdWE9f3+CM/mMX IfHWtLPXPm5QPIOFZfbMTvdE0FGOfID47Gx4Urr9lDzehOo3d6bGYw7X5cUSqxrxuKODrothEyzfN RKEWMr+CK+HFKx/ApSb2RbT5TueyGnoe/cKUMQn1v8n3rtnFm0zE2EPMkC+VnX+/S2UMUHp4MLiDv r1cEixwFd/GgbO7R7W3Ue+Tix36Qfsi3jwQdt0IWVOtV+O0J20XgBtTzCYnECrBHlUV8cyee2oUCk rAFGVslw==; 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 1liY2Z-00DYyz-0i for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 07:51:52 +0000 Received: by mail-qk1-x74a.google.com with SMTP id n142-20020a3727940000b02902fa8eadfa9eso4185366qkn.7 for ; Mon, 17 May 2021 00:51:49 -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=cFIYMobvfVxBSsjID/I2la04uf9rE3ub181A8Qj0oaM=; b=Kx+7LuBdfjMMobc5vv0ib8ETlQQS++feHYmHvAWsEDDgmdD0bawC3M/rKtCWnuEsSe ithzPxpY8mV40j7p1gwHMUcZcIwxQcHzmkM+2kWzUtLj6ORjyEWYdKbKPSTOjwIJ5aYz obtKMrZM0t1wtj6bTpO5Wx+jEMRCFMMSE4l8nMPdUSDINEA8DI7QhlBUzmIZEw2iTSl/ e8DbdBvMt+6Wyw6vtvBmjI9PERlg7eHMFKgZEz6OI7jIvvNjkemZcN9nULEfbce7TJif bcWyCha2n0+E03lVld6RWO3XDhSQUKYgWTs6F+byGy1DYOd6FbWfbGCmlcM3+Q500osN 56Nw== 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=cFIYMobvfVxBSsjID/I2la04uf9rE3ub181A8Qj0oaM=; b=egaXc7qFyqlBVn6264pSkGapb0iVgtwNh0w7yVnTMfwVa/nFD42uB04uwpZGrUnOmu oS13BU/zp6Av5tcsDhfKMcpy+5+VBt404TvF3fxNlIQbGAsRcm/xTtmqWCFY7db68+b3 GcI6xVtqlBAXpAA18pMRxZ03fjCycpQFhSbz8MwPmlErF0baSS36lbSCbbXZgOmMRzKT EAqZ6moQa34+jBezxLxZK3rxX6N/DWJOTojPsqC+ERzeksrNxgepc8f9FEJ72rRjyqW6 iHf28HRTwLJJ6Imv4GbxPQ3IvT8SsNH91293t6lOvgGYTZGesC0VO/nSNT//66yceyLV 7sOA== X-Gm-Message-State: AOAM530tvJTlyTnNa79VIsJSnjrv+sebmviY/VkSk1KrjKDGObDItX5y CUfFaIMV+xXF1USKDQvhr8c/gEDzv3XgdsCEVZzxQfAFvtOARsumi5/hqQo7Bl4SYGWa9+j8RcI l18i0ugGB5DB1jMDLvVidoS5Vji6qpxONaawwwroNG7pFks4NZegYdrULKdeZeh+p9/cmgImEwA raEQ== X-Google-Smtp-Source: ABdhPJxWIuUq/PNursJ3/M4S56oX9JQVgkf0eScOPS+HWBbr7C11IkNa/LezxUfdafMoK95WIIl4ZvKyOA== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:6214:a91:: with SMTP id ev17mr13770896qvb.9.1621237909205; Mon, 17 May 2021 00:51:49 -0700 (PDT) Date: Mon, 17 May 2021 08:51:19 +0100 In-Reply-To: <20210517075124.152151-1-tabba@google.com> Message-Id: <20210517075124.152151-12-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 11/16] 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-20210517_005151_082465_BE4A8642 X-CRM114-Status: GOOD ( 14.81 ) 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 --- 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 058605ac75a1..38d62cef243f 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -182,24 +182,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) @@ -215,10 +214,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) @@ -247,7 +246,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)