From nobody Mon May 15 15:45:53 2023 X-Original-To: dev-commits-src-branches@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 4QKkH63FrNz4Blm9; Mon, 15 May 2023 15:45:54 +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 4QKkH56tH4z3JDF; Mon, 15 May 2023 15:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684165554; 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=+l8iewWuIMxcrDfbvm2U3WkaFQtaH79An1EisZY+EQk=; b=tZ1yId6LNXQG3ATtMezhy4vwLdgAAnilisqp5nZs+DHokN4oUqNvfKBNTYi+qFYQ8DwduO XlpCdzTwJiq1uOMnPDdJeJpQUvD2kIBp+AMGVkg+GrOyf6BUWmKz4XkuzOnH7AOQCmKNo3 s2z0L0ciHDnCK5n60pMCpY8VqUzqQzuxd55MSPwnPS0JegrSeatK9DED5eyldajJGaYqWE JC4F8Ylwz4NlHzT5oF/sYjIDPHcLkNXdsnIPl97bDxU19X2/g2otIhFoHvr4gL/1uCcLQY A1rKxBKdinRBeuxsswEH7gRSCNBmX8QqsweDXLU1DseVvXK3wJLg02WbbxueDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684165554; 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=+l8iewWuIMxcrDfbvm2U3WkaFQtaH79An1EisZY+EQk=; b=wbJ+OQeAyJ1fMrjpNDHyxu/Ndp78sngZ0QFNZgREuM8QXsaMCS4P2ZYDXiklWaCbE7jExp O8AS6Cdj0LgdWQhTy/Z52pc28NnyfjTQx4XhJRvxr67kGZn67cc1Tj8vkq3rcNHIHSRM5j 6QBfORJ9u0thU1TjOtFWWI0eTiqcfnkhr6NBp/J5r54Ls1hQikBo0tgmXRk4XsmJfmmbWf wDxg3cfcsLCFbHKFj/NuTUKwDCMEvmrx++PIU1qo4wMWXzCdgR1a1berv/Wjt+K4YcEG9U 4v/DN3+ti3E1J5ZjuSvPfrrueQenl4VzsalhKnlqJmCiLkslVjVtneA3lBLYmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684165554; a=rsa-sha256; cv=none; b=dGeBMCrrKL43r1vquSfncOFTb23Tx5TaYTv+kE+incpG+51UxzmbYv88BBn+7Rbs5NPux5 CJtGXRo6zOQniyz9SIqukRY0p4CT4cCHj6y/74PN/xNfYRNqd1ZcunaOxdy/fHsonkjrV7 nfoFEK3x6ICkoP03ndEhLrU/g5pAtboa7ffyo+hJ4anMQfh/A4Y0d73GaAnhS9LMZ/OohU KjaFKh1iaOAAQUBCjHUkWM3N4KcF80cy+UuXNYAiilDYh51tdHSrpHsE9CEsBiTvbEsPDE IO7jr2OCSKutF5r6qvvgG9haCDbC9gOMDKg7QexAhOdktNLQJPYkBqv1MQ5p9w== 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 4QKkH55xJhzmTb; Mon, 15 May 2023 15:45:53 +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 34FFjr5v073351; Mon, 15 May 2023 15:45:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34FFjrFN073350; Mon, 15 May 2023 15:45:53 GMT (envelope-from git) Date: Mon, 15 May 2023 15:45:53 GMT Message-Id: <202305151545.34FFjrFN073350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ed88e5b2fc75 - stable/13 - Limit where we disable the Arm generic timer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed88e5b2fc75f18085ba7c3f1ccac3dc1c9381ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ed88e5b2fc75f18085ba7c3f1ccac3dc1c9381ce commit ed88e5b2fc75f18085ba7c3f1ccac3dc1c9381ce Author: Andrew Turner AuthorDate: 2023-02-02 16:26:25 +0000 Commit: Andrew Turner CommitDate: 2023-05-15 07:59:43 +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 (cherry picked from commit 22e4897422a055b7a15be5984fbc4bb97f432e79) --- 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 5b4972017c2d..cdc60ba469a4 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 - #ifdef FDT #include #include @@ -134,11 +132,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 @@ -475,8 +475,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;