Skip to content

Commit

Permalink
vt/sc: retire logic to select vt(4) by default for UEFI boot
Browse files Browse the repository at this point in the history
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
  • Loading branch information
emaste committed May 25, 2024
1 parent 02d1521 commit 9b1de7e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
9 changes: 0 additions & 9 deletions sys/amd64/amd64/machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,15 +1464,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);

Expand Down
18 changes: 0 additions & 18 deletions sys/kern/kern_cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,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");
Expand All @@ -762,10 +761,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)
Expand All @@ -780,16 +775,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
}
1 change: 0 additions & 1 deletion sys/sys/cons.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 9b1de7e

Please sign in to comment.