From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
Konstantin Belousov <kib@kib.kiev.ua>,
John Baldwin <jhb@freebsd.org>,
"<cperciva@tarsnap.com>" <cperciva@tarsnap.com>
Subject: Re: [PATCH v2] x86/bhyve: Detect FreeBSD Bhyve hypervisor
Date: Mon, 18 Aug 2025 11:37:30 +0200 [thread overview]
Message-ID: <aKL0WlA4wIU8l9RT@lx-t490> (raw)
In-Reply-To: <203725e3355d04b0ae6df383481e67636d116b65.camel@infradead.org>
On Fri, 15 Aug 2025, David Woodhouse wrote:
>
> Or just not, in the case of jailhouse and bhyve? Since cpuid_feature()
> is hard-coded to true for x86_64 anyway, and they both depend on that
> (like acrn, which already only checks for X86_FEATURE_HYPERVISOR).
>
> And anyway, how is X86_FEATURE_HYPERVISOR even going to get set if
> there's no CPUID? Can that happen?
>
Correct, these early-boot feature detection code paths are all already
messed up. I will clean them as part of the CPUID parser work.
For example, in the CPUID parser patch queue next iteration (v5),
X86_FEATURE flags are integrated. There's also a Directed Acylic Graph
of X86_FEATURE and CPUID bits dependencies.
So, in the above case, the dependencies table will just have:
X86_FEATURE_HYPERVISOR ► X86_FEATURE_CPUID (and whatever else)
and all the circles of x86 vendor checking, CPUID max level checking,
other CPUID-bits checking, X86_FEATURE dependency checking, etc. will all
be removed from call sites.
I will show more of that at LPC Japan x86 track, and hopefully much
before that the CPUID parser v5 shall also be already posted to LKML.
Thanks!
Ahmed
next prev parent reply other threads:[~2025-08-18 9:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 11:22 [PATCH v2] x86/bhyve: Detect FreeBSD Bhyve hypervisor David Woodhouse
2025-08-14 16:54 ` Ahmed S. Darwish
2025-08-14 17:10 ` Ahmed S. Darwish
2025-08-15 9:31 ` David Woodhouse
2025-08-18 9:37 ` Ahmed S. Darwish [this message]
2025-08-14 17:54 ` Ahmed S. Darwish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aKL0WlA4wIU8l9RT@lx-t490 \
--to=darwi@linutronix.de \
--cc=bp@alien8.de \
--cc=cperciva@tarsnap.com \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=hpa@zytor.com \
--cc=jhb@freebsd.org \
--cc=kib@kib.kiev.ua \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox