From nobody Thu Mar 16 04:15:56 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 4PcYpv73hfz3yHL2; Thu, 16 Mar 2023 04:16:07 +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 4PcYpv6czcz3LxW; Thu, 16 Mar 2023 04:16:07 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678940167; 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=/b9fIWRLj2fR0Ocf2O8U5WsSqPn6oZDtmWyzAgmN4gw=; b=HB2IAfWlG3doUjiRSlkydFU8E3ZlQDbRfFcyKHgFUYXhwnzKpIWaBD8wEapadCxcXwunve dalZGQTc2vChV9hdxoOEHULmIGRPFioJlCHjriFVU1gVqcZhg+ZaPfzE8qoM6P15QGtGrs lFVVbz0WrfiuRGBo+EGAhHyhAqDOI7zZBgPlOitvpaKWOXOrWH/aqJfo/gLKyYCy3ABFbr ZXR+i9fYuuPiuTfE+S6iaHwXaHfbZuvkStc2DlnMwJuKDnuENsElASoNERjnz+FMumbxIy Gjcm6eNQBJm2VeqJrMU40kymIMihN5JKt4cmlTIOKK/Rn0y9caPeNSeq0gmt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678940167; 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=/b9fIWRLj2fR0Ocf2O8U5WsSqPn6oZDtmWyzAgmN4gw=; b=NTLHBO04wqVxFBYN/H+yPyH6rA3AjZAn2iIWQVLxBYKHmf2P4dPzEmkNwOa5YG6Unyussf 7NZq/aic1mX6Mm8fHi/WHYCfkyjbRhyzaVmpicj2AVPgAsgwUDv2ExF/Hpf73nIyVIVYAo cUI9uTzWiGWesW4Tcd0ZDYfpSqtMglI+QUEOX36RPQD+sMrCaQHriBzU7ssDgq+ejMAb6q A9rU52OCrG+MMArzpUqtpIR6FO4vaD2AN8JLFt9EVr2X13DqQIA+TOgOkuPx0bOm5Vgr5m 7x5u8TyVm18p8dp2C0Cwk5tHdVQOl4sb8fFEZbVm3mhaTJ0gU0ktjcgDS/uPQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678940167; a=rsa-sha256; cv=none; b=fL+vh6PoZcX0JAhypc+8XwnompxsyafJYm47mAMBllZuK4tRUnzth5mV4HmAOzai2ZNGS/ rfo8czdcCE18dLuByl0LSqK/w/O4FvTKVIwqMJ/jvi04Oo4x/2Kx9fhVgytMXT+vIg7XfE EifzmClpQbi5qyNuVZlo/rs3C6L+LYse45FzfSp1jpG8IBeMSNckch2ElHiH9u0RzDaZK3 GIqR8xDwGMnOj2k3lIyjHfhDh38mS7DQAxY7xHDJ2xYdU+m4Np5x4Bdqqu5zkSkqPwMtJJ mccMBRoif6H6q4AcrEESbvePrWpMWns/HXjeOF7aVluAZ+f1rYgtvKiKOBEbqA== Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 4PcYpv5SHfzN8G; Thu, 16 Mar 2023 04:16:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id p20so154254qkh.0; Wed, 15 Mar 2023 21:16:07 -0700 (PDT) X-Gm-Message-State: AO0yUKWy0QlFVSr+Mho9T/hVuI8oW5Tx1+7gZ4UeUzBhUlD/LMtTwwRS AddXbqZFPwlGxyZ78ucdZGBvQcpC6S+DMAW7eV8= X-Google-Smtp-Source: AK7set9Xnbd4RO3TQnvdwsBMEU/e5MR8WKKJ2qMB2E+rRKfGW69JBYUY3UYNzeZ92ODCPB9UlbMtxzRrqSCvrQ+vBLw= X-Received: by 2002:a05:620a:c06:b0:745:ad92:8887 with SMTP id l6-20020a05620a0c0600b00745ad928887mr2525316qki.13.1678940167154; Wed, 15 Mar 2023 21:16:07 -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: <202303030055.3230tl3S091663@gitrepo.freebsd.org> From: Kyle Evans Date: Wed, 15 Mar 2023 23:15:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 2fee87562948 - main - abstract out the vm detection via smbios.. To: John-Mark Gurney Cc: 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 2, 2023 at 6:55=E2=80=AFPM John-Mark Gurney w= rote: > > The branch main has been updated by jmg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2fee8756294820ff9ec6f8d173= 24e7d8a0a45040 > > 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 physfree) > > 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 latter be= ing "CPUID2_HV was set but we couldn't determine anything useful after that"), perhaps? Thanks, Kyle Evans