diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-10-28 01:09:14 +0100 |
---|---|---|
committer | Christoffer Dall <cdall@cs.columbia.edu> | 2013-03-06 15:48:44 -0800 |
commit | 06e8c3b0f3210e5e7039fd2b5e3926b68df7f5d7 (patch) | |
tree | 99ad1af05824cc65a5ded6764f6ef8a2eb40be17 /arch/arm/include | |
parent | 9c7a6432fb081563f084b25bbd2774b1547c4fad (diff) | |
download | blackbird-op-linux-06e8c3b0f3210e5e7039fd2b5e3926b68df7f5d7.tar.gz blackbird-op-linux-06e8c3b0f3210e5e7039fd2b5e3926b68df7f5d7.zip |
ARM: KVM: allow HYP mappings to be at an offset from kernel mappings
arm64 cannot represent the kernel VAs in HYP mode, because of the lack
of TTBR1 at EL2. A way to cope with this situation is to have HYP VAs
to be an offset from the kernel VAs.
Introduce macros to convert a kernel VA to a HYP VA, make the HYP
mapping functions use these conversion macros. Also change the
documentation to reflect the existence of the offset.
On ARM, where we can have an identity mapping between kernel and HYP,
the macros are without any effect.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/kvm_mmu.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index ac784937cc0f..3c71a1d4b7a3 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -22,6 +22,14 @@ #include <asm/cacheflush.h> #include <asm/pgalloc.h> +/* + * We directly use the kernel VA for the HYP, as we can directly share + * the mapping (HTTBR "covers" TTBR1). + */ +#define HYP_PAGE_OFFSET_MASK (~0UL) +#define HYP_PAGE_OFFSET PAGE_OFFSET +#define KERN_TO_HYP(kva) (kva) + int create_hyp_mappings(void *from, void *to); int create_hyp_io_mappings(void *from, void *to, phys_addr_t); void free_hyp_pmds(void); |