On 17/01/2024 17:38, Carlo Nonato wrote:
Hi Julien

Hi Carlo,

On Tue, Jan 16, 2024 at 3:37 PM Julien Grall <[email protected]> wrote:

From: Julien Grall <[email protected]>

In order to confirm the early boot code is self-contained, allocate a
separate trampoline region for secondary to boot from it.


[...]

@@ -304,6 +307,16 @@ smp_prepare_cpus(void)
      if ( rc )
          panic("Unable to allocate CPU sibling/core maps\n");

+    /* Create a trampoline to confirm early boot code is self-contained */
+    trampoline = alloc_xenheap_page();
+    BUG_ON(!trampoline);
+
+    memcpy(trampoline, _start, PAGE_SIZE);
+    clean_dcache_va_range(trampoline, PAGE_SIZE);
+    invalidate_icache();
+
+    printk("Trampoline 0x%lx\n", virt_to_maddr(trampoline));

Here PRIx64 is needed for arm32.

Just for clarification, none of this patch is meant to work on Arm32. In fact, this would break secondary CPUs bring up.

This is why I tagged with DO NOT COMMIT. It was only included to show I tested this code on arm32.

Cheers,

--
Julien Grall

Reply via email to