From nobody Thu Aug 25 11:17:40 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MD0n05t0Mz4ZHsc; Thu, 25 Aug 2022 11:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MD0n04KVGz3xFn; Thu, 25 Aug 2022 11:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661426260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifrbzBqag3HGeOfBl3GkvBK+w2r1X27cpKsP0EEbfYQ=; b=PKs1SyLFt1vNB/j8pHlvMf75EcQYdqWCFSOpvY4OjOEcFN/kCmqAOAnAMJVrrxF4imAs4Y RtdgXXbGbIb/qXK5WzE2YyA9OdQW5Gb7d83ZH9dD3V+/rDKh0gt9zJjajazk2IN9f9AvJq CjZYLMqjYEN8XhpqfjhnDvVufp2c/486JfPUrmrA8S17OTIxGHlSUYhsXLvNgHcJ2DrZf5 cQ+O2PtikXd2f6KAbb1oJUPe5pTP/YTViLQfVJ/ICzVLljmw2yedw/QcWcDvP4RUnVylS0 cAxc6tZium1rKt4ozb4Jg2IpBXhnc8GTLosaSM1T852Btrmx3ecN28FLD3qcVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MD0n02s2Pzm5F; Thu, 25 Aug 2022 11:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27PBHecx010600; Thu, 25 Aug 2022 11:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27PBHe07010599; Thu, 25 Aug 2022 11:17:40 GMT (envelope-from git) Date: Thu, 25 Aug 2022 11:17:40 GMT Message-Id: <202208251117.27PBHe07010599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7a060a8895b8 - main - Add an IDC only arm64 icache sync function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a060a8895b8e6c1cd0afded15da27c373eb0de9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661426260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifrbzBqag3HGeOfBl3GkvBK+w2r1X27cpKsP0EEbfYQ=; b=RYL8/Ok3J5S4HitkRyDUM+t8unQa58sazuL0LxLoLGSOOhFh9XYbKmcVG9vvNdbCOGSgsn QNCA8wu0wb2Hb12NB3DnKC52jk2hhx6UUs/umHxWBmuhrYRQYLUtpkAgFJnqD2cPicDk7n NLi4i3+/AW2pMPyF2CYYf04cV5K41qzbe0BJ14mZgYRZZ/kc2bratavxeblkdmUhEvAtn9 V0YSncmYEi0oGhHUTO1aO9ZwT5FoM+Ug84a47j6bgNk07E1dAf0C9hQMBOW2zv15ne/f0l HlYv8e/t4iRTFgra6eoYTgNZVFPDgMtWMP1lVenCMJ68p34Dkflss9lBGxKjIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661426260; a=rsa-sha256; cv=none; b=hJrEcvyaf6FGO7Ohwv9Z/fhh3TaQKRkPVGrYUfgUHHgYYtLcrXKcfGF9o3LyFmYTuCLygx i2MewsTKFe7Ip1E73/TzsCJQK+nVIoekVqCb1AZfCxJ3sr7BCBhHHF/SM124lzbxfEHKLs 9C2n1/wiMtNzf+Y/ps9mtglWZqw5mM6bxDgbpoV99PvvVABi1iVhazQLzMjzoF738nSY7M zUD0zH58/SVFFSVMM1BvJJak6yt9mB9ySdMKJqpi19RX+C299iu/1ZjMrXS4RfjXamzwt5 QcaaF1Chr1yDc9soKHHnXwITs6i+4Z9fvRKCoTvqnaInWMFb9hy/xj7/NDVJIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7a060a8895b8e6c1cd0afded15da27c373eb0de9 commit 7a060a8895b8e6c1cd0afded15da27c373eb0de9 Author: Andrew Turner AuthorDate: 2022-08-22 17:02:13 +0000 Commit: Andrew Turner CommitDate: 2022-08-25 11:17:28 +0000 Add an IDC only arm64 icache sync function When the IDC flag is set in the cache type register we don't need to clean the data cache to the point of unification. Previously we supported this flag being set only when the DIC flags was also set. Add a new handler for when this is not the case. Reviewed by: kib Sponsored by: The FreeBSD Foundation, Ampere (hardware) Differential Revision: https://reviews.freebsd.org/D36296 --- sys/arm64/arm64/cpufunc_asm.S | 12 ++++++++++++ sys/arm64/arm64/identcpu.c | 4 ++++ sys/arm64/include/cpufunc.h | 1 + 3 files changed, 17 insertions(+) diff --git a/sys/arm64/arm64/cpufunc_asm.S b/sys/arm64/arm64/cpufunc_asm.S index 2f28c4f68271..927bcafcf1e1 100644 --- a/sys/arm64/arm64/cpufunc_asm.S +++ b/sys/arm64/arm64/cpufunc_asm.S @@ -143,6 +143,18 @@ ENTRY(arm64_dic_idc_icache_sync_range) ret END(arm64_dic_idc_icache_sync_range) +/* + * void arm64_idc_aliasing_icache_sync_range(vm_offset_t, vm_size_t) + * When the CTR_EL0.IDC bit is set cleaning to PoU becomes a dsb. + */ +ENTRY(arm64_idc_aliasing_icache_sync_range) + dsb ishst + ic ialluis + dsb ish + isb + ret +END(arm64_idc_aliasing_icache_sync_range) + /* * void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t) */ diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index ef9bf022f491..ba8da5d48fee 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1849,6 +1849,10 @@ identify_cpu_sysinit(void *dummy __unused) arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; if (bootverbose) printf("Enabling DIC & IDC ICache sync\n"); + } else if (idc) { + arm64_icache_sync_range = &arm64_idc_aliasing_icache_sync_range; + if (bootverbose) + printf("Enabling IDC ICache sync\n"); } if ((elf_hwcap & HWCAP_ATOMICS) != 0) { diff --git a/sys/arm64/include/cpufunc.h b/sys/arm64/include/cpufunc.h index 16133903841f..691474bac90e 100644 --- a/sys/arm64/include/cpufunc.h +++ b/sys/arm64/include/cpufunc.h @@ -241,6 +241,7 @@ extern void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t); void arm64_nullop(void); void arm64_tlb_flushID(void); void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t); +void arm64_idc_aliasing_icache_sync_range(vm_offset_t, vm_size_t); void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t);