Skip to content

Commit cc6c5f4

Browse files
likebreathrbradford
authored andcommitted
init/main: Add trace points for logging boot time on x86
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]>
1 parent 62b9b48 commit cc6c5f4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Contains patches for:
55
* virtio-iommu from https://jpbrucker.net/git/linux/log/?h=virtio-iommu/acpi (7616abe11cd1e0224bbd150626564db70bb07c31)
66
* Support for virtio-watchdog
77
* Bug fix: to support using ACPI reboot rather than EFI reboot
8-
8+
* Log boot time via debug port `0x80` on x86 (details: https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/debug-port.md)

init/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,10 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
935935
char *command_line;
936936
char *after_dashes;
937937

938+
#ifdef CONFIG_X86
939+
outb(0x40, 0x80);
940+
#endif
941+
938942
set_task_stack_end_magic(&init_task);
939943
smp_setup_processor_id();
940944
debug_objects_early_init();
@@ -1528,6 +1532,10 @@ static int __ref kernel_init(void *unused)
15281532

15291533
do_sysctl_args();
15301534

1535+
#ifdef CONFIG_X86
1536+
outb(0x41, 0x80);
1537+
#endif
1538+
15311539
if (ramdisk_execute_command) {
15321540
ret = run_init_process(ramdisk_execute_command);
15331541
if (!ret)

0 commit comments

Comments
 (0)