From nobody Fri Mar 04 17:52:26 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 E9CF419F8549 for ; Fri, 4 Mar 2022 17:52:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9Fmr4HQ9z4bMS for ; Fri, 4 Mar 2022 17:52:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x733.google.com with SMTP id t21so7026080qkg.6 for ; Fri, 04 Mar 2022 09:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0zY8Rc16qUw8+lBKOB8foQwLTyOvWxJQGdSsfLSuNPY=; b=OHS2O9RuJuPWe1iVS/ldddQRIuurptvPcbO0CG72pWq2w3WC1H0sGZoTxROC12lK80 L7Dnn7lTHwrQCzZWWpE20TImIc+9GT62KH6Rdaei3srgmnJ3UsxnKdgrEyZKEGzwTR2k OjsVZQSL4vh5AyoWQaCTcMfOyqJ0SiOnFHUoJu7R88V10H9woq36yyvPMLDQ4dq1hExx IdPhpGy9qe0jd5lSVfO0Kwl5E8NoAn3MwDogx6ESkbmoWXEch+gQ3dynVxp/xIq3q5MQ O+vDuscqoOjBuDzypu4XOKc5+Y2Yp3y9lfMnKzzYHFbdm53oSfGvesPeXfCVHNFJ48lv 7w9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0zY8Rc16qUw8+lBKOB8foQwLTyOvWxJQGdSsfLSuNPY=; b=gy0zEodlweQ3GkfK2FxaaVoww0tggpzDJ8+ep8qFpXd/Enx5ueMeIBvJTieQbw7o8E pbuI1ZslU1pVx47nh4DZMiTjWwxtLsQiG3FgNblFj2SIrvOgyE1Zcr6Epf2F6DDZDti2 6KxXXitwo+6WXb8yrKbO4T772ErBOTEItvALOa2Dve4INhE89sJO8Gqq1OaDZxsL3gHl Tg5wB+sEEvExuQciLvfpZqGXz+ziwi0rvE0b38qHLMqENKapJHt7BO8CBLpou1YRr3kr 40MaEvGhiPFe4fWM0zSTwju74bCGb2yO7jYGbJrVDbRG5o+UeKS6FJVarGVTWusMzXlq uBnw== X-Gm-Message-State: AOAM533vUzFqFhptHCW6qI5aogW4jJ0pEmj3MIi7nb7R0n/++MPdmaem 8V5mPiDcAHqDZRjSYi6dC6lbNDZ9QeFcg1d5 X-Google-Smtp-Source: ABdhPJyAy7qFc9OqLsuvwVf/lPRYvTKJs94cOWTTB0/aEAhFWQTNZTREkG5QBAPm0zWWYRV9ap1ALA== X-Received: by 2002:a37:a894:0:b0:5f1:86d0:5a6b with SMTP id r142-20020a37a894000000b005f186d05a6bmr3307998qke.370.1646416347817; Fri, 04 Mar 2022 09:52:27 -0800 (PST) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id d77-20020ae9ef50000000b00649555ce936sm2760074qkg.83.2022.03.04.09.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 09:52:27 -0800 (PST) Date: Fri, 4 Mar 2022 12:52:26 -0500 From: Shawn Webb To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 84369dd52369 - main - x86: Probe the TSC frequency earlier Message-ID: <20220304175226.avi2r57dvjfeyr7w@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202203011439.221EdtpY038505@gitrepo.freebsd.org> <20220304142447.bmo7r6syd6gsunnt@mutt-hbsd> 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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fttet37cfapvuflw" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4K9Fmr4HQ9z4bMS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --fttet37cfapvuflw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 04, 2022 at 10:13:54AM -0500, Mark Johnston wrote: > On Fri, Mar 04, 2022 at 09:24:47AM -0500, Shawn Webb wrote: > > On Tue, Mar 01, 2022 at 02:39:55PM +0000, Mark Johnston wrote: > > > The branch main has been updated by markj: > > >=20 > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D84369dd52369cbae28970d= ca20a53d3de1719907 > > >=20 > > > commit 84369dd52369cbae28970dca20a53d3de1719907 > > > Author: Mark Johnston > > > AuthorDate: 2022-03-01 14:39:35 +0000 > > > Commit: Mark Johnston > > > CommitDate: 2022-03-01 14:39:35 +0000 > > >=20 > > > x86: Probe the TSC frequency earlier > > > =20 > > > This lets us use the TSC to implement early DELAY, limiting the u= se of > > > the sometimes-unreliable 8254 PIT. > > > =20 > > > PR: 262155 > > > Reviewed by: emaste > > > Tested by: emaste, mike tancsa , Stefan Heg= nauer > > > MFC after: 1 month > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D34367 > > > --- > > > sys/amd64/amd64/machdep.c | 14 +++++- > > > sys/i386/i386/machdep.c | 11 ++++- > > > sys/x86/include/clock.h | 3 +- > > > sys/x86/isa/clock.c | 4 +- > > > sys/x86/x86/tsc.c | 123 +++++++++++++++++++++++++-----------= ---------- > > > 5 files changed, 94 insertions(+), 61 deletions(-) > >=20 > > Hey Mark, > >=20 > > Something about this commit breaks booting in Hyper-V. Reverting this > > particular commit makes Hyper-V happy again. >=20 > The patch below might be sufficient. I'll test it in Azure but it'll > take me some time. >=20 > diff --git a/sys/x86/x86/delay.c b/sys/x86/x86/delay.c > index c767250954da..95b994b15f81 100644 > --- a/sys/x86/x86/delay.c > +++ b/sys/x86/x86/delay.c > @@ -89,7 +89,7 @@ delay_tc(int n) > return (1); > } > tc =3D timecounter; > - if (tc->tc_quality <=3D 0) > + if (tc =3D=3D NULL || tc->tc_quality <=3D 0) > return (0); > func =3D tc->tc_get_timecount; > mask =3D tc->tc_counter_mask; Great! I'll give this patch a try and report back. --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --fttet37cfapvuflw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmIiUdoACgkQ/y5nonf4 4fpJhg/8C/OtMPVFfEZot0Yh2XLhUWhl98vBlvM+peBKlkxTWvNNH77YDaaCHtlP t0NubjRN1+KDA9yBSWwpwyYBGZf1Loc3rg0D47yTvQK/avvxb6RLwlbqbR47b3i1 CJHkAt5TdoBmCrCdXzeX4UGH/kWwrwLhcSFag9E5IrQvwYBg7lpfYBzRgQmO9eG5 zqnHtbyw0Qc3Y9IUSyZn9VFAwMogGN/xN6NIvzw0LAqopvikxetxEh5zXIOZry9j u/TH9tjWYzOMKtLhqFajJD02yAiYh/SxnlGSqK1W7XrRi2YYPfB80xicgbDSN1VH +ZSTzShErgaNMflN1NqSyI9n3imkS1eCaRtsnhMcmoDKXFbvnzQWeiNWJRK5vbe9 /l+r7n2IqRBoLHlsf2uRCJbQv1ImbhS9t2Wyjcaros0IDq9hGb6RknnPi3/5l2vp 7a7GEsh8pqmP7u03DA4P9yyOYZxnM29rlh+bXYwGDVUJWu0AB/mRPRbp5fGywL2i 4PwweOIrerwzAj/c3toSw8/rok8gDgPfCTQxbjG5hSGMKb/GQFvyPZ83FXPdA8uN CEg1tf6xTOytf5vuIzI/UBrDC7GRZQTyih9tI+qQxqTtQE36p1lBGXylZ1akwOAT /ZcZCN2lWDD+1Uwh0GqTTWbZvO0D+Kpzf2mhJr+qUOxRjKFU0zc= =zQtn -----END PGP SIGNATURE----- --fttet37cfapvuflw--