diff options
Diffstat (limited to 'arch/arm/include/asm/kvm_mmu.h')
-rw-r--r-- | arch/arm/include/asm/kvm_mmu.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 707a1f06dc5d..f675162663f0 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h | |||
@@ -309,6 +309,22 @@ static inline unsigned int kvm_get_vmid_bits(void) | |||
309 | return 8; | 309 | return 8; |
310 | } | 310 | } |
311 | 311 | ||
312 | /* | ||
313 | * We are not in the kvm->srcu critical section most of the time, so we take | ||
314 | * the SRCU read lock here. Since we copy the data from the user page, we | ||
315 | * can immediately drop the lock again. | ||
316 | */ | ||
317 | static inline int kvm_read_guest_lock(struct kvm *kvm, | ||
318 | gpa_t gpa, void *data, unsigned long len) | ||
319 | { | ||
320 | int srcu_idx = srcu_read_lock(&kvm->srcu); | ||
321 | int ret = kvm_read_guest(kvm, gpa, data, len); | ||
322 | |||
323 | srcu_read_unlock(&kvm->srcu, srcu_idx); | ||
324 | |||
325 | return ret; | ||
326 | } | ||
327 | |||
312 | static inline void *kvm_get_hyp_vector(void) | 328 | static inline void *kvm_get_hyp_vector(void) |
313 | { | 329 | { |
314 | return kvm_ksym_ref(__kvm_hyp_vector); | 330 | return kvm_ksym_ref(__kvm_hyp_vector); |