Commit 0a72a5ab authored by Marc Zyngier's avatar Marc Zyngier

KVM: arm/arm64: Remove unnecessary CMOs when creating HYP page tables

There is no need to perform cache maintenance operations when
creating the HYP page tables if we have the multiprocessing
extensions. ARMv7 mandates them with the virtualization support,
and ARMv8 just mandates them unconditionally.

Let's remove these operations.
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarChristoffer Dall <christoffer.dall@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 0db9dd8a
...@@ -609,7 +609,6 @@ static void create_hyp_pte_mappings(pmd_t *pmd, unsigned long start, ...@@ -609,7 +609,6 @@ static void create_hyp_pte_mappings(pmd_t *pmd, unsigned long start,
pte = pte_offset_kernel(pmd, addr); pte = pte_offset_kernel(pmd, addr);
kvm_set_pte(pte, pfn_pte(pfn, prot)); kvm_set_pte(pte, pfn_pte(pfn, prot));
get_page(virt_to_page(pte)); get_page(virt_to_page(pte));
kvm_flush_dcache_to_poc(pte, sizeof(*pte));
pfn++; pfn++;
} while (addr += PAGE_SIZE, addr != end); } while (addr += PAGE_SIZE, addr != end);
} }
...@@ -636,7 +635,6 @@ static int create_hyp_pmd_mappings(pud_t *pud, unsigned long start, ...@@ -636,7 +635,6 @@ static int create_hyp_pmd_mappings(pud_t *pud, unsigned long start,
} }
kvm_pmd_populate(pmd, pte); kvm_pmd_populate(pmd, pte);
get_page(virt_to_page(pmd)); get_page(virt_to_page(pmd));
kvm_flush_dcache_to_poc(pmd, sizeof(*pmd));
} }
next = pmd_addr_end(addr, end); next = pmd_addr_end(addr, end);
...@@ -669,7 +667,6 @@ static int create_hyp_pud_mappings(pgd_t *pgd, unsigned long start, ...@@ -669,7 +667,6 @@ static int create_hyp_pud_mappings(pgd_t *pgd, unsigned long start,
} }
kvm_pud_populate(pud, pmd); kvm_pud_populate(pud, pmd);
get_page(virt_to_page(pud)); get_page(virt_to_page(pud));
kvm_flush_dcache_to_poc(pud, sizeof(*pud));
} }
next = pud_addr_end(addr, end); next = pud_addr_end(addr, end);
...@@ -706,7 +703,6 @@ static int __create_hyp_mappings(pgd_t *pgdp, unsigned long ptrs_per_pgd, ...@@ -706,7 +703,6 @@ static int __create_hyp_mappings(pgd_t *pgdp, unsigned long ptrs_per_pgd,
} }
kvm_pgd_populate(pgd, pud); kvm_pgd_populate(pgd, pud);
get_page(virt_to_page(pgd)); get_page(virt_to_page(pgd));
kvm_flush_dcache_to_poc(pgd, sizeof(*pgd));
} }
next = pgd_addr_end(addr, end); next = pgd_addr_end(addr, end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment