aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-05-24 22:34:37 +0000
committerWarner Losh <imp@FreeBSD.org>2023-05-25 04:33:53 +0000
commit42b0b7a926e3e4834dda923a0751f312e008ad92 (patch)
tree52a6ebec1306e5ba336e36d83450b77e530f6126
parentf28dff43ad62ee7396abde1f8449ead1ece98053 (diff)
downloadsrc-42b0b7a926e3e4834dda923a0751f312e008ad92.tar.gz
src-42b0b7a926e3e4834dda923a0751f312e008ad92.zip
stand/efi/eficom: Don't allow this for !HYPERV machines
If the machine isn't hyperv on amd64, then this driver fails the probe and will do nothing further now, even if explicitly listed in a config. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40221
-rw-r--r--stand/efi/libefi/eficom.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c
index ca08458c2ca2..586202efee00 100644
--- a/stand/efi/libefi/eficom.c
+++ b/stand/efi/libefi/eficom.c
@@ -254,6 +254,11 @@ comc_get_con_serial_handle(const char *name)
return (NULL);
}
+/*
+ * Called from cons_probe() to see if this device is available.
+ * Return immediately on x86, except for hyperv, since it interferes with
+ * common configurations otherwise (yes, this is just firewalling the bug).
+ */
static void
comc_probe(struct console *sc)
{
@@ -265,6 +270,18 @@ comc_probe(struct console *sc)
char *env, *buf, *ep;
size_t sz;
+#ifdef __amd64__
+ /*
+ * This driver tickles issues on a number of different firmware loads.
+ * It is only required for HyperV, and is only known to work on HyperV,
+ * so only allow it on HyperV.
+ */
+ env = getenv("smbios.bios.version");
+ if (env == NULL || strncmp(env, "Hyper-V", 7) != 0) {
+ return;
+ }
+#endif
+
if (comc_port == NULL) {
comc_port = calloc(1, sizeof (struct serial));
if (comc_port == NULL)