Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2023 23:15:56 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        John-Mark Gurney <jmg@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: 2fee87562948 - main - abstract out the vm detection via smbios..
Message-ID:  <CACNAnaG0S42fBbmdnutjM0v0Tm-peR1NngU-_P2C1xqKAUFQYA@mail.gmail.com>
In-Reply-To: <202303030055.3230tl3S091663@gitrepo.freebsd.org>
References:  <202303030055.3230tl3S091663@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 2, 2023 at 6:55=E2=80=AFPM John-Mark Gurney <jmg@freebsd.org> 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 <jmg@FreeBSD.org>
> AuthorDate: 2023-02-23 20:59:50 +0000
> Commit:     John-Mark Gurney <jmg@FreeBSD.org>
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaG0S42fBbmdnutjM0v0Tm-peR1NngU-_P2C1xqKAUFQYA>