Skip to content

Commit 95a9f6d

Browse files
yonghuahacrnsi
authored andcommitted
hv: update the flow to get trampoline buffer in direct boot mode
Currently, memory with size of 'CONFIG_LOW_RAM_SIZE' will be allocated when 'get_direct_boot_ap_trampoline()' is called. This patch refine the implementation of of above function, it returns the base address of trampoline buffer when called, and the memory is allocated when vboot module is initialized. Tracked-On: #3992 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
1 parent c09723b commit 95a9f6d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hypervisor/boot/guest/direct_boot.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@
1111
#include <cpu.h>
1212
#include <direct_boot.h>
1313

14+
/*AP trampoline code buffer base address.*/
15+
static uint64_t ap_trampoline_buf;
16+
1417
static void init_direct_boot(void)
1518
{
16-
/* nothing to do for now */
19+
if (ap_trampoline_buf == 0UL) {
20+
ap_trampoline_buf = e820_alloc_low_memory(CONFIG_LOW_RAM_SIZE);
21+
}
1722
}
1823

1924
/* @post: return != 0UL */
2025
static uint64_t get_direct_boot_ap_trampoline(void)
2126
{
22-
return e820_alloc_low_memory(CONFIG_LOW_RAM_SIZE);
27+
return ap_trampoline_buf;
2328
}
2429

2530
static void* get_direct_boot_rsdp(void)

0 commit comments

Comments
 (0)