move McKernel out of Linux kernel virtual

Cherry-pick of 88a8277f17da62d349b4340b66d37482344db649
This commit is contained in:
Balazs Gerofi
2018-02-19 10:41:12 +09:00
parent 86ae1380e4
commit cfbab0ee82
3 changed files with 41 additions and 4 deletions

View File

@@ -191,6 +191,28 @@ static void init_normal_area(struct page_table *pt)
}
}
static void init_linux_kernel_mapping(struct page_table *pt)
{
unsigned long map_start, map_end, phys, pt_phys;
int virt_index;
map_start = 0;
/* Map 2 TB for now */
map_end = 0x20000000000;
kprintf("Linux kernel virtual: 0x%lx - 0x%lx -> 0x%lx - 0x%lx\n",
LINUX_PAGE_OFFSET, LINUX_PAGE_OFFSET + map_end, 0, map_end);
virt_index = (MAP_ST_START >> PTL4_SHIFT) & (PT_ENTRIES - 1);
for (phys = (map_start & ~(PTL4_SIZE - 1)); phys < map_end;
phys += PTL4_SIZE) {
pt_phys = setup_l3(ihk_mc_alloc_pages(1, IHK_MC_AP_CRITICAL), phys,
map_start, map_end);
pt->entry[virt_index++] = pt_phys | PFL4_PDIR_ATTR;
}
}
static struct page_table *__alloc_new_pt(ihk_mc_ap_flag ap_flag)
{
struct page_table *newpt = ihk_mc_alloc_pages(1, ap_flag);
@@ -2628,6 +2650,7 @@ void init_page_table(void)
/* Normal memory area */
init_normal_area(init_pt);
init_linux_kernel_mapping(init_pt);
init_fixed_area(init_pt);
init_low_area(init_pt);
init_text_area(init_pt);