diff options
author | Blagovest Kolenichev <bkolenichev@codeaurora.org> | 2017-05-02 06:15:44 -0700 |
---|---|---|
committer | Blagovest Kolenichev <bkolenichev@codeaurora.org> | 2017-05-02 06:40:36 -0700 |
commit | 95a027ead7d44a2c80ebeccdc0f70317e1712dbf (patch) | |
tree | fba231afc19db0ec66f67c46b42e7b71d0b6a7b3 /arch/arm/kvm | |
parent | f1a10f1598632dc7ab10b369083a21ff68b8398b (diff) | |
parent | e4528dd775e8b236c0880895ae39ba8d1bce09e8 (diff) |
Merge branch 'android-4.4@e4528dd' into branch 'msm-4.4'
* refs/heads/tmp-e4528dd:
Linux 4.4.65
perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
ping: implement proper locking
staging/android/ion : fix a race condition in the ion driver
vfio/pci: Fix integer overflows, bitmask check
tipc: check minimum bearer MTU
netfilter: nfnetlink: correctly validate length of batch messages
xc2028: avoid use after free
mnt: Add a per mount namespace limit on the number of mounts
tipc: fix socket timer deadlock
tipc: fix random link resets while adding a second bearer
gfs2: avoid uninitialized variable warning
hostap: avoid uninitialized variable use in hfa384x_get_rid
tty: nozomi: avoid a harmless gcc warning
tipc: correct error in node fsm
tipc: re-enable compensation for socket receive buffer double counting
tipc: make dist queue pernet
tipc: make sure IPv6 header fits in skb headroom
ANDROID: uid_sys_stats: fix access of task_uid(task)
BACKPORT: f2fs: sanity check log_blocks_per_seg
Linux 4.4.64
tipc: fix crash during node removal
block: fix del_gendisk() vs blkdev_ioctl crash
x86, pmem: fix broken __copy_user_nocache cache-bypass assumptions
hv: don't reset hv_context.tsc_page on crash
Drivers: hv: balloon: account for gaps in hot add regions
Drivers: hv: balloon: keep track of where ha_region starts
Tools: hv: kvp: ensure kvp device fd is closed on exec
kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd
x86/mce/AMD: Give a name to MCA bank 3 when accessed with legacy MSRs
powerpc/kprobe: Fix oops when kprobed on 'stdu' instruction
ubi/upd: Always flush after prepared for an update
mac80211: reject ToDS broadcast data frames
mmc: sdhci-esdhc-imx: increase the pad I/O drive strength for DDR50 card
ACPI / power: Avoid maybe-uninitialized warning
Input: elantech - add Fujitsu Lifebook E547 to force crc_enabled
VSOCK: Detach QP check should filter out non matching QPs.
Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg()
Drivers: hv: get rid of timeout in vmbus_open()
Drivers: hv: don't leak memory in vmbus_establish_gpadl()
s390/mm: fix CMMA vs KSM vs others
CIFS: remove bad_network_name flag
cifs: Do not send echoes before Negotiate is complete
ring-buffer: Have ring_buffer_iter_empty() return true when empty
tracing: Allocate the snapshot buffer before enabling probe
KEYS: fix keyctl_set_reqkey_keyring() to not leak thread keyrings
KEYS: Change the name of the dead type to ".dead" to prevent user access
KEYS: Disallow keyrings beginning with '.' to be joined as session keyrings
ANDROID: sdcardfs: Call lower fs's revalidate
ANDROID: sdcardfs: Avoid setting GIDs outside of valid ranges
ANDROID: sdcardfs: Copy meta-data from lower inode
Revert "Revert "Android: sdcardfs: Don't do d_add for lower fs""
ANDROID: sdcardfs: Use filesystem specific hash
ANDROID: AVB error handler to invalidate vbmeta partition.
ANDROID: Update init/do_mounts_dm.c to the latest ChromiumOS version.
Revert "[RFC]cgroup: Change from CAP_SYS_NICE to CAP_SYS_RESOURCE for cgroup migration permissions"
Conflicts:
drivers/md/Makefile
Change-Id: I8f5ed53cb8b6cc66914f10c6ac820003b87b8759
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/mmu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index dd7f20a490c8..33ee522bb76f 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -301,6 +301,14 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp, next = kvm_pgd_addr_end(addr, end); if (!pgd_none(*pgd)) unmap_puds(kvm, pgd, addr, next); + /* + * If we are dealing with a large range in + * stage2 table, release the kvm->mmu_lock + * to prevent starvation and lockup detector + * warnings. + */ + if (kvm && (next != end)) + cond_resched_lock(&kvm->mmu_lock); } while (pgd++, addr = next, addr != end); } @@ -745,6 +753,7 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm) */ static void unmap_stage2_range(struct kvm *kvm, phys_addr_t start, u64 size) { + assert_spin_locked(&kvm->mmu_lock); unmap_range(kvm, kvm->arch.pgd, start, size); } @@ -831,7 +840,10 @@ void kvm_free_stage2_pgd(struct kvm *kvm) if (kvm->arch.pgd == NULL) return; + spin_lock(&kvm->mmu_lock); unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE); + spin_unlock(&kvm->mmu_lock); + kvm_free_hwpgd(kvm_get_hwpgd(kvm)); if (KVM_PREALLOC_LEVEL > 0) kfree(kvm->arch.pgd); |