summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/gmap.h
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2016-03-08 11:55:04 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-20 09:53:59 +0200
commit6ea427bbbd4078297bb1dbd6c5cb83f3f48aac46 (patch)
tree7ed574fcca3cae5d6a50211d43c3d5ab21620d3a /arch/s390/include/asm/gmap.h
parents390/mm: extended gmap pte notifier (diff)
downloadlinux-6ea427bbbd4078297bb1dbd6c5cb83f3f48aac46.tar.xz
linux-6ea427bbbd4078297bb1dbd6c5cb83f3f48aac46.zip
s390/mm: add reference counter to gmap structure
Let's use a reference counter mechanism to control the lifetime of gmap structures. This will be needed for further changes related to gmap shadows. 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/include/asm/gmap.h')
-rw-r--r--arch/s390/include/asm/gmap.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/include/asm/gmap.h b/arch/s390/include/asm/gmap.h
index 6897a0919446..e69853ce55da 100644
--- a/arch/s390/include/asm/gmap.h
+++ b/arch/s390/include/asm/gmap.h
@@ -15,6 +15,7 @@
* @guest_to_host: radix tree with guest to host address translation
* @host_to_guest: radix tree with pointer to segment table entries
* @guest_table_lock: spinlock to protect all entries in the guest page table
+ * @ref_count: reference counter for the gmap structure
* @table: pointer to the page directory
* @asce: address space control element for gmap page table
* @pfault_enabled: defines if pfaults are applicable for the guest
@@ -26,6 +27,7 @@ struct gmap {
struct radix_tree_root guest_to_host;
struct radix_tree_root host_to_guest;
spinlock_t guest_table_lock;
+ atomic_t ref_count;
unsigned long *table;
unsigned long asce;
unsigned long asce_end;
@@ -44,8 +46,11 @@ struct gmap_notifier {
unsigned long end);
};
-struct gmap *gmap_alloc(struct mm_struct *mm, unsigned long limit);
-void gmap_free(struct gmap *gmap);
+struct gmap *gmap_create(struct mm_struct *mm, unsigned long limit);
+void gmap_remove(struct gmap *gmap);
+struct gmap *gmap_get(struct gmap *gmap);
+void gmap_put(struct gmap *gmap);
+
void gmap_enable(struct gmap *gmap);
void gmap_disable(struct gmap *gmap);
int gmap_map_segment(struct gmap *gmap, unsigned long from,