aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2016-03-08 05:52:54 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-20 03:46:48 -0400
commit414d3b07496604a4372466a6b474ca24291a143c (patch)
tree2d3a2610ec945377f27fc2b72744ac8511e1709d /arch/s390/mm
parent64672c95ea4c2f7096e519e826076867e8ef0938 (diff)
s390/kvm: page table invalidation notifier
Pass an address range to the page table invalidation notifier for KVM. This allows to notify changes that affect a larger virtual memory area, e.g. for 1MB pages. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/gmap.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index cace818d86eb..b5820bf47ec6 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -573,6 +573,21 @@ void gmap_unregister_ipte_notifier(struct gmap_notifier *nb)
573EXPORT_SYMBOL_GPL(gmap_unregister_ipte_notifier); 573EXPORT_SYMBOL_GPL(gmap_unregister_ipte_notifier);
574 574
575/** 575/**
576 * gmap_call_notifier - call all registered invalidation callbacks
577 * @gmap: pointer to guest mapping meta data structure
578 * @start: start virtual address in the guest address space
579 * @end: end virtual address in the guest address space
580 */
581static void gmap_call_notifier(struct gmap *gmap, unsigned long start,
582 unsigned long end)
583{
584 struct gmap_notifier *nb;
585
586 list_for_each_entry(nb, &gmap_notifier_list, list)
587 nb->notifier_call(gmap, start, end);
588}
589
590/**
576 * gmap_ipte_notify - mark a range of ptes for invalidation notification 591 * gmap_ipte_notify - mark a range of ptes for invalidation notification
577 * @gmap: pointer to guest mapping meta data structure 592 * @gmap: pointer to guest mapping meta data structure
578 * @gaddr: virtual address in the guest address space 593 * @gaddr: virtual address in the guest address space
@@ -643,7 +658,6 @@ void ptep_notify(struct mm_struct *mm, unsigned long vmaddr, pte_t *pte)
643{ 658{
644 unsigned long offset, gaddr; 659 unsigned long offset, gaddr;
645 unsigned long *table; 660 unsigned long *table;
646 struct gmap_notifier *nb;
647 struct gmap *gmap; 661 struct gmap *gmap;
648 662
649 offset = ((unsigned long) pte) & (255 * sizeof(pte_t)); 663 offset = ((unsigned long) pte) & (255 * sizeof(pte_t));
@@ -655,8 +669,7 @@ void ptep_notify(struct mm_struct *mm, unsigned long vmaddr, pte_t *pte)
655 if (!table) 669 if (!table)
656 continue; 670 continue;
657 gaddr = __gmap_segment_gaddr(table) + offset; 671 gaddr = __gmap_segment_gaddr(table) + offset;
658 list_for_each_entry(nb, &gmap_notifier_list, list) 672 gmap_call_notifier(gmap, gaddr, gaddr + PAGE_SIZE - 1);
659 nb->notifier_call(gmap, gaddr);
660 } 673 }
661 spin_unlock(&gmap_notifier_lock); 674 spin_unlock(&gmap_notifier_lock);
662} 675}