From nobody Mon Sep 25 14:19:52 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 4RvQ4S4X0gz4rP41; Mon, 25 Sep 2023 14:19:52 +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 4RvQ4S42YXz4Rk0; Mon, 25 Sep 2023 14:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695651592; 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=ueHdk98jqkfrFWK1VnFz4Sa08NZEv/3vNx6F/zFFoaM=; b=ehwj8ynSA5IfvTHk3aG9An15eFkP6TaX8VtFI3mR9UL5AsSl0YsifEYxAwsWvsczrIKy4N slf492d+b8uAPhY1NL8ctNVKFs7pt93pp7Fd/+0/UkyS1z/kVWzQd34k5gEWPxJgs9r7I8 sRV6SP9FTWwborMn4L7sVnot9KaMEYVWPEUB5MxHs3mZqWEK82GcsKFzX8DZTbGFhMueV1 qtAL7tHAf2d3rg5CFKu7QZkn1rl0SCJeyShmPNfiP1fOSkgZYhBOgBqSjYA9Rtaijh+a1l eR5or+lwhEwbkmCDzW/IpvNRXst8CXVhQu2h99hfpOcLVhti5e/JZFeJ/0W/4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695651592; a=rsa-sha256; cv=none; b=FE2hkxUzTyGHWK52xWa9PfCqIKZ5eVdv4xeMlhPRdqIL/uwipscn0DXBkukSsEF0IG56Dl hvTxr+jvAhtPPUFBLaEyE+yMp9ukYHkHGgfAX5HPHUdWRLq5yON4j+q5yc+SMBvTHrA3h9 WvkkL3+YXs0WE7EJx3oa0CObfyNlLMIy33DbEXXOrbRYxJdyBkwx6wdz1a1aeUXrooR3ip f5uTR7ylh/WZPlJiEMDTBolrgBjNqDjEVimdy6oHwTrIYTx/DYYEpZrYw7YRCx20UgW1eb bXSRTtG164iWdh9omHTcwz0ckawKvdeFTClKYJERroJwUytyVhYtneTn/y2FbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695651592; 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=ueHdk98jqkfrFWK1VnFz4Sa08NZEv/3vNx6F/zFFoaM=; b=ynCOzsnfOo9DlkQGMRAwY4nFQMoSybFW/jHwArVlB7RYSCc3rH1ESnYBR3DzsUsOjMzrYB 0RFu+hDzGV0KphcA6N4u/OskF9eqNQdyEHI61yoQZ4xrUgcSTOdRuC/Q+gwr8gmbmJhJdR x0ZWW0bO1MUnqM9v7Wq6goZoS8mDg7XryU/R7d4eninKefnkFpPq3kXkdv0OGIFyFfVr/4 Kr2wYjrbswt8L1KkSAlThh1yy3touOPHsW4tENLjx5pDlxnwhnVLU4i8398zKVbAvYcHqp 5OCrs6w2K7U6xevow+etu+5uMTcjUbBV5WAFcLMX/vHXtlMKZRleNvJ6qfYVzQ== 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 4RvQ4S3484z2TG; Mon, 25 Sep 2023 14:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38PEJq2f078579; Mon, 25 Sep 2023 14:19:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38PEJqf7078576; Mon, 25 Sep 2023 14:19:52 GMT (envelope-from git) Date: Mon, 25 Sep 2023 14:19:52 GMT Message-Id: <202309251419.38PEJqf7078576@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: 82ddab0e8f9d - main - arm: Don't advertise the virtual timer on arm 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: 82ddab0e8f9d5d0e4e8fdd2a7a17cd87e464f55b Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=82ddab0e8f9d5d0e4e8fdd2a7a17cd87e464f55b commit 82ddab0e8f9d5d0e4e8fdd2a7a17cd87e464f55b Author: Andrew Turner AuthorDate: 2023-09-25 08:10:11 +0000 Commit: Andrew Turner CommitDate: 2023-09-25 14:19:33 +0000 arm: Don't advertise the virtual timer on arm It may not be usable on all SoCs. Sponsored by: Arm Ltd --- sys/arm/arm/generic_timer.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 998259c5c90f..e3298ae0fb14 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -617,7 +617,10 @@ arm_tmr_attach(device_t dev) phandle_t node; pcell_t clock; #endif - int error, user_phys; +#ifdef __aarch64__ + int user_phys; +#endif + int error; int i, first_timer, last_timer; sc = device_get_softc(dev); @@ -693,6 +696,7 @@ arm_tmr_attach(device_t dev) last_timer = GT_PHYS_NONSECURE; } +#ifdef __aarch64__ /* * The virtual timer is always available on arm and arm64, tell * userspace to use it. @@ -702,6 +706,13 @@ arm_tmr_attach(device_t dev) if (TUNABLE_INT_FETCH("hw.userspace_allow_phys_counter", &user_phys) && user_phys != 0) sc->physical_user = sc->physical_sys; +#else + /* + * The virtual timer depends on setting cntvoff from the hypervisor + * privilege level/el2, however this is only set on arm64. + */ + sc->physical_user = true; +#endif arm_tmr_sc = sc;