From nobody Thu Feb 02 16:48:27 2023 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 4P74VM68MLz3kLWd; Thu, 2 Feb 2023 16:48:27 +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 4P74VM2XLkz3nfl; Thu, 2 Feb 2023 16:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675356507; 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=XVfRNZZwSnCka6C7/hzdys9LP+xyAbL1aTUihPikoSQ=; b=y2Ci52Ngmn+5Q5nZi1HNmNpxJfntPOacaDTZHhlckUsOvRqfK+GU5CD9AB8tRQinIpu1ly DhZyOSi1hnX7W2Lb6JeTI1YhVlvKw+lw2MHq7paA6uAYW7tgXPTs9sDnXIPmjRgkyIva67 eaiFuau++lkupZcSSNHIuYE0BdETSLSEXhUTANsiebj8X1SCrq1RByPVqDuykGzCauPchW 7/t4fQrkaNLr4+mbS6CwRfKjXm8NxVk4xxSrA/AO6CC4a6e1FyJcDOP+jS45N4tT59idqM ALi0Qymca9A2E6wIAqKUsVk+6xbT2LeJ/lDYlE4UegNKRDk/kskW4s8e1lSzog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675356507; 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=XVfRNZZwSnCka6C7/hzdys9LP+xyAbL1aTUihPikoSQ=; b=iPm2XT2IP+ua/K61DnDjz7mtpKfaRdW+e/2Zj5eGE5dtflZsN2jnioc6I0zNymSaOBNX6n KQr6haIv2P+Yhr1LZwR6wfOMKe5WzsA1Rl6Y7SlUkg9iZ3GAaAfCCWTvDqU62YvcVmy6Pp OIt0nAMNmddcDdHeh/bt2P1HQoux3bpFl/GDaACr0WSMWA4Zv7v3JoLVPRXu1JCY/iFKGv Taa7QHc8WrWHkPEX4H2EiAl8ADQzU7dCTnz+1N1/y4shQr7cRBan8ntaODxDyPmDAH3TVt AVJmnUcHOv3OE5jH0BJOlH7uEww/zv6QHMU+iEgSQDbZ1TJkP7pQw7CzsNSFNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675356507; a=rsa-sha256; cv=none; b=iEULFzdYWfwr8uyHBAoi5Mp27rs0NCvqXtk5iVcbe/nykc1mR+4U+0rs+2R2w8FYNk84dX 0z6VGG7zZwGjaDcaYff+FdK99+crRhTYFQHh4AotU9nyr15GY4X6bsJ7bFyuwLEB0TObBL kEwrA51FkiCy6PB3yk7dJ5IpY3MG/mx4tl1PHPgXUxTJqB2lytRGKkdg+m0HlHVY3y0jxm hFqCdzdbEraSgY7Lj+uw0M4UuJyepEjJfah8yWNkPUNN+I2nhgCGzKsF/HUeyZrNi9JDmr hZkPhYLtemOj6whm6nQqurxO28vjpu5JvUPmSZNm3TpMZKfj5Bn0Gfotf/sdMw== 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 4P74VM191sz124X; Thu, 2 Feb 2023 16:48:27 +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 312GmRJx049724; Thu, 2 Feb 2023 16:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 312GmRfB049723; Thu, 2 Feb 2023 16:48:27 GMT (envelope-from git) Date: Thu, 2 Feb 2023 16:48:27 GMT Message-Id: <202302021648.312GmRfB049723@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: 22e4897422a0 - main - Limit where we disable the Arm generic timer 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: 22e4897422a055b7a15be5984fbc4bb97f432e79 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=22e4897422a055b7a15be5984fbc4bb97f432e79 commit 22e4897422a055b7a15be5984fbc4bb97f432e79 Author: Andrew Turner AuthorDate: 2023-02-02 16:26:25 +0000 Commit: Andrew Turner CommitDate: 2023-02-02 16:43:15 +0000 Limit where we disable the Arm generic timer Only disable the Arm generic timer on arm64 when entering the kernel through EL2. There is no guarantee it will be enabled if we are running under a hypervisor. Sponsored by: Arm Ltd --- sys/arm/arm/generic_timer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 0556643032c2..b19248327683 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -54,15 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include +#include #include -#if defined(__arm__) -#include /* For arm_set_delay */ -#endif - #if defined(__aarch64__) #include #endif @@ -138,11 +136,13 @@ static struct timecounter arm_tmr_timecount = { #define get_el1(x) cp15_## x ##_get() #define set_el0(x, val) cp15_## x ##_set(val) #define set_el1(x, val) cp15_## x ##_set(val) +#define HAS_PHYS true #else /* __aarch64__ */ #define get_el0(x) READ_SPECIALREG(x ##_el0) #define get_el1(x) READ_SPECIALREG(x ##_el1) #define set_el0(x, val) WRITE_SPECIALREG(x ##_el0, val) #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) +#define HAS_PHYS has_hyp() #endif static int @@ -521,8 +521,8 @@ arm_tmr_attach(device_t dev) if (sc->res[GT_VIRT] != NULL) arm_tmr_disable(false); /* And the physical */ - if (sc->res[GT_PHYS_SECURE] != NULL || - sc->res[GT_PHYS_NONSECURE] != NULL) + if ((sc->res[GT_PHYS_SECURE] != NULL || + sc->res[GT_PHYS_NONSECURE] != NULL) && HAS_PHYS) arm_tmr_disable(true); arm_tmr_timecount.tc_frequency = sc->clkfreq;