From patchwork Mon May 24 08:29:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12277151 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 33E24C2B9F7 for ; Mon, 24 May 2021 23:03:03 +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 DBD046138C for ; Mon, 24 May 2021 23:03:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBD046138C 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=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: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=PHB+XveAMemT6P0Yrm2gmVrLTONUFArWScE4d8htGag=; b=AjhEv8QDNchMpO10Md5TxwdstE vq1Yj8/a6O6EZwr4fXIQkXjeXF8cJkFZ3IIdXzmBltzOQ1xR6Vgawn4pz0RynXaA8HutEe/V1olVJ xMPj4U7bpKcyeXDrTJmBF0mMvcNRvV4scc7O5WtUOrcwjp//ivyc6nRox+WFNM45DOSRjQRkOZWwa EuVpc6yE5yRIlHyeadHhyDpXDXQNo6TXOaHaZ9W05Xqizrc4/XAo/JnGj2oxkt/fgt2A7uG6Ee6Lp zXVbiDS6DRNDG+xGWB6S7ieD/RJlKq4QW2ytb+vPf5vd4AjB19fdwn9WP+rnbG7rrUJYrA53T/49g V5ayFqNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llJZ6-002Fk4-Qj; Mon, 24 May 2021 23:00:55 +0000 Received: from mail-ej1-x64a.google.com ([2a00:1450:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ll5yw-000lt3-FM for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 08:30:39 +0000 Received: by mail-ej1-x64a.google.com with SMTP id p18-20020a1709067852b02903dab2a3e1easo4324048ejm.17 for ; Mon, 24 May 2021 01:30:36 -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=OUgnP7QwwjnFyJeMkmUD5OgbsQQkr0a4dVJNwaNnXqo=; b=rC5IO/i5qgfWXKnNsmTO3yPg3khXDMnrh27ppMYG+ncCNWUngHr9jnzf26Mbb0Fk1Y spUA/+RJvL8LYl0OGwvPLODP6PNbcNfPm5LxrvLWUMyFajM/+vMmRliqcYMv1iKx91D7 V2bTbRDUuS/mWMW+1xlsHcAX9dW99uTlV0RSa+mgvmZGwlXBPTbet1J8Ph1faNdNY5c7 MqrWciXrTqojfVK7MENJ0SI+Ahe9kflz2v4zhU3z/1KzZl+xB4F3Ara5sqVgskrNI3Pq KBau7jJEKR7Qbu1zXw8q2zHjGqlGLq1mD0PhDZxtKWwMDQQl4aD9Ys4c3uHEhgrNldkO 2hkA== 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=OUgnP7QwwjnFyJeMkmUD5OgbsQQkr0a4dVJNwaNnXqo=; b=DgtFcvxJwfz1olLip49fOWRdaklg71Fen+smwyQGiRphypGobScDR+VvKX7FEkcx57 g0I1CKLHolBX+sKSmaqepRaq7xlqiGZFGQHjiSvpnskW7+Pcte7Xl4/Z/RAUGK1RZy9i lKksIGR2IaQ1euIpeC2yaii53tAssi1nhrYZIllPMzkFYxioX1gXydkHk27sd6gQ2x2K 3OzAV7TKi+rGxbQhALRL4k/qtWJmvLUqi3GnlMSVYwbcM2JpxXh9xIPAOHUK5luDUX62 jxZ9a+yt6lKuwGZa0dGQcr6yOG70BBgrSSuAnbZ0M/lcAC7o+xfRwhv83MeDIOj1Ml8D Tnxw== X-Gm-Message-State: AOAM533z4BYE/MZvfNdRUcwWLyTs0dnb8RhERhBPznsZ821IM8d4RmLL kBHq6lNqkTmUKErz3sSlg838tHd9gZCm1UFwPOIphZqSUjqCIDhUequXTiQ1TeqL/YjMcqwzhFl OgqA7+cV0fpw5YcMEODXG1zhmeNWhyU9NZSLhzFBA7iRfHnUDmEkgoJTE7tBInaQnZRrWCYFq7h b0pg== X-Google-Smtp-Source: ABdhPJzatlczQl2VKZq52n8QP167mIDcmSGYegqWr9k+5mx0JvklQ1c4S1ZX6jGqHv/PUoXHNf1Hdo/UTg== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:aa7:cd55:: with SMTP id v21mr25136643edw.344.1621845034917; Mon, 24 May 2021 01:30:34 -0700 (PDT) Date: Mon, 24 May 2021 09:29:58 +0100 In-Reply-To: <20210524083001.2586635-1-tabba@google.com> Message-Id: <20210524083001.2586635-16-tabba@google.com> Mime-Version: 1.0 References: <20210524083001.2586635-1-tabba@google.com> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog Subject: [PATCH v4 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-20210524_013038_537499_8EA11024 X-CRM114-Status: GOOD ( 13.85 ) 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 Acked-by: Mark Rutland Signed-off-by: Fuad Tabba --- 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 b71fcf56516b..ea605d94182f 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -113,20 +113,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 b2c226d93ca5..0341bcc6fdf3 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 { /*