aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-06-30 13:40:46 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2016-07-03 17:41:27 -0400
commit26781f9ce16801a9c680dae1a7c1ca2fd3d112bd (patch)
tree1a2cde1e17110ea2be33b1221ca63dded101bccf /arch
parent12fda8123d74903d1f65fb006fe4964e23ede0d1 (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/kvm_mmu.h1
-rw-r--r--arch/arm/kvm/arm.c4
-rw-r--r--arch/arm/kvm/mmu.c30
-rw-r--r--arch/arm64/include/asm/kvm_mmu.h1
4 files changed, 7 insertions, 29 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 5d161d13b471..d5fd9fb8550b 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -51,7 +51,6 @@
51 51
52int create_hyp_mappings(void *from, void *to, pgprot_t prot); 52int create_hyp_mappings(void *from, void *to, pgprot_t prot);
53int create_hyp_io_mappings(void *from, void *to, phys_addr_t); 53int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
54void free_boot_hyp_pgd(void);
55void free_hyp_pgds(void); 54void free_hyp_pgds(void);
56 55
57void stage2_unmap_vm(struct kvm *kvm); 56void stage2_unmap_vm(struct kvm *kvm);
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 0887cc12b401..9b8c53798f50 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -1323,10 +1323,6 @@ static int init_hyp_mode(void)
1323 } 1323 }
1324 } 1324 }
1325 1325
1326#ifndef CONFIG_HOTPLUG_CPU
1327 free_boot_hyp_pgd();
1328#endif
1329
1330 /* set size of VMID supported by CPU */ 1326 /* set size of VMID supported by CPU */
1331 kvm_vmid_bits = kvm_get_vmid_bits(); 1327 kvm_vmid_bits = kvm_get_vmid_bits();
1332 kvm_info("%d-bit VMID\n", kvm_vmid_bits); 1328 kvm_info("%d-bit VMID\n", kvm_vmid_bits);
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index dd4ccc7f7baf..0b36dd52af62 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -482,27 +482,6 @@ static void unmap_hyp_range(pgd_t *pgdp, phys_addr_t start, u64 size)
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 */
489void 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 * free_hyp_pgds - free Hyp-mode page tables 485 * free_hyp_pgds - free Hyp-mode page tables
507 * 486 *
508 * Assumes hyp_pgd is a page table used strictly in Hyp-mode and 487 * Assumes hyp_pgd is a page table used strictly in Hyp-mode and
@@ -516,11 +495,16 @@ void free_hyp_pgds(void)
516{ 495{
517 unsigned long addr; 496 unsigned long addr;
518 497
519 free_boot_hyp_pgd();
520
521 mutex_lock(&kvm_hyp_pgd_mutex); 498 mutex_lock(&kvm_hyp_pgd_mutex);
522 499
500 if (boot_hyp_pgd) {
501 unmap_hyp_range(boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE);
502 free_pages((unsigned long)boot_hyp_pgd, hyp_pgd_order);
503 boot_hyp_pgd = NULL;
504 }
505
523 if (hyp_pgd) { 506 if (hyp_pgd) {
507 unmap_hyp_range(hyp_pgd, hyp_idmap_start, PAGE_SIZE);
524 for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE) 508 for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
525 unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); 509 unmap_hyp_range(hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
526 for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE) 510 for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 390acabdb1b2..b89122ed827d 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -156,7 +156,6 @@ static inline unsigned long __kern_hyp_va(unsigned long v)
156 156
157int create_hyp_mappings(void *from, void *to, pgprot_t prot); 157int create_hyp_mappings(void *from, void *to, pgprot_t prot);
158int create_hyp_io_mappings(void *from, void *to, phys_addr_t); 158int create_hyp_io_mappings(void *from, void *to, phys_addr_t);
159void free_boot_hyp_pgd(void);
160void free_hyp_pgds(void); 159void free_hyp_pgds(void);
161 160
162void stage2_unmap_vm(struct kvm *kvm); 161void stage2_unmap_vm(struct kvm *kvm);