From nobody Wed Dec 29 23:06:24 2021 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 49421191FC9C; Wed, 29 Dec 2021 23:06:25 +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 4JPRq432xKz3kKK; Wed, 29 Dec 2021 23:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 408FF5827; Wed, 29 Dec 2021 23:06:24 +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 1BTN6OB1090236; Wed, 29 Dec 2021 23:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTN6OhD090235; Wed, 29 Dec 2021 23:06:24 GMT (envelope-from git) Date: Wed, 29 Dec 2021 23:06:24 GMT Message-Id: <202112292306.1BTN6OhD090235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c2de5317816e - stable/13 - MFC: arm64 fixes for TSLOG 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2de5317816e10e1730ca0283f80ca710eade3ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640819184; 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=aTTar+F00U4eH2pIXEKvS0BbdSUWvgcJ1+Pc8UxpIWc=; b=TniPV6ynVCSUBybIMLfW42pJQ/ABIcRSYrPRayZm1bSO5LthYHoClFJbNj6F4vbW1i0Ret n2Ljk9m0OCZlV0i9JwR0ez+XAYOt8yD0dZTtYYUb/C+UMK7hacuGyJ5GHtJX82PfbCcl49 KgUrWeC0CAzhY5fO/UlDU4DXq6oolXSDBOBlYigGo6ZiBdXKgeS5Hfof2DOrL/kizjWVDH fWN+7ON8JUd3ra5YH4Flff/JEMR/xhBF3whwV2PShbhLAJ9kiwVDXHuR1JDby11qDl4s2E HJqmgTz4SZRDHTrA8AEgwx2cqbT4wgoZ+iuNT9eaFRbebCgpH4MaskNfj9NjVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640819184; a=rsa-sha256; cv=none; b=Dxesx/qNI8cA5fJXUQC4wKay18hjaipRHUFmn05nywLgTuolmqltgtgeiW+4hSbvZQm/3Y kE+CCMc34R6EZcnDKQODlg4KFPwbd6PzTwtrZZo17pHz+CqvsqjHolyUkuGW8B3yYT/6YZ XKM7GZUjHut9V4tnlwosmQi9vby8jrEOxDiu5qs5kK8I4kb9Yu5MV4613ExPi0kSdkf6zl w3ai4r6mNKErRLYAXc7tqme3LOvjU4b3w6Gfysz5CkP1vzoUVxKVhIkcdE1p3TsxvmFDa5 MbPxq9V49lUPmf5jHx/e/mLMRNvLQkJOr1mlB5RwmXeZ0VNlb61f8hwULhhOpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c2de5317816e10e1730ca0283f80ca710eade3ea commit c2de5317816e10e1730ca0283f80ca710eade3ea Author: Colin Percival AuthorDate: 2021-06-24 05:10:26 +0000 Commit: Colin Percival CommitDate: 2021-12-29 22:53:18 +0000 MFC: arm64 fixes for TSLOG arm64: Disable early printf if TSLOG arm64: Instrument initarm with TSLOG libsa: Add tslog support for arm64 Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 0acc529dc35f88836dbcbe75940954c75595b058) (cherry picked from commit ccadcb8f3343562f22a426e845dba640319d4355) (cherry picked from commit e6caac717b4fc2b87cf93f67109884e768253e77) --- stand/libsa/tslog.c | 6 ++++++ sys/arm64/arm64/machdep.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/stand/libsa/tslog.c b/stand/libsa/tslog.c index 7ea18e0bb8f8..c6164aab02a9 100644 --- a/stand/libsa/tslog.c +++ b/stand/libsa/tslog.c @@ -29,7 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#if defined(__amd64__) || defined(__i386__) #include +#elif defined(__aarch64__) +#include +#endif #include @@ -60,6 +64,8 @@ tslog(const char * type, const char * f, const char * s) { #if defined(__amd64__) || defined(__i386__) uint64_t tsc = rdtsc(); +#elif defined(__aarch64__) + uint64_t tsc = READ_SPECIALREG(cntvct_el0); #else uint64_t tsc = 0; #endif diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 3ea7e850d70e..67f6f66241f8 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -557,7 +557,9 @@ try_load_dtb(caddr_t kmdp) #endif if (dtbp == (vm_offset_t)NULL) { +#ifndef TSLOG printf("ERROR loading DTB\n"); +#endif return; } @@ -707,6 +709,8 @@ initarm(struct arm64_bootparams *abp) caddr_t kmdp; bool valid; + TSRAW(&thread0, TS_ENTER, __func__, NULL); + boot_el = abp->boot_el; /* Parse loader or FDT boot parametes. Determine last used address. */ @@ -838,6 +842,8 @@ initarm(struct arm64_bootparams *abp) } early_boot = 0; + + TSEXIT(); } void