From 4040902dbc8c2ffe9bd99d563daf6b0ca714b6a3 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Fri, 21 Jan 2022 15:49:59 -0800 Subject: [PATCH] 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 --- README.md | 2 +- init/main.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe21ba1df785bb..c7026d4bfc0666 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ Contains patches for: * virtio-iommu from https://jpbrucker.net/git/linux/log/?h=virtio-iommu/acpi (7616abe11cd1e0224bbd150626564db70bb07c31) * Support for virtio-watchdog * Bug fix: to support using ACPI reboot rather than EFI reboot - +* Log boot time via debug port `0x80` on x86 (details: https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/debug-port.md) diff --git a/init/main.c b/init/main.c index bcd132d4e7bddf..1f4a209cad6a6d 100644 --- a/init/main.c +++ b/init/main.c @@ -935,6 +935,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(); @@ -1528,6 +1532,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)