aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/kvm_mmu.h1
-rw-r--r--arch/arm/kvm/mmu.c8
-rw-r--r--arch/arm64/include/asm/kvm_mmu.h1
3 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 77de4a41cc50..2d122adcdb22 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -140,6 +140,7 @@ static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva,
140} 140}
141 141
142#define kvm_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l)) 142#define kvm_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l))
143#define kvm_virt_to_phys(x) virt_to_idmap((unsigned long)(x))
143 144
144#endif /* !__ASSEMBLY__ */ 145#endif /* !__ASSEMBLY__ */
145 146
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 580906989db1..659db0ed1370 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -916,9 +916,9 @@ int kvm_mmu_init(void)
916{ 916{
917 int err; 917 int err;
918 918
919 hyp_idmap_start = virt_to_phys(__hyp_idmap_text_start); 919 hyp_idmap_start = kvm_virt_to_phys(__hyp_idmap_text_start);
920 hyp_idmap_end = virt_to_phys(__hyp_idmap_text_end); 920 hyp_idmap_end = kvm_virt_to_phys(__hyp_idmap_text_end);
921 hyp_idmap_vector = virt_to_phys(__kvm_hyp_init); 921 hyp_idmap_vector = kvm_virt_to_phys(__kvm_hyp_init);
922 922
923 if ((hyp_idmap_start ^ hyp_idmap_end) & PAGE_MASK) { 923 if ((hyp_idmap_start ^ hyp_idmap_end) & PAGE_MASK) {
924 /* 924 /*
@@ -945,7 +945,7 @@ int kvm_mmu_init(void)
945 */ 945 */
946 kvm_flush_dcache_to_poc(init_bounce_page, len); 946 kvm_flush_dcache_to_poc(init_bounce_page, len);
947 947
948 phys_base = virt_to_phys(init_bounce_page); 948 phys_base = kvm_virt_to_phys(init_bounce_page);
949 hyp_idmap_vector += phys_base - hyp_idmap_start; 949 hyp_idmap_vector += phys_base - hyp_idmap_start;
950 hyp_idmap_start = phys_base; 950 hyp_idmap_start = phys_base;
951 hyp_idmap_end = phys_base + len; 951 hyp_idmap_end = phys_base + len;
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 680f74e67497..7f1f9408ff66 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -136,6 +136,7 @@ static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva,
136} 136}
137 137
138#define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l)) 138#define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l))
139#define kvm_virt_to_phys(x) __virt_to_phys((unsigned long)(x))
139 140
140#endif /* __ASSEMBLY__ */ 141#endif /* __ASSEMBLY__ */
141#endif /* __ARM64_KVM_MMU_H__ */ 142#endif /* __ARM64_KVM_MMU_H__ */