From patchwork Tue May 11 14:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12251269 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.4 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 433CBC433ED for ; Tue, 11 May 2021 14:46: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 A7C9461396 for ; Tue, 11 May 2021 14:46:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7C9461396 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=xj3PpF/r1LL6iy8749qPHrLHwnrUQe4VcDEHRlneEUQ=; b=Tf/yE51yEdsqeo xzwAkK4NLQs10EXjYVEX1YoCVmpV5+QtafSpRaLR3R7lRD0lYtC6h/dMU2rxENaDOValTltrnQEwH Rm1TBp3hbXVa2asw4hJ3euWsXi23oeia4y/8Y25NWkUNVL9rst/B6nF0zUu1XKITh315ani78zNvL CqbyQBTkGfHSpzZAP2VTYWqq5IVKSP8SRbGkdZcbl6agqM2qf3wbq19/hS20dOPN7Ms49DlJGvniz f1ZDmUEhKBfCR512L9Qt4sewcfvVWBJZuOOskhBwFDaMvkkv8JU/3tgF3x+SUDwz+IF8pdbmqL6nn uyQ6fDdEznVbIA8CJwTw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgTcS-000TYW-Hf; Tue, 11 May 2021 14:44:20 +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 1lgTbN-000TFs-5o for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 14:43:13 +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=MbwhDKk5EA11jKAulpTBnY/IRT4L9GaSTz51nKVhpbI=; b=tXMQBrBHB2NtQo7tVmZcXHpPj8 mrUXhYv0RFo1CAKGGuHZ+tzXrymHTJOU6Hz7PaiQXM6hlfnqiKHnTEBbowMl46oL5yFY6T9F4mF5v dHfhzvO5BeYf1eI63zfdqtx5jvW3W+FH0cGSX7uy8OKW83aqjUH8hBJRncQU3QblmIoWNOPLhiD+N cDyiVUeU5vDU7nEF/FT4GXPGKKcsUl8d3NSBLqpywbPzxfA6FNPhMIntHxmwk0AOAp04LC9N3QWl4 MMiIoM9w6Izevdz+rj9tC4qeeCR07jmNfLb5JujFVKRY7Umvc6lPAqgDGOZvWz6rNJs8TVqBlFTGB XqvncZMA==; Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgTbK-009gVo-FJ for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 14:43:11 +0000 Received: by mail-wr1-x449.google.com with SMTP id x10-20020adfc18a0000b029010d83c83f2aso8861870wre.8 for ; Tue, 11 May 2021 07:43:08 -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=MbwhDKk5EA11jKAulpTBnY/IRT4L9GaSTz51nKVhpbI=; b=m/TLs69EaPBriQhil/U1MOAulA4IV0+IjRupBWBrMDt6T/OakQJ+488JHc+2r3yRYY IsMLPkz1jNw3xgblKVTDNOir7J+3TuwyIAlqTwNZuX5aIzFHhpGRCPzGFjgRRWNbYJct wQdBjOmj7xwpQtP3TD1b9lbBswfMUKhMLKv7DrUulaSNZa4OZZMVxxH1n1KTodhuLMNh lTO8c0TeSTqzS9sCug0ec8w2RXawRfziK+bZf4u3S/L1y/J6umcJ5S1fyr3lQPd+3Eco ++JV47wT/23dpdRiyQppGPzAdI0K7ZSHrKSp4MRwygs1kqRkUYgjK/lYdYBgITtNnh92 CT3Q== 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=MbwhDKk5EA11jKAulpTBnY/IRT4L9GaSTz51nKVhpbI=; b=tSV3exRsFoLZe4S9qQdoOGjnI9MtjGh2ek2P/27W3xPmzbd1w/XwtIqqiTztDAeslv /RPyymbEZDcCy8RFr3dffKOOAz9ciYhX2GsUn0pW4vsps6rLhcWTVgHcjxgFf7Y8U5Ab ggfClBhwP/vtufvCIZ/1LkWtvKavOa/XdbTTD0aAEYneQ2TiBG9Dlvdlg64i2Q0eR3uu s/65Bvl/slXwjAmMudHIvO2Feys6d+vF4FcWGPHEJHE8SZcuYWL8V2y+DeNkdtQeO8SC d0XHwpGkuVUknEn8TdgvHcILxksvyMDb9/Df+tt5bNeqd9zfdkiURs12C64RMcB1rIE8 13iQ== X-Gm-Message-State: AOAM530/1p4rYJIXRccqO+b2igPSFZJLV2yXyZw6TFvx4ccBYcs6QAHw cxSYXzl/gK1/N2738rWstL/LdM+hsDVKWZqBBCZ9H6KNc9Py7zUeYuzRvxigTG2EgdNdkCIVIXR 0XhJdFRYgF5BAaCH9gGD3Byzi7bGmhMYSNaU5Vi5L4HrVEZW+73uRq2Xjd9RXiyECedzkafSZsn fTpw== X-Google-Smtp-Source: ABdhPJz+5MbONf+W6LytZA7RcQzCraMaDlxaDgamS5lHWzpfTyL79FYkofomvDIcMyWHXg795hDnboP0WA== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:600c:4ba3:: with SMTP id e35mr32614634wmp.47.1620744187730; Tue, 11 May 2021 07:43:07 -0700 (PDT) Date: Tue, 11 May 2021 15:42:45 +0100 In-Reply-To: <20210511144252.3779113-1-tabba@google.com> Message-Id: <20210511144252.3779113-7-tabba@google.com> Mime-Version: 1.0 References: <20210511144252.3779113-1-tabba@google.com> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog Subject: [PATCH v1 06/13] arm64: dcache_by_line_op 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, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_074310_533320_B7869680 X-CRM114-Status: GOOD ( 12.49 ) 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 --- arch/arm64/include/asm/assembler.h | 27 +++++++++++++-------------- arch/arm64/kvm/hyp/nvhe/cache.S | 1 + arch/arm64/mm/cache.S | 5 +++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 2bcfc5fdfafd..3f75a600e6c0 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -385,39 +385,38 @@ alternative_endif /* * Macro to perform a data cache maintenance for the interval - * [kaddr, kaddr + size) + * [start, end) * * op: operation passed to dc instruction * domain: domain used in dsb instruciton - * kaddr: starting virtual address of the region - * size: size of the region - * Corrupts: kaddr, size, tmp1, tmp2 + * start: starting virtual address of the region + * end: end virtual address of the region + * Corrupts: start, end, tmp1, tmp2 */ - .macro dcache_by_line_op op, domain, kaddr, size, tmp1, tmp2 + .macro dcache_by_line_op op, domain, start, end, tmp1, tmp2 dcache_line_size \tmp1, \tmp2 - add \size, \kaddr, \size sub \tmp2, \tmp1, #1 - bic \kaddr, \kaddr, \tmp2 + bic \start, \start, \tmp2 9998: .ifc \op, cvau - __dcache_op_workaround_clean_cache \op, \kaddr + __dcache_op_workaround_clean_cache \op, \start .else .ifc \op, cvac - __dcache_op_workaround_clean_cache \op, \kaddr + __dcache_op_workaround_clean_cache \op, \start .else .ifc \op, cvap - sys 3, c7, c12, 1, \kaddr // dc cvap + sys 3, c7, c12, 1, \start // dc cvap .else .ifc \op, cvadp - sys 3, c7, c13, 1, \kaddr // dc cvadp + sys 3, c7, c13, 1, \start // dc cvadp .else - dc \op, \kaddr + dc \op, \start .endif .endif .endif .endif - add \kaddr, \kaddr, \tmp1 - cmp \kaddr, \size + add \start, \start, \tmp1 + cmp \start, \end b.lo 9998b dsb \domain .endm diff --git a/arch/arm64/kvm/hyp/nvhe/cache.S b/arch/arm64/kvm/hyp/nvhe/cache.S index 36cef6915428..3bcfa3cac46f 100644 --- a/arch/arm64/kvm/hyp/nvhe/cache.S +++ b/arch/arm64/kvm/hyp/nvhe/cache.S @@ -8,6 +8,7 @@ #include SYM_FUNC_START_PI(__flush_dcache_area) + add x1, x0, x1 dcache_by_line_op civac, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__flush_dcache_area) diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index 64507944b461..c801ebaf418f 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -123,6 +123,7 @@ SYM_FUNC_END(invalidate_icache_range) * - size - size in question */ SYM_FUNC_START_PI(__flush_dcache_area) + add x1, x0, x1 dcache_by_line_op civac, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__flush_dcache_area) @@ -141,6 +142,7 @@ 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) @@ -202,6 +204,7 @@ SYM_FUNC_START_PI(__clean_dcache_area_poc) * - start - virtual start address of region * - size - size in question */ + add x1, x0, x1 dcache_by_line_op cvac, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__clean_dcache_area_poc) @@ -220,6 +223,7 @@ SYM_FUNC_START_PI(__clean_dcache_area_pop) 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) @@ -233,6 +237,7 @@ SYM_FUNC_END_PI(__clean_dcache_area_pop) * - size - size in question */ SYM_FUNC_START_PI(__dma_flush_area) + add x1, x0, x1 dcache_by_line_op civac, sy, x0, x1, x2, x3 ret SYM_FUNC_END_PI(__dma_flush_area)