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, 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 F3E5EC433ED for ; Thu, 20 May 2021 12:50:10 +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 831BC61184 for ; Thu, 20 May 2021 12:50:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 831BC61184 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=QwfZd9zlAYxs1wAMFY6BH3czrDAg1bRXf1oNO3/inns=; b=nqBlCIZm5hWKqW d0TnCIYqda3ZUJGzEsYEtABaZKW27Ec2ca7CBKicteThVOfr+BOOI1/IpnaR7FKdE6+8NISva4JLY FWZFOUc3AY4qqBbqPzAdZP0xIcWehJ13yCBb47DWUHvczkoXqbi/oGY+AUYkdPh4J7IMcbQRWo8Dv Sv2LTV7MkxdGd60iJbRKOeafZNZe2jMWWsXL1Z9TboXafFqijo63f6YRVZyLBA8P1jYwwfNDteBLZ 3YKtkzcP9KfJpQR7xymo+leZ19YDi5Jyi37vxAwLlF4IrQnI38Q4zhoSEU7PcpFbpWfQWPCQje0bO 2aEfujbo43QeoCo9/1yQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji6H-000wmZ-5u; Thu, 20 May 2021 12:48:29 +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 1lji2W-000u2L-PS for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:44:36 +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=HdRq0+Koen2r2SBcAtNy4/l729eFX5JygRHHNxjltB4=; b=SJCgzoGjhkyXrjvVm2bxs4+D22 t1/rb6te93i4VKQ8/7QlyR05UzvcbvXZTUdYS16HnJYWECyjuhiDcQUk3DDxGZAJVXFKThbXm+QB7 IbTn5FSHVtTnkD1hrsxc9uWeRGV1VlCe88AXKRRL06pK5aqdir9693T4Sjh8opjrs5en4855NnbPE I0atPvR648MBd877Y6pagqTsglMe4KGZWeLIf/Azo4DsSdTUsUlXKSoxBq9VNBxFapokpsCs9kgao lCdrDYILTnl3ZwI1Yjq/dZuzOpdloJ8eAMGVN8oyoIDBN9mgUfot50wi5QVRkBu4svKvs5cmOfmgw FBzrRJxA==; Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lji2U-00GKfm-5r for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:44:35 +0000 Received: by mail-qt1-x84a.google.com with SMTP id f17-20020ac87f110000b02901e117339ea7so12143386qtk.16 for ; Thu, 20 May 2021 05:44:33 -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=HdRq0+Koen2r2SBcAtNy4/l729eFX5JygRHHNxjltB4=; b=VLI+9tIRb4ANmxfC7nRnMfk3OayhlBKmYzGuOSw+ps1MDk4cyuGBeg+2DL+zCTM0Rk jC8xFZY6326rYZQQxfbJpfl5ZIz9Sye4viO26kB1imJ3rjWCgMPAPurwkcNiBVe5eh9A QKfF0K9mcl17xz933lYGok0XcQyI6NWwWztQTtGnMyH6aVXHrwM8D8b2GcUsMhvY3O4A dG+kujthMNG3dHPk7X25x7ZVwMSAfdO9ahuIo316Ennx6NnPc9L/WQJxDJ9Wz2+YwSEv 39hcgdXQn6/M6cqQLMqt0ci0M4rDz/+zrp010vioBxEBvkZTJKHTsRDRrw27RfsXaGoP c+Xw== 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=HdRq0+Koen2r2SBcAtNy4/l729eFX5JygRHHNxjltB4=; b=qGttxKa+ySIUuPkHgN3FtU2EG/ymGabI2pQzkFlNK5SFy2vGoRF8yY9ijxMkeTucKR lq6otSIWUNllsU6506GMqcHQ4Y58vC/RxCva1cnabYHeioRzTdLFRIlxa1HxrlB85KY1 HSZ7Jq1relvOOpCIf9h5KM2IvctngY+crEKyyY/3jL1W8BRvr4Kj7XkBwvIRopJGoGGx 6Rnl1Ri582ft6s9zDJZ2/73Uzz91kbGXnXwsWZRuCLHYlPgaoMkWinVW2IpcO+ZK96/2 NGEye/dmb7FNbgBBc5fIy8+VWWmL82doKeFElQUOT9cEe3SZNr9/TVnnYkRAbBL/tN5n TN0g== X-Gm-Message-State: AOAM5336lbVItZC/lCB12P1iyks881bpOCIEpCskkst9QULrSVQ2Xbn0 y0fqp3HzI5nGHPWGLzlPDR5qOp9qj9QbOOBfhB366jeSpQS0aKoNp1ni9cBiNz7wHlcgRZ8uYx2 pjxU4ShFi5DXhbH0srrEQrspZPu8kh3uT8Iv7uCQoe0Jj2rrlQK/L2+vOe27p+0RJq7/UuFIe2S wEuw== X-Google-Smtp-Source: ABdhPJxDAauvjmH4N4dCsdfn0/reqlRL/1mb6t7+vpXZbo6/dbwMzyeJFYDOTVteDevUYwfh0ClnQPPIHA== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:ad4:4f21:: with SMTP id fc1mr5229991qvb.16.1621514671611; Thu, 20 May 2021 05:44:31 -0700 (PDT) Date: Thu, 20 May 2021 13:43:59 +0100 In-Reply-To: <20210520124406.2731873-1-tabba@google.com> Message-Id: <20210520124406.2731873-12-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 11/18] 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, robin.murphy@arm.com, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_054434_240274_941562C8 X-CRM114-Status: GOOD ( 13.53 ) 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/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 ced791124b28..c4cecf85dccf 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -397,40 +397,39 @@ alternative_endif /* * Macro to perform a data cache maintenance for the interval - * [addr, addr + size) + * [start, end) * * op: operation passed to dc instruction * domain: domain used in dsb instruciton - * addr: starting virtual address of the region - * size: size of the region + * start: starting virtual address of the region + * end: end virtual address of the region * fixup: optional label to branch to on user fault - * Corrupts: addr, size, tmp1, tmp2 + * Corrupts: start, end, tmp1, tmp2 */ - .macro dcache_by_line_op op, domain, addr, size, tmp1, tmp2, fixup + .macro dcache_by_line_op op, domain, start, end, tmp1, tmp2, fixup dcache_line_size \tmp1, \tmp2 - add \size, \addr, \size sub \tmp2, \tmp1, #1 - bic \addr, \addr, \tmp2 + bic \start, \start, \tmp2 .Ldcache_op\@: .ifc \op, cvau - __dcache_op_workaround_clean_cache \op, \addr + __dcache_op_workaround_clean_cache \op, \start .else .ifc \op, cvac - __dcache_op_workaround_clean_cache \op, \addr + __dcache_op_workaround_clean_cache \op, \start .else .ifc \op, cvap - sys 3, c7, c12, 1, \addr // dc cvap + sys 3, c7, c12, 1, \start // dc cvap .else .ifc \op, cvadp - sys 3, c7, c13, 1, \addr // dc cvadp + sys 3, c7, c13, 1, \start // dc cvadp .else - dc \op, \addr + dc \op, \start .endif .endif .endif .endif - add \addr, \addr, \tmp1 - cmp \addr, \size + add \start, \start, \tmp1 + cmp \start, \end b.lo .Ldcache_op\@ dsb \domain 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 5170d9ab450a..3b5461a32b85 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S @@ -115,6 +115,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) @@ -133,6 +134,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) @@ -194,6 +196,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) @@ -212,6 +215,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) @@ -225,6 +229,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) -- 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