diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-10-28 08:15:55 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-10-28 08:15:55 -0400 |
commit | 5bb3398dd2df2c26261b2156c98cf4c95b3f91fe (patch) | |
tree | 526d914e0e1cc62249b4a0d2fea31558cc17fcd7 /arch/arm64 | |
parent | e0230e1327fb862c9b6cde24ae62d55f9db62c9b (diff) | |
parent | 9b5fdb9781f74fb15827e465bfb5aa63211953c8 (diff) |
Merge tag 'kvm-arm-for-3.13-2' of git://git.linaro.org/people/cdall/linux-kvm-arm into kvm-queue
Updates for KVM/ARM, take 2 including:
- Transparent Huge Pages and hugetlbfs support for KVM/ARM
- Yield CPU when guest executes WFE to speed up CPU overcommit
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/kvm_mmu.h | 12 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable-hwdef.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index efe609c6a3c9..680f74e67497 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h | |||
@@ -91,6 +91,7 @@ int kvm_mmu_init(void); | |||
91 | void kvm_clear_hyp_idmap(void); | 91 | void kvm_clear_hyp_idmap(void); |
92 | 92 | ||
93 | #define kvm_set_pte(ptep, pte) set_pte(ptep, pte) | 93 | #define kvm_set_pte(ptep, pte) set_pte(ptep, pte) |
94 | #define kvm_set_pmd(pmdp, pmd) set_pmd(pmdp, pmd) | ||
94 | 95 | ||
95 | static inline bool kvm_is_write_fault(unsigned long esr) | 96 | static inline bool kvm_is_write_fault(unsigned long esr) |
96 | { | 97 | { |
@@ -116,13 +117,18 @@ static inline void kvm_set_s2pte_writable(pte_t *pte) | |||
116 | pte_val(*pte) |= PTE_S2_RDWR; | 117 | pte_val(*pte) |= PTE_S2_RDWR; |
117 | } | 118 | } |
118 | 119 | ||
120 | static inline void kvm_set_s2pmd_writable(pmd_t *pmd) | ||
121 | { | ||
122 | pmd_val(*pmd) |= PMD_S2_RDWR; | ||
123 | } | ||
124 | |||
119 | struct kvm; | 125 | struct kvm; |
120 | 126 | ||
121 | static inline void coherent_icache_guest_page(struct kvm *kvm, gfn_t gfn) | 127 | static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva, |
128 | unsigned long size) | ||
122 | { | 129 | { |
123 | if (!icache_is_aliasing()) { /* PIPT */ | 130 | if (!icache_is_aliasing()) { /* PIPT */ |
124 | unsigned long hva = gfn_to_hva(kvm, gfn); | 131 | flush_icache_range(hva, hva + size); |
125 | flush_icache_range(hva, hva + PAGE_SIZE); | ||
126 | } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */ | 132 | } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */ |
127 | /* any kind of VIPT cache */ | 133 | /* any kind of VIPT cache */ |
128 | __flush_icache_all(); | 134 | __flush_icache_all(); |
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index d57e66845c86..755f86143320 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h | |||
@@ -85,6 +85,8 @@ | |||
85 | #define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[2:1] */ | 85 | #define PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[2:1] */ |
86 | #define PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ | 86 | #define PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ |
87 | 87 | ||
88 | #define PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ | ||
89 | |||
88 | /* | 90 | /* |
89 | * Memory Attribute override for Stage-2 (MemAttr[3:0]) | 91 | * Memory Attribute override for Stage-2 (MemAttr[3:0]) |
90 | */ | 92 | */ |