From nobody Thu Mar 16 14:31:51 2023 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 4PcqTb4ShFz3yBFL; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcqTb3zH2z3KlG; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIT7gO7hHooGqxS6kz6DvVXsZ/o0ZB7etKLRSZojvbc=; b=CEF5ua1PCbbk8Vc4aZzyA7N1yGUX0H+zSu215dpa9lokH5l0tn09yIZRbR5p6mA/LTMeQp RsoDl1i1DTDG8gvCmH/TriGgA0qhmxTj3EHVDAzy25GF0w41w/igKjoSIwHqqIoYMES7qF KdcXDTTA7M+N59OZi1+i5gR4l/v6GpXGO+/dhCZ1d9z3y48X1OlggPl9AClvu2u1EDeO5T laD+IR0Mc93CXDZtWRE7caff59AWOYhJaNwmsewHjvPkEpXLE+4JSjRIAi9T8HOK52yyDZ NiTmMU80OoDW+6jngk73C8C1VdNA3LDLBVJ6b9liF2A3YqL6rzJkpPJEFe6SJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678977123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wIT7gO7hHooGqxS6kz6DvVXsZ/o0ZB7etKLRSZojvbc=; b=sftrlHSEeDTKK0+yHBa+Ri+/INHFRvcp2ZaYAiFpa27paN7Q4J/QEyq/mrPmEaBg0FIF7w y65VnZijYQ9YkzQtd28smIJSqU5NU88vtgE8joy78dKhBJaTte9MliFOd4lnDVYpUDFZwR W+IwvNBejythBtCBIDU4J7eL8wwoY8v+dn7j/vAlhqQHD6XE6o5Kx2oGTT71KQ7zcNobW/ dEJU1nM3IRxll5doNuEibOq9T9aSTRRIBuEvzUhtoliSudCRw3cCVuweL3Eza7J561kBHY 3DJY7rBwVbZgM2yphUbugavvUUTvm5D0es9dULikLWGE/oY4fhhQdHoRs3O7NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678977123; a=rsa-sha256; cv=none; b=fXraO1Ll1I3d54NbTOeeGhtJ7ah37ztAv3qv/CD/mygdtp5AlJqWKSgIH7yh0k2uFDcpf7 aBd2FuJA6+hUG33RHIuKeZkSJ5K96Wc2j8bIR3OEnwKkCG1G5e/g5+X16+JTCpkB21Dtxa jlq51EQrXVgR79S63MRqNMBqCdIwOnCIh0a8aKlv8k2d2v4CHRQoUF21L6pqQOqnhiqtwx 1It+B7iey+W9qbWmUF4yXv+mzpW26nutAT+om4oaoVm/BDadolDb1h1PMtQYWQNTfFqi1T l+ZoGiHXQpEQ8zNlns2rTnYv5ZA4GShg7Ydxf+fx6lguBL031x9DtSI8gatlBg== Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PcqTb31f5zYfZ; Thu, 16 Mar 2023 14:32:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id f1so1310053qvx.13; Thu, 16 Mar 2023 07:32:03 -0700 (PDT) X-Gm-Message-State: AO0yUKXRfv0YxFLWW3RACSZccRYAbhxrqwPoJIDKNfWGATTA9jcHd/H8 eXIUqNNFYeNC8SHHHnSoNw2rDwXVl3p7LT5DCak= X-Google-Smtp-Source: AK7set+5yIFIKYUvTjv3OxKFp9yN26l74e1e69cIdBUo2z+YDPcjH4MGIAt6qFTdfId+5yAL9SWMyVNziH4ZPmwlX5s= X-Received: by 2002:ad4:59c7:0:b0:56f:fe44:f257 with SMTP id el7-20020ad459c7000000b0056ffe44f257mr4737752qvb.1.1678977122739; Thu, 16 Mar 2023 07:32:02 -0700 (PDT) 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 References: <202303030055.3230tl3S091663@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 16 Mar 2023 09:31:51 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 2fee87562948 - main - abstract out the vm detection via smbios.. To: Yuri Cc: Kyle Evans , John-Mark Gurney , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Thu, Mar 16, 2023 at 7:29=E2=80=AFAM Yuri wrote: > > Kyle Evans wrote: > > On Thu, Mar 2, 2023 at 6:55=E2=80=AFPM John-Mark Gurney wrote: > >> > >> The branch main has been updated by jmg: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D2fee8756294820ff9ec6f8d= 17324e7d8a0a45040 > >> > >> commit 2fee8756294820ff9ec6f8d17324e7d8a0a45040 > >> Author: John-Mark Gurney > >> AuthorDate: 2023-02-23 20:59:50 +0000 > >> Commit: John-Mark Gurney > >> CommitDate: 2023-03-03 00:54:21 +0000 > >> > >> abstract out the vm detection via smbios.. > >> > >> This makes the detection of VMs common between platforms that > >> have SMBios. > >> > >> Reviewed by: imp, kib > >> Differential Revision: https://reviews.freebsd.org/D38800 > >> --- > >> sys/amd64/amd64/machdep.c | 3 ++ > >> sys/arm64/arm64/machdep.c | 4 ++ > >> sys/conf/files.arm64 | 2 + > >> sys/conf/files.x86 | 1 + > >> sys/dev/smbios/smbios.h | 4 ++ > >> sys/dev/smbios/smbios_subr.c | 104 ++++++++++++++++++++++++++++++++++= +++++++++ > >> sys/i386/i386/machdep.c | 3 ++ > >> sys/x86/x86/identcpu.c | 57 ------------------------ > >> 8 files changed, 121 insertions(+), 57 deletions(-) > >> > >> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c > >> index f33f2c6509f0..480db1ed2c31 100644 > >> --- a/sys/amd64/amd64/machdep.c > >> +++ b/sys/amd64/amd64/machdep.c > >> [... snip ...] > >> @@ -1315,6 +1317,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfre= e) > >> > >> identify_cpu1(); > >> identify_hypervisor(); > >> + identify_hypervisor_smbios(); > >> identify_cpu_fixup_bsp(); > >> identify_cpu2(); > >> initializecpucache(); > > > > This brings in a behavior change that I don't think you intended. > > Previously, we wouldn't let smbios clobber a vm_guest detected from > > cpuid due to an early return, but nothing is stopping it from > > happening now. I think this call should've been protected behind a > > `vm_guest =3D=3D VM_GUEST_NO || vm_guest =3D=3D VM_GUEST_VM` (the latte= r being > > "CPUID2_HV was set but we couldn't determine anything useful after > > that"), perhaps? > > (sorry, don't have the original message, replying here) > > This also seem to have broken Hyper-V VM boot: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270239. > > Gen2 VM boots again with this commit reverted. Sorry, I should have led with this. A private report had indicated to me as such and that they had bisected it down to this commit. They've since confirmed that on HyperV: smbios.system.product=3D"Virtual Machine" and that avoiding the smbios detection if vm_guest has a specific vendor already set does indeed fix it. Thanks, Kyle Evans