From nobody Fri Mar 04 18:35:48 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 9B06419FFC8D for ; Fri, 4 Mar 2022 18:35:55 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 4K9Gkz30gmz4gSF for ; Fri, 4 Mar 2022 18:35:55 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x730.google.com with SMTP id f21so7101718qke.13 for ; Fri, 04 Mar 2022 10:35:55 -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=u0qj63h9B4QmGpsJjrm6qeCKok/gDHILzBcSD/4uzHM=; b=TmIddKWrrorOvOq/x8FJ4UMweGiUOEi31aVSjnHlDhc0cwINaTSuDxfdIFscCh2zDg irVx/irDih8jp9z+pujn1+Xf4Wp5hTp7rPhPdw9Fe2lzYKnaWRgx0hdC3syBUg/vY0sd /lOL4kofeXOhQTRf0ry3QMfWhOiI7XNCgu87h8Om1TdSu7CZyzhYcYvn9/lMqCfnD2b4 AK7+rj34azktaO/wuqg7l74vXKytkVGd8bt+lIj7s00I9Q6u2nOJKsWCCs6NODimBVSK RQVlrahJrUhLA7Wtq5k4abBsBE7WYKdyXEL4C1lSMTmpPqXDXFOiBsM5GkkP8k2sluJ4 LP1w== 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=u0qj63h9B4QmGpsJjrm6qeCKok/gDHILzBcSD/4uzHM=; b=Vwnywb7NFUwoR5qjBsIaVPrM6Ciw42ZkJSuIBAPZJLsmq9G7KYKmF4+Mog7BRJdLYk mxoOWj1MKfaviwRncOpbFtZJFOAE32h98MYFNro0y1I82mzBXrZot7xmkmrHFS0WpJkR hjSXpm8pIJSRUh1vvbFSTDjcb9+J35am8EKjCHUJFzMCjAu2p5lWi0KxYQJmjoV0tbqV 3sVXaH5eAPu18QgIOvMWzhSo8IjeCYQ1cUKFwrq4IZ3eWsI6WBiNkkOZ/70NnWzRu/YQ 7joKL87ZLUdpYWpasfsy0HRwp35hunce1YzLYbnOT1DCkjLKYluelo8RCokdj843jaDg 8N3w== X-Gm-Message-State: AOAM531grqugOrMziUU+uTAv4l32RAcLGBUv2G+ftT3K6xilgM2g2awJ Dz5vsu/h9rHz18QN5tDnqDZdRQ== X-Google-Smtp-Source: ABdhPJzmnXjxOKjpQBXMeODnUdSvjcbds4KTy9ZVB++EcZrEqfvjqBk/WcvTDveg9B5q03TCLLIgTw== X-Received: by 2002:a37:a08c:0:b0:46d:ce6a:b6bb with SMTP id j134-20020a37a08c000000b0046dce6ab6bbmr3480527qke.270.1646418949680; Fri, 04 Mar 2022 10:35:49 -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 t28-20020a05620a005c00b00662fb1899d2sm2787060qkt.0.2022.03.04.10.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 10:35:49 -0800 (PST) Date: Fri, 4 Mar 2022 13:35:48 -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: <20220304183548.r335ihm5wyjol7dd@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="725rklmhpen4lukn" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4K9Gkz30gmz4gSF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --725rklmhpen4lukn 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. Interesting. It looks like I don't have the option to switch timers in Hyper-V on Win11 on an Intel NUC. FWIW, it's a gen2 VM. If you have any suggestions on how I could help debug this, please let me know. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --725rklmhpen4lukn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmIiXAIACgkQ/y5nonf4 4fr2sw/8D1gsDCL9sAWyDYzmEeqSeT2MU7Pcqi7j5tnBNrrnRUBc0MZnPBFmAj2t k5Bq6q9+ESjRJhn80iDpWyp/drpNiBNm8VK2WPYMvSffeaDCH+60CSCtD8TkDnp5 IWL072Su1fXEpifhWhommqKld2/rqaa242eCXzbukVzNY+w66lAvNZDcqCdiiBZI mVlOyeU6FZenzrHUUHQjmsgh2dGibQnwCF3qk+78K/AEC4dTZKP3VP0V9ObTMD69 e5RbzA06OWIqm4w08rp2ZTYtcybG7CgRjMh31RAOW8ldSL3r6lt4XkXyH/hkkeb2 5+/3evR1jA9ng0Wj9rr3rINQxTc7x3BMwcOf0pB4gR6IWYrow+L9fudQTgcXY2FX crtPeMj6viTBM91dD8LJ4RkcER2yVXqIdHlKadq1lr/DkNmd/equbbgRWHADl+d4 KqI6SYZQfJDjrwloBCM+DJUYFQsR2UnaJOFqVB3BGjf9eV425TPZ6tMg/GYgodhR 9CSFenWkqNL22xVRRGbk3gAQ1PfJB/3f6MCmqXQ4jUCajPTND52cTrsUxVE83niL xF8apmMz02SXt9TjmWI3PeZNehpdWlEfw5JycJ29irzrG8eieIaSoARIZvKEibuC jahWKdH+CB/whPaO/pOb6gMKih7gYVeIpiLDvHc9CoZUaLPau34= =j3JG -----END PGP SIGNATURE----- --725rklmhpen4lukn--