From mboxrd@z Thu Jan 1 00:00:00 1970 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 11407C433B4 for ; Mon, 17 May 2021 08:04:52 +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 8C5FC6117A for ; Mon, 17 May 2021 08:04:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C5FC6117A 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=bBDC3df6RLlZ2COxaNcBAOYu8SdKlb36VX93HHRB8U0=; b=HtkEZ2y8DlgvQv UF7zGzLqv9awOAjm9QnTJQIkyDkFFVfspLixW5tKHsVPhA31OBZNAgig9SfaA7kNOg6WVaT5rIE+0 vlU7/umZ40NhEPGMY5lCvfhNU8aeGbxZjXe7uJ1KdsyvKWA2fu1/DIfeDyXGhjpdaE/6A/eWc8T51 Q/vGK5IeERKPj4MgoTG3b1kI+5ozKmkmkfgUN+cEspbbx9Xdj/Sxh7O2KwL8Clc+tLERjcA/aMq4u yaftV+Q3vPuJixK3wFro3OiF3tu7Zgae137qaEtTXZ27cltZXAvWL83dV7ABndAshimchiBDW+wvd z24zAMq5Y9nyUeCews4A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liYCS-00E8zV-5N; Mon, 17 May 2021 08:02:06 +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 1liY2e-00E6em-3g for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 07:51:56 +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=Nkx2+uqyyD8P2lW8edG/Qr+9UixfmlpxUcWA/EfBdEA=; b=C5okk/2h/PYzelStrrg1LlJD6H PFL4XQyJPu8wmhp4RD/vQSyyO3dxcR7s576We/DqijzVXbtvXKm0F8pkZhREvXqOUBmuVRRwz+VBu O3TPtfZFLWXONNV3ykiCW2uKmxkZMFt1dH7q+AQdM2WMlsJVR0SV1w1wPDAciS4sRPbsgoSREjofc sIqJ+DzxFRyRQULOEoCHj7kbZ6SR/RKbYV6qjzQ0fPxQ2v/Hho/IDt5dQBiAWkmO0DQX3cI5HAxUO PMqvRo+CCtsO1fWv7N6B+JNvt28+s7922wRldraWD3BRMiDAn9wR70S+VE5vJs8ORCbHhBhOgUvWJ EPO+LPxA==; Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liY2b-00DYze-BP for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 07:51:54 +0000 Received: by mail-wr1-x44a.google.com with SMTP id 4-20020adf80040000b029010cab735fdeso3432454wrk.14 for ; Mon, 17 May 2021 00:51:52 -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=Nkx2+uqyyD8P2lW8edG/Qr+9UixfmlpxUcWA/EfBdEA=; b=CY5x4+8QBxo0BZpimUxY5VJfeHy6Ixx5NSuD+hewnwytD0U97yW/gw9zn7SAJVxeeU NHVNBLKv6iKFXUfEhTuE3yGNDnTNEyKwS7mW493RDXckaESBAmfJ3XeYMu2FUJdfkI2A nP3J92PodrdD0C2Zkkaj5CA4suZ6UhCTcVHcTYtWzPJfhuF1/epWRy87kRKA6ye9SGOZ K/pPMqR7o5kDGBpxx1AYqOB66GYJOeLF1efQYx2LbLrJMFC3izCUVWTU+FRuX83DWUe/ 7TdxRDVDd3YAOGzVm/n+LYO3Jvt+rPWZjlwG9V+zpXFCojEnkwxb47nRue+UsEE3wjuY i+ug== 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=Nkx2+uqyyD8P2lW8edG/Qr+9UixfmlpxUcWA/EfBdEA=; b=V9hq37mPAcCA5WXT41+BP/zG3KxA53ADbnTAQQu/1wzRI8ii1OxK8txNHFMYjrO5jr 3OBKQ8yND3hcycCW9jOMy+veRGNNCOHjDjVOBK4vdwFmzQ+FQBbz3wTuGJln4/J6sW7U fskkpLg/xe2BQ/lBAN/C25DjuPCd0OjX3dNkxWaN4lC46ny5QQxNR4w9i4hXGehIw5Fm 51izVrUmrkhlylcsZDHBL1mup4dtZFwWAQMqvoQSUi3YxzJSivovPSEXQq5ca490LK+M D0no0mjzf9oB0ZPQKJdewCQtwT4Y9Uth+n4VLe92sX6dIdBRcLwzPleFiAjoyqsk/wEV XFJA== X-Gm-Message-State: AOAM532/cPW5R7YtFjZjKAUpGh6ewWEFAGd4V5Z7fo+waF5shXg3Ehjs Fsr9ijfBffbLtTQKEhojrYQJE5JJd4Fk0CyN5rETm14xj+dQo4LGe2b1gZBeFBii1gXOOiT772F XanBVAjdfAh3ocvFYofBjnJm3YQFuJww8O8hpgaZbl4nXdavORFi3AgJbiIBu3gspC8fwBapk1d eXeQ== X-Google-Smtp-Source: ABdhPJwqd+4kFVX+5QVCB3geG1h+B6qRmNo1yM6c1zwL/iUF32Sj/YoAfIKsaoitXoL+PXXErTLkLqY/PQ== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a5d:4536:: with SMTP id j22mr8174041wra.329.1621237911292; Mon, 17 May 2021 00:51:51 -0700 (PDT) Date: Mon, 17 May 2021 08:51:20 +0100 In-Reply-To: <20210517075124.152151-1-tabba@google.com> Message-Id: <20210517075124.152151-13-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 12/16] arm64: __clean_dcache_area_pop 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_005153_412323_CB2AA883 X-CRM114-Status: GOOD ( 13.88 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- arch/arm64/include/asm/cacheflush.h | 2 +- arch/arm64/lib/uaccess_flushcache.c | 4 ++-- arch/arm64/mm/cache.S | 9 ++++----- arch/arm64/mm/flush.c | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index 3255878d6f30..fa5641868d65 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -61,7 +61,7 @@ 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(unsigned long start, unsigned long end); -extern void __clean_dcache_area_pop(void *addr, size_t len); +extern void __clean_dcache_area_pop(unsigned long start, unsigned long end); extern void __clean_dcache_area_pou(void *addr, size_t len); 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/lib/uaccess_flushcache.c b/arch/arm64/lib/uaccess_flushcache.c index c83bb5a4aad2..62ea989effe8 100644 --- a/arch/arm64/lib/uaccess_flushcache.c +++ b/arch/arm64/lib/uaccess_flushcache.c @@ -15,7 +15,7 @@ void memcpy_flushcache(void *dst, const void *src, size_t cnt) * barrier to order the cache maintenance against the memcpy. */ memcpy(dst, src, cnt); - __clean_dcache_area_pop(dst, cnt); + __clean_dcache_area_pop((unsigned long)dst, (unsigned long)dst + cnt); } EXPORT_SYMBOL_GPL(memcpy_flushcache); @@ -33,6 +33,6 @@ unsigned long __copy_user_flushcache(void *to, const void __user *from, rc = raw_copy_from_user(to, from, n); /* See above */ - __clean_dcache_area_pop(to, n - rc); + __clean_dcache_area_pop((unsigned long)to, (unsigned long)to + n - rc); return rc; } diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index 38d62cef243f..8c0707167ab2 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -205,16 +205,15 @@ SYM_FUNC_END_PI(__clean_dcache_area_poc) SYM_FUNC_END(__dma_clean_area) /* - * __clean_dcache_area_pop(kaddr, size) + * __clean_dcache_area_pop(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 PoP. * - * - kaddr - kernel address - * - size - size in question + * - start - virtual start address of region + * - end - virtual end address of region */ 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 diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index 4e3505c2bea6..5aba7fe42d4b 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -82,7 +82,7 @@ void arch_wb_cache_pmem(void *addr, size_t size) { /* Ensure order against any prior non-cacheable writes */ dmb(osh); - __clean_dcache_area_pop(addr, size); + __clean_dcache_area_pop((unsigned long)addr, (unsigned long)addr + size); } EXPORT_SYMBOL_GPL(arch_wb_cache_pmem); -- 2.31.1.751.gd2f1c929bd-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel