git: 34f7ebd56319 - stable/14 - vt/sc: retire logic to select vt(4) by default for UEFI boot

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Thu, 01 Aug 2024 16:11:23 UTC
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=34f7ebd56319c909f6b05ce0273b688074345c66

commit 34f7ebd56319c909f6b05ce0273b688074345c66
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-05-24 21:36:09 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-08-01 16:10:26 +0000

    vt/sc: retire logic to select vt(4) by default for UEFI boot
    
    We previously defaulted to using sc(4) with a special case to prefer
    vt(4) when booted via UEFI.  As vt(4) is now always the default we can
    simplify this.
    
    Reviewed by:    imp, kevans
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D45356
    
    (cherry picked from commit 9b1de7e4844d951a7d7335cbde75a86a2380e220)
---
 sys/amd64/amd64/machdep.c |  9 ---------
 sys/kern/kern_cons.c      | 18 ------------------
 sys/sys/cons.h            |  1 -
 3 files changed, 28 deletions(-)

diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index ea440f46a12f..f5c49c6ca243 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1465,15 +1465,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 	r_idt.rd_base = (long) idt;
 	lidt(&r_idt);
 
-	/*
-	 * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
-	 * transition).
-	 * Once bootblocks have updated, we can test directly for
-	 * efi_systbl != NULL here...
-	 */
-	if (efi_boot)
-		vty_set_preferred(VTY_VT);
-
 	TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable);
 	TUNABLE_INT_FETCH("machdep.mitigations.ibrs.disable", &hw_ibrs_disable);
 
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index 24952561449b..2b28c51984e1 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -715,7 +715,6 @@ sysbeep(int pitch __unused, sbintime_t duration __unused)
 /*
  * Temporary support for sc(4) to vt(4) transition.
  */
-static unsigned vty_prefer;
 static char vty_name[16];
 SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name,
     0, "Console vty driver");
@@ -740,10 +739,6 @@ vty_enabled(unsigned vty)
 				break;
 			}
 #endif
-			if (vty_prefer != 0) {
-				vty_selected = vty_prefer;
-				break;
-			}
 #if defined(DEV_VT)
 			vty_selected = VTY_VT;
 #elif defined(DEV_SC)
@@ -758,16 +753,3 @@ vty_enabled(unsigned vty)
 	}
 	return ((vty_selected & vty) != 0);
 }
-
-void
-vty_set_preferred(unsigned vty)
-{
-
-	vty_prefer = vty;
-#if !defined(DEV_SC)
-	vty_prefer &= ~VTY_SC;
-#endif
-#if !defined(DEV_VT)
-	vty_prefer &= ~VTY_VT;
-#endif
-}
diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index 5ad85a516dc5..75dc66aa252f 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -145,7 +145,6 @@ int	constty_clear(struct tty *tp);
 #define	VTY_SC 0x01
 #define	VTY_VT 0x02
 int	vty_enabled(unsigned int);
-void	vty_set_preferred(unsigned int);
 
 #endif /* _KERNEL */