From nobody Fri Mar 04 21:10:27 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 1F0581A012AD for ; Fri, 4 Mar 2022 21:10:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 4K9L9J6zg8z3M0B for ; Fri, 4 Mar 2022 21:10:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qv1-xf34.google.com with SMTP id j5so7550333qvs.13 for ; Fri, 04 Mar 2022 13:10: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=6h7T9/OJ/L1E9drSLQ0hdlPq8xPx7HMBBdb99o6jgzU=; b=Ezln11jnqybYUYAMeSDZOOSK4xORppAwJLfUVIvJu4eQf2tZ66PSO0YWVjmxrh7MDM 2m4j2rWz8r+fKJt8sWXVtQlceHmSPAk6FTjrqVu6bnK7S1nCjzeQ6zKym6kM54poF6g2 SZUx1+4tB0Hj6SmkPGlrTlj7TbiO1X9MBgZwV+Cy8y4ghjRYYFp2jV6/4H6VvKlp82aE GYpS4Tw6nllTSs1PRUqmjwKcmMvCH4naUIPBa++0vOgqMqRSfvu3HOaEE5LtuMrXaiI4 RVV0CKIzf6FANRlHhUkujnX8u8xr6FIXMcaL4L/Itp/c1piDsf6WiaUYZEIpYZKb1P1Z 7yYw== 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=6h7T9/OJ/L1E9drSLQ0hdlPq8xPx7HMBBdb99o6jgzU=; b=G5E3I9FrsLiYwtKgoE4ciGRotdg0zVvlq6PDYVs4svVRbQAOqQBZ3Dl5by+Pn1GDvy lIrh7H2XWdYhICuYP6T5zgWw9lIM1IUZDC1Qe0+Izj7Z/EMbUuN0/O9G2l3R5zI8VekG KdfG6d8ZCfqzp7utzJdv11RF5hpbEfNEve9pEvJ+IPMxQD087aGjszwMi1F0UseMBnLg XJUl39DL7FZyqN7hpNIrHxkcHpIYRysFB4fi27ukA1A7HUN7r0hofpy+m69ZSyMVt7eI k6VSx7C7Tvc0cLIePxfi7VPwUDDZEtCMDWmnMujLXI9yJD3twKt3HDyHIr48brUSTlCm j/jA== X-Gm-Message-State: AOAM533ZHeDWoKff+2+OesTxKtrrve3fMC4Q14cataA2u5GVqS7TTsV7 Q7daZxq4fmWJuZAXIC9PaB8c6g== X-Google-Smtp-Source: ABdhPJznp1hpfA106NBoUBsmtmAAcZ1jmeDrmS5JHTPVXZhbfEMD1lKXDMffaCiWFEQ3F/rSj1ERfw== X-Received: by 2002:a0c:c3d0:0:b0:42c:2329:91a6 with SMTP id p16-20020a0cc3d0000000b0042c232991a6mr261534qvi.94.1646428228542; Fri, 04 Mar 2022 13:10:28 -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 s19-20020ac85cd3000000b002de4e165ae0sm3956160qta.75.2022.03.04.13.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 13:10:28 -0800 (PST) Date: Fri, 4 Mar 2022 16:10:27 -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: <20220304211027.ztkf4knrpeeyhkld@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> <20220304175226.avi2r57dvjfeyr7w@mutt-hbsd> <20220304181529.isvkyyx3qwcbt6v7@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="5azgudcq2c4dn2rn" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4K9L9J6zg8z3M0B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --5azgudcq2c4dn2rn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 04, 2022 at 01:31:10PM -0500, Mark Johnston wrote: > On Fri, Mar 04, 2022 at 01:15:29PM -0500, Shawn Webb wrote: > > On Fri, Mar 04, 2022 at 12:52:26PM -0500, Shawn Webb wrote: > > > 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=3D84369dd52369cbae= 28970dca20a53d3de1719907 > > > > > >=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 use of > > > > > > the sometimes-unreliable 8254 PIT. > > > > > > =20 > > > > > > PR: 262155 > > > > > > Reviewed by: emaste > > > > > > Tested by: emaste, mike tancsa , Stef= an Hegnauer > > > > > > 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; > > >=20 > > > Great! I'll give this patch a try and report back. > >=20 > > The proposed patch did not result in successful boot. >=20 > Ok, I forgot about the dummy timecounter, so that patch did nothing. > Can you try this one instead, please? https://reviews.freebsd.org/D34444 >=20 > I wasn't able to reproduce any problems on Azure, but there HyperV > provides an emulated 8254 timer. Can do. I'll report back soon (possibly tomorrow due to time constraints.) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --5azgudcq2c4dn2rn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmIigEAACgkQ/y5nonf4 4fodsg//YH6w6i3YIhp6yHipdctFYvdL26f2Cbkz/eArB/mRWuPNQ6MTHujOuSM1 VQA04Ng72QSJOfIn6q3pi8GAXuS5RIUiHV0pzcLPllIwyn6qfozaBt3R82dPaCKs 0gw7Cm4nmVUShmhAFeOHZ1dzn5d1xCzgFM55llArityH/XbiNKl064+Jleqth46u 61Pv+aFMtGhfkMQTydQ6QkXF64ZCn4mw7bCKl2g4bnCWJh+m+dwMt8AcwYuNP0pj JvrOpbtAvzYNmI/fbHxiDVy+PXQmPiDu0BvI3C5par2OifqKTFYYH148f/oBc+KR D3LdoDEHse7zJWatis8va+SRpKrsgltgYOnGvD26ZGQrZNdhlJDdFvG+OjnEM2WO STilqswMQOYjjWnyuBVQr3WNEKPS3Pd4VUtcTJfT1oGRW95c8GlOydR3wv3v937A EdCyLDXYptCrsuXJEwggel5kGVt4fuRVpq5TW2Ebcc3kR2/qawm9HxPQYw4GTWvm daanz5HrH05eDXOoEEWrCWTuocqXOkB8EMXRLGQblc/wR9HU894GdQN05FDLcHTJ foNADcK3VeceoWmYTW6liADab0aF1XKVgItwDzi/cEynY4OWh5LF1F+RXLl2zt3c WkIt86RLKI9M41rGn0joOrgJt7hhjuBSjnYBchTk1YaJHAmUfvA= =HWxp -----END PGP SIGNATURE----- --5azgudcq2c4dn2rn--