From nobody Fri Mar 04 18:31:10 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 C4E8619FEB66; Fri, 4 Mar 2022 18:31:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (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 4K9Gdj4yZHz4fVH; Fri, 4 Mar 2022 18:31:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x82c.google.com with SMTP id s6so4785664qtc.4; Fri, 04 Mar 2022 10:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PefsgxuNoSSA2HZqudy5IHfT5H4zTdWst4jGQ/jWAU4=; b=aNNaTbWkfkfQudI0aUflhh0tocnqGXJrDfgy4yt0PGrDSal377kTjkX6pA2Pzvjqec JmJLS2OKgSnd97Z+FxlTOCBbyjLV/ys9qXyNuHyHTc8yx/lKKsp3ckcEo1yn/8SpVUA9 oVKlDyKYG1ZiT0s8y9irGU/NboRNfN9FOnQ+7wGkhl87xEVHdNmGFlEO0g+9Ubh+iqpw Heb5VD9bP/2ycnq4DD/Ux5Zh048SadqneSGmt7UFJ1UJRwkg2p/n+y5FXHORq5YlLzCr knaBbwkiPOyeKwUBrdj1w37GHVRNbHzrqAKhaQkfS6vKlpsJMvk9pdRm7n3OyLIbZJQ5 Ecrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=PefsgxuNoSSA2HZqudy5IHfT5H4zTdWst4jGQ/jWAU4=; b=FzYp1smhGOWmwf48GeHadr429S3T2qAoq82dJmZJPTWZ1CJKSoySTfkOedsEl+Kt7H EvxuHH4/FtuYWmT9IwqlRVb4f5GdyhOGSW7ZK6V559QGAaRrvFnPY7KEIkZaFkleinzK BteiC/pD9nH1XftEbv84DkSqGCeyX+kBNyhpsMXAl3EtdNgdsLfwxE/B3S0j2SsDvXss 59RF2ZJqdPfgfU0FrJuZjkIHfSFxwnWnMWQDdMB5Ys+khoZYAPBRz26RTM3d0BtGKfAL u/ywT0AMuuajsXAzZ96CfAcGQVdOY2mTVQGo8zwMglnd6nx0bi/fVQgOT7GDcguHleoe pmxw== X-Gm-Message-State: AOAM5332KqAXYLaLDlWokGYxIJTb8BrzcW81HhjKm6inXomRPylb89l0 cwTcq+QWfZJwclCvUk0agAgGTmoB7Wc= X-Google-Smtp-Source: ABdhPJyWZznxMMaq16YL67uRyFqd7jg7G2z1cOI4q9mBU/h1JWHYHaXdeRrUbXXXZabT7qRswqKfiA== X-Received: by 2002:ac8:580c:0:b0:2dd:d863:8a2d with SMTP id g12-20020ac8580c000000b002ddd8638a2dmr1420qtg.469.1646418673661; Fri, 04 Mar 2022 10:31:13 -0800 (PST) Received: from nuc (198-84-189-58.cpe.teksavvy.com. [198.84.189.58]) by smtp.gmail.com with ESMTPSA id i3-20020a05620a0a0300b00648a9319e33sm2629929qka.115.2022.03.04.10.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 10:31:13 -0800 (PST) Date: Fri, 4 Mar 2022 13:31:10 -0500 From: Mark Johnston To: Shawn Webb 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: References: <202203011439.221EdtpY038505@gitrepo.freebsd.org> <20220304142447.bmo7r6syd6gsunnt@mutt-hbsd> <20220304175226.avi2r57dvjfeyr7w@mutt-hbsd> <20220304181529.isvkyyx3qwcbt6v7@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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220304181529.isvkyyx3qwcbt6v7@mutt-hbsd> X-Rspamd-Queue-Id: 4K9Gdj4yZHz4fVH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N 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: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=84369dd52369cbae28970dca20a53d3de1719907 > > > > > > > > > > commit 84369dd52369cbae28970dca20a53d3de1719907 > > > > > Author: Mark Johnston > > > > > AuthorDate: 2022-03-01 14:39:35 +0000 > > > > > Commit: Mark Johnston > > > > > CommitDate: 2022-03-01 14:39:35 +0000 > > > > > > > > > > x86: Probe the TSC frequency earlier > > > > > > > > > > This lets us use the TSC to implement early DELAY, limiting the use of > > > > > the sometimes-unreliable 8254 PIT. > > > > > > > > > > PR: 262155 > > > > > Reviewed by: emaste > > > > > Tested by: emaste, mike tancsa , Stefan 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(-) > > > > > > > > Hey Mark, > > > > > > > > Something about this commit breaks booting in Hyper-V. Reverting this > > > > particular commit makes Hyper-V happy again. > > > > > > The patch below might be sufficient. I'll test it in Azure but it'll > > > take me some time. > > > > > > 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 = timecounter; > > > - if (tc->tc_quality <= 0) > > > + if (tc == NULL || tc->tc_quality <= 0) > > > return (0); > > > func = tc->tc_get_timecount; > > > mask = tc->tc_counter_mask; > > > > Great! I'll give this patch a try and report back. > > The proposed patch did not result in successful boot. Ok, I forgot about the dummy timecounter, so that patch did nothing. Can you try this one instead, please? https://reviews.freebsd.org/D34444 I wasn't able to reproduce any problems on Azure, but there HyperV provides an emulated 8254 timer.