From nobody Fri Mar 04 23:09:04 2022 X-Original-To: dev-commits-src-main@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 3CB3A19F0760 for ; Fri, 4 Mar 2022 23:09:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 4K9NpH1rbWz3rQg for ; Fri, 4 Mar 2022 23:09:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x833.google.com with SMTP id a1so8688762qta.13 for ; Fri, 04 Mar 2022 15:09:11 -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=d6teaB4w3NEimfcdtp9e2MTqED1rTOqYTUDjly/zkNg=; b=YeL5Wfmf5idOrYMjXjznPTrTIx+b72OIJiVpgFOp7jxTfippUWAx3dSc/6SoK521da PbbYrHQpj36gasY1JyfAVTx238ajwzij+sVqZn6e0wN+sDeFTTX5/wZNzY4iKezzgz8T AkRALlGXGvP38L/5vVfjOyCguPxM6bTuhehGuuKmjuoWn6MWJwEWp/CDNk5HxnvUQym9 lNnUknJz5LXLc2cA2Ti4zSGAryh4PLtUH3Kw+hCYRxtxlu+KcRFlhvFzyTe6QSj63tIE /QKWAcZ/W/oOeF1MC3LD61Jx/Ucuwm6E+vIkSq5ybJXQ1SSOrRlJrFhv+qbcJM+hETez g+tA== 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=d6teaB4w3NEimfcdtp9e2MTqED1rTOqYTUDjly/zkNg=; b=WRyaxuUfSnpb84zgSDsur7XVr+T9LOATrtB+0IjF2oDBSb/8XZQRG4FUWJAe5LRXbG q2yB3xOptLf34BPJ1tey2As8+WTJokTtzOqDHQ3Ob5rpkgZ01PkRXi+cwzZ8csz7b+tk /4wE3kP+8iwKTssi5NqU3y1CqPcqmOteeCBJy4dxAXgCa1Z8BzXdCu3r9DCqI5+VkTnP dLH7cCAsmP3MNrPQsnGVjoSUA79NaJtI+xl+bvzuGHoSk6H/466XzdtZHCsMVHcTqYqY SzBymbav2NaS+08dKFxhNyfNEHFhfc4fah7I19N5ESnaJvr/+SWMqohB92xjjlErZTwW +KJw== X-Gm-Message-State: AOAM531A7pZUBxVbqTTBisJEtt7Fc1388hPJVML+KO7E92x4mJRAQZeG a+D3lAKNcdeyYKXqpz4XayW1pw== X-Google-Smtp-Source: ABdhPJy43y2vKkgWGOHDJubunRdpwxKb5+3Sk6yuNISVuoHjdI9qjHh2nxSY8IQbTpctmXgD7gXxVA== X-Received: by 2002:ac8:5c4e:0:b0:2de:7191:7480 with SMTP id j14-20020ac85c4e000000b002de71917480mr991310qtj.489.1646435345632; Fri, 04 Mar 2022 15:09:05 -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 o200-20020a37a5d1000000b0064904a35862sm2931939qke.96.2022.03.04.15.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 15:09:05 -0800 (PST) Date: Fri, 4 Mar 2022 18:09:04 -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: <20220304230904.tx26rtpu4xrpflju@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> <20220304211027.ztkf4knrpeeyhkld@mutt-hbsd> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3aelavp4qgrddn42" Content-Disposition: inline In-Reply-To: <20220304211027.ztkf4knrpeeyhkld@mutt-hbsd> X-Rspamd-Queue-Id: 4K9NpH1rbWz3rQg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=YeL5Wfmf; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::833 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-4.52 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.42)[-0.423]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::833:from]; MLMMJ_DEST(0.00)[dev-commits-src-main]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.224.136:received] X-ThisMailContainsUnwantedMimeParts: N --3aelavp4qgrddn42 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 04, 2022 at 04:10:27PM -0500, Shawn Webb wrote: > 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=3D84369dd52369cb= ae28970dca20a53d3de1719907 > > > > > > >=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, limiti= ng the use of > > > > > > > the sometimes-unreliable 8254 PIT. > > > > > > > =20 > > > > > > > PR: 262155 > > > > > > > Reviewed by: emaste > > > > > > > Tested by: emaste, mike tancsa , St= efan 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. Revertin= g this > > > > > > particular commit makes Hyper-V happy again. > > > > >=20 > > > > > The patch below might be sufficient. I'll test it in Azure but i= t'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. >=20 > Can do. I'll report back soon (possibly tomorrow due to time > constraints.) That patch indeed made the Hyper-V VM happy. Boot was successful. Thanks! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --3aelavp4qgrddn42 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmIinA4ACgkQ/y5nonf4 4fpsYw//dMB8v2fJwPQ8AZtiPwhxe0lR4xysNnG2UQVjjz+ugAsqSIzJttJPLnvg swxZWGnlXFuRF6+YVHvJWtEA8JzbPMKpKNyXbaQex0NYw4CBecvGZnz8HeNTKZF/ B1VOScy42KsE804U9lYx1O8Bl0z810beSTwLsfKeXYCwx8axHhUn2VYCZh++9blN zB9vrZqEppIn/rw6ir6K3gxZ3+5E+19vRyJvB5GVIJV98FYm/FSEJJib0d/rgKUK 5Vu4YfCIYrkq3nTWY60UTRj3LCGUE/QFi2CIAORMXPqsPYSShDoRphSOL96UkkMR 0riVxunPfu4VZpaakE9vqKPod0MQFRjRlbD3h0Lp6herz+6X0KA8BKL3HSnzeyw7 UOcmc3J7SxmT8XvbkKip2ghkWY3xTXWp6VEgEwLg6+nFApvCnpjfQNVMTFDkY4On B0Nabi0bdhtJlyiMr93fABzU1ifmy4w9Q8RHQWElOrqqKmGUXQtRgfy3yaWbmL7l zGhMYy6MURpKgyf/rsINC6mMy08xTvWsl616oDcXn8jzIgwOnjEIYsX4WnP5HXAl SdrZbwb6lNVgu+rzOGRLtociAjZtRPCiLKarkE1JzO73K/5tchDMhaS+sIhNGcIX EK/Y+QYDW4BPRP0wHn0eU1YCYPNQPw/cvee8HcPwyii+bRHvwms= =iCDe -----END PGP SIGNATURE----- --3aelavp4qgrddn42--