diff options
| author | Venkata Rao Kakani <vkakani@codeaurora.org> | 2018-06-08 10:51:58 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-06-14 03:13:02 -0700 |
| commit | 42cadd51654236a612b08a33e699f61654c38ca8 (patch) | |
| tree | 71b2c9f874869f748aec0fdd8b121dfc1731254f | |
| parent | 9912a8c48b234943a431fc157d33d1c70356a3a0 (diff) | |
ARM: memory hotplug: stop cpus while memory hotplug
Avoid page table corruptions during memory hotplug by
stopping all other cpus.
Change-Id: I527a616c5603b882a43626c746ef0b4dda977202
Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
| -rw-r--r-- | arch/arm64/mm/mmu.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index b30bdffa3066..fc7a1c1e5d0f 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -656,10 +656,16 @@ static phys_addr_t pgd_pgtable_alloc(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); + phys_addr_t pgd_phys; + pgd_t *pgd; + int cpu; + + for_each_possible_cpu(cpu) + if (current->cpu != cpu) + sched_isolate_cpu(cpu); + pgd_phys = pgd_pgtable_alloc(); + pgd = pgd_set_fixmap(pgd_phys); memcpy(pgd, swapper_pg_dir, PAGE_SIZE); @@ -675,6 +681,9 @@ void hotplug_paging(phys_addr_t start, phys_addr_t size) pg = phys_to_page(pgd_phys); pgtable_page_dtor(pg); __free_pages(pg, 0); + for_each_possible_cpu(cpu) + if (current->cpu != cpu) + sched_unisolate_cpu_unlocked(cpu); } #ifdef CONFIG_MEMORY_HOTREMOVE |
