diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-05-25 08:11:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-05-25 08:11:28 +0200 |
commit | 675c00c3325723751864cc5867d736c58633cf3d (patch) | |
tree | 1532b10be02615140ab9460a471294f651c4ab88 /arch/arm64/include | |
parent | 99c12749b172758f6973fc023484f2fc8b91cd5a (diff) | |
parent | b50694381cfc22dce3a60a291cdae294a5e5777c (diff) | |
download | linux-675c00c3325723751864cc5867d736c58633cf3d.tar.gz linux-675c00c3325723751864cc5867d736c58633cf3d.tar.bz2 linux-675c00c3325723751864cc5867d736c58633cf3d.zip |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/kvm_mmu.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index 082110993647..6128992c2ded 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -360,6 +360,22 @@ static inline unsigned int kvm_get_vmid_bits(void) return (cpuid_feature_extract_unsigned_field(reg, ID_AA64MMFR1_VMIDBITS_SHIFT) == 2) ? 16 : 8; } +/* + * We are not in the kvm->srcu critical section most of the time, so we take + * the SRCU read lock here. Since we copy the data from the user page, we + * can immediately drop the lock again. + */ +static inline int kvm_read_guest_lock(struct kvm *kvm, + gpa_t gpa, void *data, unsigned long len) +{ + int srcu_idx = srcu_read_lock(&kvm->srcu); + int ret = kvm_read_guest(kvm, gpa, data, len); + + srcu_read_unlock(&kvm->srcu, srcu_idx); + + return ret; +} + #ifdef CONFIG_KVM_INDIRECT_VECTORS /* * EL2 vectors can be mapped and rerouted in a number of ways, |