Skip to content

Commit

Permalink
x86 boot_param: add page_offset_base
Browse files Browse the repository at this point in the history
rhel 7.5 and later kernels have a page_offset_base that is
not always 0xffff880000000000, we need to know where it is

Change-Id: I10b5bf2e054c221aa3f899b34fd47326382cef0b
  • Loading branch information
Dominique Martinet authored and bgerofi committed Dec 11, 2019
1 parent 8fe8607 commit 7612483
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cokernel/smp/x86_64/bootparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ struct smp_boot_param {
unsigned long multi_intr_mode_addr;
unsigned long mckernel_do_futex;
unsigned long linux_kernel_pgt_phys;
unsigned long page_offset_base;

unsigned long dma_address;
unsigned long ident_table;
Expand Down
2 changes: 2 additions & 0 deletions cokernel/smp/x86_64/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern void init_boot_processor_local(void);
extern struct ihk_kmsg_buf *kmsg_buf;
extern int no_turbo;

unsigned long linux_page_offset_base;
unsigned long x86_kernel_phys_base;
unsigned long ap_trampoline = 0;
unsigned int ihk_ikc_irq = 0;
Expand All @@ -49,6 +50,7 @@ void arch_start(unsigned long param_addr, unsigned long phys_address,
ihk_ikc_irq = boot_param->ihk_ikc_irq;
bootstrap_mem_end = boot_param->bootstrap_mem_end;
boot_param_size = boot_param->param_size;
linux_page_offset_base = boot_param->page_offset_base;

/* Set up initial (temporary) stack */
asm volatile("movq %0, %%rsp" : : "r" (stack + sizeof(stack)));
Expand Down
1 change: 1 addition & 0 deletions linux/driver/smp/arch/x86_64/smp-arch-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ void smp_ihk_setup_trampoline(void *priv)
os->param->ihk_ikc_irq = ihk_smp_irq;
#endif // IHK_IKC_USE_LINUX_WORK_IRQ

os->param->page_offset_base = page_offset_base;
os->param->linux_kernel_pgt_phys = __pa(&_init_level4_pgt[0]);
dprintf("%s: Linux kernel init PT: 0x%lx, phys: 0x%lx\n", __func__,
&_init_level4_pgt[0], os->param->linux_kernel_pgt_phys);
Expand Down

0 comments on commit 7612483

Please sign in to comment.