Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 933ad66d authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: Add page tables additively when paging hotplug memory"

parents 8b1bf25c 4f350f1e
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -695,27 +695,11 @@ void __init paging_init(void)
 */
void hotplug_paging(phys_addr_t start, phys_addr_t size)
{

	struct page *pg;
	phys_addr_t pgd_phys = pgd_pgtable_alloc();
	pgd_t *pgd = pgd_set_fixmap(pgd_phys);
	int flags;

	memcpy(pgd, swapper_pg_dir, PAGE_SIZE);
	flags = debug_pagealloc_enabled() ? NO_BLOCK_MAPPINGS : 0;

	__create_pgd_mapping(pgd, start, __phys_to_virt(start), size,
	__create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start), size,
		PAGE_KERNEL, pgd_pgtable_alloc, flags);

	cpu_replace_ttbr1(__va(pgd_phys));
	memcpy(swapper_pg_dir, pgd, PAGE_SIZE);
	cpu_replace_ttbr1(swapper_pg_dir);

	pgd_clear_fixmap();

	pg = phys_to_page(pgd_phys);
	pgtable_page_dtor(pg);
	__free_pages(pg, 0);
}

#ifdef CONFIG_MEMORY_HOTREMOVE