From 17bbd12ee03047864f508d539e58974b4f677504 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw@amazon.co.uk>
Date: Sat, 4 Feb 2023 15:20:24 +0000
Subject: [PATCH] parallel debug

---
 arch/x86/kernel/head_64.S | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 656e6018b9d43..35a2ad6db27d2 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -281,6 +281,15 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL)
 
 .Lsetup_AP:
 	/* EDX contains the APICID of the current CPU */
+#if 0
+	/* Test hack: Print APIC ID and then CPU# when we find it. */
+	mov	%edx, %ecx
+	mov	%edx, %eax
+	addb	$'A', %al
+	mov	$0x3f8, %dx
+	outb    %al, %dx
+	mov	%ecx, %edx
+#endif
 	xorl	%ecx, %ecx
 	leaq	cpuid_to_apicid(%rip), %rbx
 
@@ -292,6 +301,14 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL)
 	jmp	.Lfind_cpunr
 
 .Linit_cpu_data:
+#if 0
+	mov	%rcx, %rax
+	shr	$3, %rax
+	addb	$'a', %al
+
+	mov	$0x3f8, %dx
+	outb    %al, %dx
+#endif
 	/* Get the per cpu offset */
 	leaq	__per_cpu_offset(%rip), %rbx
 	addq	%rcx, %rbx
-- 
2.49.0