Skip to content

Instantly share code, notes, and snippets.

@sboeuf
Created September 24, 2020 08:00
Show Gist options
  • Save sboeuf/ce83b90fbaf58bf4e75ec4358419ba42 to your computer and use it in GitHub Desktop.
Save sboeuf/ce83b90fbaf58bf4e75ec4358419ba42 to your computer and use it in GitHub Desktop.
Patch instrumenting the guest kernel
diff --git a/init/main.c b/init/main.c
index 0ead83e86b5a..d040c58bf8cd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -832,6 +832,8 @@ asmlinkage __visible void __init start_kernel(void)
char *command_line;
char *after_dashes;
+ outb(6, 0xf4);
+
set_task_stack_end_magic(&init_task);
smp_setup_processor_id();
debug_objects_early_init();
@@ -1416,6 +1418,8 @@ static int __ref kernel_init(void *unused)
do_sysctl_args();
+ outb(7, 0xf4);
+
if (ramdisk_execute_command) {
ret = run_init_process(ramdisk_execute_command);
if (!ret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment