From nobody Fri Mar 17 05:56:58 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 4PdD0p6C27z4086H; Fri, 17 Mar 2023 05:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PdD0p5lgnz42ln; Fri, 17 Mar 2023 05:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4RLjxVMffZofr13PryE2Rzlzh/O2UnzLUiByNTpxXk=; b=dc5iAsQlJvl685UU84u4wZpzYduNZw2BGCijcptQIIoO1vmi5uf2S+UwVjl4E/8dEUa9Ri pp1BlIh4+lhBRh+pDWbFahDdnmB3vPEiZI+u5LyqimD8FnuJKQ2iyT4zl8CtzG+2vdFrUZ WHC27g6G/pX3++clERO6pCYax4bIkS4ubh1MIeC47ARgkgtnwKqDGBv1xMmU0nvhsFjeY1 zogEou5M3wLPlXs84WtcMBwXmsE6tSOwIuCxoJqQgUWNXYvimAl5kHOxNn1izxXZeWzFB+ Yd5/uzQdhAIiycgfGVz0f+RJzN+gqUhbE1MkNJfDeRE1y6pPalwdUSkcypwKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679032618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4RLjxVMffZofr13PryE2Rzlzh/O2UnzLUiByNTpxXk=; b=xKFP2KGK5vWpLSimMHHW8Ld0oaavObQzpqzV1fNcZjQHlnZQMCNrsVmdYIwPhbCjxqBPhL 15Q/XFWEkBfeqgZhbnh+qp/0x1HiN0eoD/t7yZExRnS32ZNf3XnOsxiWaMNlwuvenOmHVU OJfM2p8+xXtNXm5OOPbxduaBpSReYk8XbYvpGXB1MEUm7MNshjRCzIFx97XVx2od8JILYW Vy0l4bdbhpz1yhnzyPYaoPZbrJcRtgpAhDDeFvxsXe7Ti3v01uyJ5K4PGNdPQxgXqXpn0p 3RINoOaes2tGaf7juiy/PK6wSasPCIfhNVTwjuA3ykgUuY0BAHXRdipzoivB8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679032618; a=rsa-sha256; cv=none; b=G58LBtzajZAoH4ZPmidPFD8HW4yiioZFPcrEq/Sg2zZaYmPnrVkNzxZYEDEd+Oq9Vdrqz0 ZazDlSxk+z944Maw/rA/KEK2fS6rvZpbXQkYo5gXa1Rx5faGSqcyd5RAIynNWipiU4zxSN LUWCIMhB8spy+bdshUvuZv93O4vu668Mj4IkfFpPeyKzkF8sHuuBZdjkvb5pHCAzSebcHm 6kLQPbc4N3DcPuHg+djJv4m5PjozG0Lc4j4b1r38ZtVP0q1DPB3GvEvdCWaVTn+pjGWy5C umCwsamaxpI+wN1Rs/w/YFZiFmben1mybh1z4pJEt+UpWecskOfvpdzGpwtc8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PdD0p4p0gzF9c; Fri, 17 Mar 2023 05:56:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32H5uw9s022081; Fri, 17 Mar 2023 05:56:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32H5uw27022080; Fri, 17 Mar 2023 05:56:58 GMT (envelope-from git) Date: Fri, 17 Mar 2023 05:56:58 GMT Message-Id: <202303170556.32H5uw27022080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f7a884cb017f - main - x86: gate smbios hypervisor identification behind vm_guest 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: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7a884cb017f6618ae872f8d52e80a147daf3f59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f7a884cb017f6618ae872f8d52e80a147daf3f59 commit f7a884cb017f6618ae872f8d52e80a147daf3f59 Author: Kyle Evans AuthorDate: 2023-03-16 19:26:28 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 05:54:32 +0000 x86: gate smbios hypervisor identification behind vm_guest cpuid detection may have picked up a more specific guest type already, and a follow-up check of smbios vendor/product may erroneously blow away the previously detected type. This reportedly fixes the boot under Hyper-V, which advertises an smbios.system.product of "Virtual Machine." PR: 270239 Reviewed by: imp, kib (both earlier version, same concept) Fixes: 2fee87562948 ("abstract out the vm detection via smbios..") Differential Revision: https://reviews.freebsd.org/D39140 --- sys/dev/smbios/smbios_subr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/smbios/smbios_subr.c b/sys/dev/smbios/smbios_subr.c index c28bf0e4983f..4e30751cd716 100644 --- a/sys/dev/smbios/smbios_subr.c +++ b/sys/dev/smbios/smbios_subr.c @@ -69,6 +69,14 @@ identify_hypervisor_smbios(void) char *p; int i; + /* + * Some platforms, e.g., amd64, have other ways of detecting what kind + * of hypervisor we may be running under. Make sure we don't clobber a + * more specific vm_guest that's been previously detected. + */ + if (vm_guest != VM_GUEST_NO && vm_guest != VM_GUEST_VM) + return; + /* * XXX: Some of these entries may not be needed since they were * added to FreeBSD before the checks above.