Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm/arm64: KVM: Kill free_boot_hyp_pgd

There is no way to free the boot PGD, because it doesn't exist
anymore as a standalone entity.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

authored by

Marc Zyngier and committed by
Christoffer Dall
26781f9c 12fda812

+7 -29
-1
arch/arm/include/asm/kvm_mmu.h
··· 51 51 52 52 int create_hyp_mappings(void *from, void *to, pgprot_t prot); 53 53 int create_hyp_io_mappings(void *from, void *to, phys_addr_t); 54 - void free_boot_hyp_pgd(void); 55 54 void free_hyp_pgds(void); 56 55 57 56 void stage2_unmap_vm(struct kvm *kvm);
-4
arch/arm/kvm/arm.c
··· 1323 1323 } 1324 1324 } 1325 1325 1326 - #ifndef CONFIG_HOTPLUG_CPU 1327 - free_boot_hyp_pgd(); 1328 - #endif 1329 - 1330 1326 /* set size of VMID supported by CPU */ 1331 1327 kvm_vmid_bits = kvm_get_vmid_bits(); 1332 1328 kvm_info("%d-bit VMID\n", kvm_vmid_bits);
+7 -23
arch/arm/kvm/mmu.c
··· 482 482 } 483 483 484 484 /** 485 - * free_boot_hyp_pgd - free HYP boot page tables 486 - * 487 - * Free the HYP boot page tables. The bounce page is also freed. 488 - */ 489 - void free_boot_hyp_pgd(void) 490 - { 491 - mutex_lock(&kvm_hyp_pgd_mutex); 492 - 493 - if (boot_hyp_pgd) { 494 - unmap_hyp_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); 495 - free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order); 496 - boot_hyp_pgd = NULL; 497 - } 498 - 499 - if (hyp_pgd) 500 - unmap_hyp_range(hyp_pgd, hyp_idmap_start, PAGE_SIZE); 501 - 502 - mutex_unlock(&kvm_hyp_pgd_mutex); 503 - } 504 - 505 - /** 506 485 * free_hyp_pgds - free Hyp-mode page tables 507 486 * 508 487 * Assumes hyp_pgd is a page table used strictly in Hyp-mode and ··· 495 516 { 496 517 unsigned long addr; 497 518 498 - free_boot_hyp_pgd(); 499 - 500 519 mutex_lock(&kvm_hyp_pgd_mutex); 501 520 521 + if (boot_hyp_pgd) { 522 + unmap_hyp_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); 523 + free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order); 524 + boot_hyp_pgd = NULL; 525 + } 526 + 502 527 if (hyp_pgd) { 528 + unmap_hyp_range(hyp_pgd, hyp_idmap_start, PAGE_SIZE); 503 529 for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE) 504 530 unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 505 531 for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
-1
arch/arm64/include/asm/kvm_mmu.h
··· 156 156 157 157 int create_hyp_mappings(void *from, void *to, pgprot_t prot); 158 158 int create_hyp_io_mappings(void *from, void *to, phys_addr_t); 159 - void free_boot_hyp_pgd(void); 160 159 void free_hyp_pgds(void); 161 160 162 161 void stage2_unmap_vm(struct kvm *kvm);