Skip to content

Commit

Permalink
init/main: Add trace points for logging boot time on x86
Browse files Browse the repository at this point in the history
Use debug I/O port `0x80` to log boot time for Cloud Hypervisor.
Details: https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/debug-port.md

Signed-off-by: Bo Chen <[email protected]>
  • Loading branch information
likebreath committed Mar 8, 2023
1 parent 8b33298 commit 44b63c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,10 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
char *command_line;
char *after_dashes;

#ifdef CONFIG_X86
outb(0x40, 0x80);
#endif

set_task_stack_end_magic(&init_task);
smp_setup_processor_id();
debug_objects_early_init();
Expand Down Expand Up @@ -1544,6 +1548,10 @@ static int __ref kernel_init(void *unused)

do_sysctl_args();

#ifdef CONFIG_X86
outb(0x41, 0x80);
#endif

if (ramdisk_execute_command) {
ret = run_init_process(ramdisk_execute_command);
if (!ret)
Expand Down

0 comments on commit 44b63c0

Please sign in to comment.