summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 21:19:42 -0400
commit33e247c7e58d335d70ecb84fd869091e2e4b8dcb (patch)
treee8561e1993dff03f8e56d10a5795fe9d379a3390 /virt
parentd71fc239b6915a8b750e9a447311029ff45b6580 (diff)
parent452e06af1f0149b01201f94264d452cd7a95db7a (diff)
Merge branch 'akpm' (patches from Andrew)
Merge third patch-bomb from Andrew Morton: - even more of the rest of MM - lib/ updates - checkpatch updates - small changes to a few scruffy filesystems - kmod fixes/cleanups - kexec updates - a dma-mapping cleanup series from hch * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (81 commits) dma-mapping: consolidate dma_set_mask dma-mapping: consolidate dma_supported dma-mapping: cosolidate dma_mapping_error dma-mapping: consolidate dma_{alloc,free}_noncoherent dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent} mm: use vma_is_anonymous() in create_huge_pmd() and wp_huge_pmd() mm: make sure all file VMAs have ->vm_ops set mm, mpx: add "vm_flags_t vm_flags" arg to do_mmap_pgoff() mm: mark most vm_operations_struct const namei: fix warning while make xmldocs caused by namei.c ipc: convert invalid scenarios to use WARN_ON zlib_deflate/deftree: remove bi_reverse() lib/decompress_unlzma: Do a NULL check for pointer lib/decompressors: use real out buf size for gunzip with kernel fs/affs: make root lookup from blkdev logical size sysctl: fix int -> unsigned long assignments in INT_MIN case kexec: export KERNEL_IMAGE_SIZE to vmcoreinfo kexec: align crash_notes allocation to make it be inside one physical page kexec: remove unnecessary test in kimage_alloc_crash_control_pages() kexec: split kexec_load syscall from kexec core code ...
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4662a8877f6c..a25a73147f71 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -397,6 +397,36 @@ static int kvm_mmu_notifier_clear_flush_young(struct mmu_notifier *mn,
397 return young; 397 return young;
398} 398}
399 399
400static int kvm_mmu_notifier_clear_young(struct mmu_notifier *mn,
401 struct mm_struct *mm,
402 unsigned long start,
403 unsigned long end)
404{
405 struct kvm *kvm = mmu_notifier_to_kvm(mn);
406 int young, idx;
407
408 idx = srcu_read_lock(&kvm->srcu);
409 spin_lock(&kvm->mmu_lock);
410 /*
411 * Even though we do not flush TLB, this will still adversely
412 * affect performance on pre-Haswell Intel EPT, where there is
413 * no EPT Access Bit to clear so that we have to tear down EPT
414 * tables instead. If we find this unacceptable, we can always
415 * add a parameter to kvm_age_hva so that it effectively doesn't
416 * do anything on clear_young.
417 *
418 * Also note that currently we never issue secondary TLB flushes
419 * from clear_young, leaving this job up to the regular system
420 * cadence. If we find this inaccurate, we might come up with a
421 * more sophisticated heuristic later.
422 */
423 young = kvm_age_hva(kvm, start, end);
424 spin_unlock(&kvm->mmu_lock);
425 srcu_read_unlock(&kvm->srcu, idx);
426
427 return young;
428}
429
400static int kvm_mmu_notifier_test_young(struct mmu_notifier *mn, 430static int kvm_mmu_notifier_test_young(struct mmu_notifier *mn,
401 struct mm_struct *mm, 431 struct mm_struct *mm,
402 unsigned long address) 432 unsigned long address)
@@ -429,6 +459,7 @@ static const struct mmu_notifier_ops kvm_mmu_notifier_ops = {
429 .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start, 459 .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start,
430 .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end, 460 .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end,
431 .clear_flush_young = kvm_mmu_notifier_clear_flush_young, 461 .clear_flush_young = kvm_mmu_notifier_clear_flush_young,
462 .clear_young = kvm_mmu_notifier_clear_young,
432 .test_young = kvm_mmu_notifier_test_young, 463 .test_young = kvm_mmu_notifier_test_young,
433 .change_pte = kvm_mmu_notifier_change_pte, 464 .change_pte = kvm_mmu_notifier_change_pte,
434 .release = kvm_mmu_notifier_release, 465 .release = kvm_mmu_notifier_release,