aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_linux.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-06 13:37:58 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-06 13:38:53 +0100
commitfd2a5f28eb5e2b7c83b5e814f53e44e2a5dde24c (patch)
tree3db98c79b3220c44faa6ec98fda13eb594c4ed1e /executor/executor_linux.h
parent7fb694ef82d4dace30cf68efba5a6af705c94fa4 (diff)
executor: prevent "NMI handler took too long" messages
nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels. It happens a lot in qemu, and the messages are frequently corrupted (intermixed with other kernel output as they are printed from NMI) and are not matched against the suppression in pkg/report. This write prevents these messages from being printed.
Diffstat (limited to 'executor/executor_linux.h')
-rw-r--r--executor/executor_linux.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/executor/executor_linux.h b/executor/executor_linux.h
index 63c900c5a..d4220c23f 100644
--- a/executor/executor_linux.h
+++ b/executor/executor_linux.h
@@ -225,3 +225,15 @@ static feature_t features[] = {
{"binfmt_misc", setup_binfmt_misc},
{"kcsan", setup_kcsan},
};
+
+static void setup_machine()
+{
+ // nmi_check_duration() prints "INFO: NMI handler took too long" on slow debug kernels.
+ // It happens a lot in qemu, and the messages are frequently corrupted
+ // (intermixed with other kernel output as they are printed from NMI)
+ // and are not matched against the suppression in pkg/report.
+ // This write prevents these messages from being printed.
+ // Note: this is not executed in C reproducers.
+ if (!write_file("/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"))
+ printf("write to /sys/kernel/debug/x86/nmi_longest_ns failed: %s\n", strerror(errno));
+}