summaryrefslogtreecommitdiff
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2018-09-05 11:37:57 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2018-09-05 11:37:57 +0200
commit34175ba3f5b985c4c03812f010b9f19b3606965c (patch)
tree7159889ccbb0b215de32f59493ffbead19fecf96 /arch/arm/kvm
parentb4c0be8da99564a1f7f4ee56278039615c7216a0 (diff)
parent4d9339a1f0e6e288903d34020f2378d250ea3cac (diff)
Merge 4.4.154 into android-4.4-p
Changes in 4.4.154 sched/sysctl: Check user input value of sysctl_sched_time_avg Cipso: cipso_v4_optptr enter infinite loop vti6: fix PMTU caching and reporting on xmit xfrm: fix missing dst_release() after policy blocking lbcast and multicast xfrm: free skb if nlsk pointer is NULL mac80211: add stations tied to AP_VLANs during hw reconfig nl80211: Add a missing break in parse_station_flags drm/bridge: adv7511: Reset registers on hotplug scsi: libiscsi: fix possible NULL pointer dereference in case of TMF drm/imx: imx-ldb: disable LDB on driver bind drm/imx: imx-ldb: check if channel is enabled before printing warning usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs in init_controller() usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in r8a66597_queue() usb/phy: fix PPC64 build errors in phy-fsl-usb.c tools: usb: ffs-test: Fix build on big endian systems usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3' tools/power turbostat: fix -S on UP systems net: caif: Add a missing rcu_read_unlock() in caif_flow_cb qed: Fix possible race for the link state value. atl1c: reserve min skb headroom net: prevent ISA drivers from building on PPC32 can: mpc5xxx_can: check of_iomap return before use i2c: davinci: Avoid zero value of CLKH media: staging: omap4iss: Include asm/cacheflush.h after generic includes bnx2x: Fix invalid memory access in rss hash config path. net: axienet: Fix double deregister of mdio fscache: Allow cancelled operations to be enqueued cachefiles: Fix refcounting bug in backing-file read monitoring cachefiles: Wait rather than BUG'ing on "Unexpected object collision" selftests/ftrace: Add snapshot and tracing_on test case zswap: re-check zswap_is_full() after do zswap_shrink() tools/power turbostat: Read extended processor family from CPUID Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum" enic: handle mtu change for vf properly arc: fix build errors in arc/include/asm/delay.h arc: fix type warnings in arc/mm/cache.c drivers: net: lmc: fix case value for target abort error scsi: fcoe: drop frames in ELS LOGO error path scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMINATED mm/memory.c: check return value of ioremap_prot cifs: add missing debug entries for kconfig options cifs: check kmalloc before use smb3: Do not send SMB3 SET_INFO if nothing changed smb3: don't request leases in symlink creation and query btrfs: don't leak ret from do_chunk_alloc s390/kvm: fix deadlock when killed by oom ext4: check for NUL characters in extended attribute's name ext4: sysfs: print ext4_super_block fields as little-endian ext4: reset error code in ext4_find_entry in fallback arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid() KVM: arm/arm64: Skip updating PTE entry if no change KVM: arm/arm64: Skip updating PMD entry if no change x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit x86/speculation/l1tf: Fix off-by-one error when warning that system has too much RAM x86/speculation/l1tf: Suggest what to do on systems with too much RAM x86/process: Re-export start_thread() fuse: Don't access pipe->buffers without pipe_lock() fuse: fix double request_end() fuse: fix unlocked access to processing queue fuse: umount should wait for all requests fuse: Fix oops at process_init_reply() fuse: Add missed unlock_page() to fuse_readpages_fill() udl-kms: change down_interruptible to down udl-kms: handle allocation failure udl-kms: fix crash due to uninitialized memory ASoC: dpcm: don't merge format from invalid codec dai ASoC: sirf: Fix potential NULL pointer dereference pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show() x86/irqflags: Mark native_restore_fl extern inline x86/spectre: Add missing family 6 check to microcode check s390: fix br_r1_trampoline for machines without exrl s390/qdio: reset old sbal_state flags s390/pci: fix out of bounds access during irq setup kprobes: Make list and blacklist root user read only MIPS: Correct the 64-bit DSP accumulator register size MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7 scsi: sysfs: Introduce sysfs_{un,}break_active_protection() scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock iscsi target: fix session creation failure handling cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status Linux 4.4.154 Change-Id: I1d173ebf72efb115b4889880cc2989b0ca7d751e Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/mmu.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index e8835d4e173c..e0267532bd4e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -892,19 +892,35 @@ static int stage2_set_pmd_huge(struct kvm *kvm, struct kvm_mmu_memory_cache
pmd = stage2_get_pmd(kvm, cache, addr);
VM_BUG_ON(!pmd);
- /*
- * Mapping in huge pages should only happen through a fault. If a
- * page is merged into a transparent huge page, the individual
- * subpages of that huge page should be unmapped through MMU
- * notifiers before we get here.
- *
- * Merging of CompoundPages is not supported; they should become
- * splitting first, unmapped, merged, and mapped back in on-demand.
- */
- VM_BUG_ON(pmd_present(*pmd) && pmd_pfn(*pmd) != pmd_pfn(*new_pmd));
-
old_pmd = *pmd;
if (pmd_present(old_pmd)) {
+ /*
+ * Multiple vcpus faulting on the same PMD entry, can
+ * lead to them sequentially updating the PMD with the
+ * same value. Following the break-before-make
+ * (pmd_clear() followed by tlb_flush()) process can
+ * hinder forward progress due to refaults generated
+ * on missing translations.
+ *
+ * Skip updating the page table if the entry is
+ * unchanged.
+ */
+ if (pmd_val(old_pmd) == pmd_val(*new_pmd))
+ return 0;
+
+ /*
+ * Mapping in huge pages should only happen through a
+ * fault. If a page is merged into a transparent huge
+ * page, the individual subpages of that huge page
+ * should be unmapped through MMU notifiers before we
+ * get here.
+ *
+ * Merging of CompoundPages is not supported; they
+ * should become splitting first, unmapped, merged,
+ * and mapped back in on-demand.
+ */
+ VM_BUG_ON(pmd_pfn(old_pmd) != pmd_pfn(*new_pmd));
+
pmd_clear(pmd);
kvm_tlb_flush_vmid_ipa(kvm, addr);
} else {
@@ -961,6 +977,10 @@ static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
/* Create 2nd stage page table mapping - Level 3 */
old_pte = *pte;
if (pte_present(old_pte)) {
+ /* Skip page table update if there is no change */
+ if (pte_val(old_pte) == pte_val(*new_pte))
+ return 0;
+
kvm_set_pte(pte, __pte(0));
kvm_tlb_flush_vmid_ipa(kvm, addr);
} else {