From patchwork Thu May 20 12:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12270225 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 C2CACC433ED for ; Thu, 20 May 2021 12:52:06 +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 55E12611AD for ; Thu, 20 May 2021 12:52:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55E12611AD 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=hQ1RKaZajx1gxs/ArStsfRP/haOPd5WBn6gAR8HCmmg=; b=OXrale+w1osJu8 AFtBSNHoZGLDef3AMKXxt9GfG2XP9LcTPX1Db8K5bpZNU5BVlPuNHjR2K25DmVNPh5+uCDMPGS2Or PtvtsHQ4ejTIMEEVHiloIVl4zcM4Xeg/jiH6gKsZAqywWWPjZJJjqkeYhJw+DWUOXQt4XRuiLAAZD mvE50HNIHVNL371sHJPsGeiND0NEt12enrSgm4xN4xm3oyazYo0lmFAH6IKe343rdhM7qAkN+/NKr EGgu5+c1tcHcqBIpb98GMi+lN/ApJ47kGyN4cC1RbUxkbaJx81PRSZcXEx0em0Bmx2AnUEQrauvRZ x4t6xPh5rMWTVr+kuQNg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji85-000yDS-Rc; Thu, 20 May 2021 12:50:22 +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 1lji2e-000u3L-O0 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:44:45 +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=YVujAnizNIUy1/K24Db/sNFlmhnU5DJYyr7mqgK3N8A=; b=VqNBbfEDMN6xcTpgey4Bk+yimm cNHQtKsHA/v2Y6S9oL3QKWp5cM7Fb8E8HT3l9AKEHyN7C9fhO9Fq9peISJ9qAlyySmxzvo1YIoQN/ BMWubJUeJQoJYN0bMkO96xVsxnx7w8CkNd3XpudtxAIT9twJPj1ZqPk4wYwJ1cd4ylhmMDU29Po7m j8XoLSW59qfwaL3AYtvZ6ks8CkxrWbPUDWr7eN/J6rKQLUFUvdVhEPtkiPbeKiLEONGK7R8fqpIO4 ySkxU1+FGrvt/7h9NNK9wdqHlBQV3sumfxxIzKSMmw3mxquz+MvNvhKa5CRP+8oUCNJbH72w9Cf+w T1Pg9QqA==; 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 1lji2c-00GKgz-8F for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:44:43 +0000 Received: by mail-wm1-x34a.google.com with SMTP id k124-20020a1ca1820000b0290175dd5429afso2289634wme.7 for ; Thu, 20 May 2021 05:44:41 -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=YVujAnizNIUy1/K24Db/sNFlmhnU5DJYyr7mqgK3N8A=; b=hb1sJKeatAES56YCQyFjs7vKcr5uYAOPVrlA2O/7CwDuABYwnJJLdMWugaJ9Kg3Rs/ 6yPI3CyvuC3uLKig4dSep/ek/CqxJ5d7JCncfV/EgWSFQB4HiQ38S1N6ihaPCKMP5nhE vPLwotyguZ/qB2E9BC+7VkRppN0LORemNUhvpCUML8bfMSM1dbseXzb/0RCJBiU+ckK4 O8eBS6YgNHabqk/1BbrBIUqsGym1M6ydK4O/HeSWKev+VuB+BEAqMznEAoAa6CX1VZLp 1oIeQ0PlhIsdD9C/oWLJl1HXMXVfn15yh2BHVY/l674cSqdMbASnez/zp076csIO87Oe QOBw== 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=YVujAnizNIUy1/K24Db/sNFlmhnU5DJYyr7mqgK3N8A=; b=nj7LtjK9TGpCgOUA+FfNVA955oVO3QHHoxp7TSF735YdbCjQsl9bInQLpN9WFPedeY 8wTnCm7LdrhwAPPZezmmFiMI+PkuiO0RfFSQajq18FeOQksKwmCzhhx+KROsemwqyQLN gzhNOk+vqmIVw9iwaCsN+yLeY0j0TUfHxoDYf+Kp1RmUhqu6KEqKUYp2rYnh1SnS92oB veXEep+SlLt/so3sK4cBAA9bKtewLLMbRhKPraZbAigdjVACIMrwZRihe9XO+eVlYhyD RracBMS9tb4Qd/ucGgAG8DJFkJrB39YLBp85X8hWaQDnrLkriU+ml5MJbMXipLVUA1kZ Qo7w== X-Gm-Message-State: AOAM532sb8fAGglqAg+D4KdxdnHlXGWH0BFtd89wa+irU33fBDBIitfW Nc9FFVpzzPGTL0oRX8qL+FWxv2eAEKEugBJtGKe0JrMkKjvIuMriB7YXrnTnayrC6vd/PcXdmke Sq5NPLL5oggAbrGDGFm0b78KL19AUcdgxVl0KTyRBQfmO3u+UT6ijMpGUw5XpAtjXm+QGSMJUmc fm6A== X-Google-Smtp-Source: ABdhPJwciwPAJlGwaR/vECPIy33Adr4pEEVk23JDh8x3urVE8IYYyjQ1aFQmeJFqAjyHSkUuyAg1xcV76A== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a1c:7d17:: with SMTP id y23mr3837475wmc.167.1621514679981; Thu, 20 May 2021 05:44:39 -0700 (PDT) Date: Thu, 20 May 2021 13:44:03 +0100 In-Reply-To: <20210520124406.2731873-1-tabba@google.com> Message-Id: <20210520124406.2731873-16-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 15/18] arm64: __clean_dcache_area_pou 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_054442_312948_7067568C X-CRM114-Status: GOOD ( 13.97 ) 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. 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/mm/cache.S | 9 ++++----- arch/arm64/mm/flush.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index fa5641868d65..f86723047315 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -62,7 +62,7 @@ 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(unsigned long start, unsigned long end); extern void __clean_dcache_area_pop(unsigned long start, unsigned long end); -extern void __clean_dcache_area_pou(void *addr, size_t len); +extern void __clean_dcache_area_pou(unsigned long start, unsigned long end); extern long __flush_cache_user_range(unsigned long start, unsigned long end); extern void sync_icache_aliases(void *kaddr, unsigned long len); diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index b72fbae4b8e9..b70a6699c02b 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -120,20 +120,19 @@ SYM_FUNC_START_PI(__flush_dcache_area) SYM_FUNC_END_PI(__flush_dcache_area) /* - * __clean_dcache_area_pou(kaddr, size) + * __clean_dcache_area_pou(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 PoU. * - * - kaddr - kernel address - * - size - size in question + * - start - virtual start address of region + * - end - virtual end address of region */ SYM_FUNC_START(__clean_dcache_area_pou) alternative_if ARM64_HAS_CACHE_IDC dsb ishst ret alternative_else_nop_endif - add x1, x0, x1 dcache_by_line_op cvau, ish, x0, x1, x2, x3 ret SYM_FUNC_END(__clean_dcache_area_pou) diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index 5aba7fe42d4b..a69d745fb1dc 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -19,7 +19,7 @@ void sync_icache_aliases(void *kaddr, unsigned long len) unsigned long addr = (unsigned long)kaddr; if (icache_is_aliasing()) { - __clean_dcache_area_pou(kaddr, len); + __clean_dcache_area_pou(kaddr, kaddr + len); __flush_icache_all(); } else { /*