Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions avf/shim/avfboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@ void avfboot_main(uint64_t fdt_pa)
if (!has_arg(pi.cmdline, "cpus=") && !has_arg(pi.cmdline, "cpumask=") &&
!has_arg(m.bootargs, "cpus=") && !has_arg(m.bootargs, "cpumask="))
cmd_append(cl, &n, "cpus=1 ");
/*
* User space quiet on the console unless asked otherwise (console_quiet=0): every console byte
* is a trap to crosvm, and launchd alone writes thousands of lines a minute (patch 1003).
*/
if (!has_arg(pi.cmdline, "console_quiet=") && !has_arg(m.bootargs, "console_quiet="))
cmd_append(cl, &n, "console_quiet=1 ");
if (rd_size && !has_arg(pi.cmdline, "rd=") && !has_arg(m.bootargs, "rd="))
cmd_append(cl, &n, "rd=md0 ");
cmd_append(cl, &n, pi.cmdline);
Expand Down
28 changes: 28 additions & 0 deletions xnu/patches/1003-avf-console-quiet.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/bsd/dev/arm/km.c b/bsd/dev/arm/km.c
index 69eacee..9e244fc 100644
--- a/bsd/dev/arm/km.c
+++ b/bsd/dev/arm/km.c
@@ -175,6 +175,23 @@ kmwrite(dev_t dev, struct uio * uio, int ioflag)
int ret;
struct tty *tp = km_tty[minor(dev)];

+ /*
+ * Boot-arg console_quiet=1: what user space writes to the console (launchd's own log, the
+ * daemons' standard error, os_log mirrored there) is dropped; the kernel's printf and panics
+ * are not written this way and still come out. Under a hypervisor every console byte is a
+ * trap to the VMM: on the Pixel (AVF), launchd's log of SpringBoard's failed lookups kept the
+ * host's console thread a quarter busy.
+ */
+ static int quiet = -1;
+ if (quiet < 0) {
+ uint32_t v = 0;
+ quiet = PE_parse_boot_argn("console_quiet", &v, sizeof(v)) && v != 0;
+ }
+ if (quiet) {
+ uio_update(uio, uio_resid(uio));
+ return 0;
+ }
+
tty_lock(tp);
ret = (*linesw[tp->t_line].l_write)(tp, uio, ioflag);
tty_unlock(tp);
Loading