summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/gmap.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-03-08 14:30:46 +0300
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-20 10:54:28 +0300
commit0f7f84891516dc1ff7500fae12143710d2d9d11f (patch)
treeae5185ba98c655404b8f5ee9e46060824fb08cba /arch/s390/include/asm/gmap.h
parent998f637cc4b9ef3fa32b196294a3136ee05271a2 (diff)
downloadlinux-0f7f84891516dc1ff7500fae12143710d2d9d11f.tar.xz
s390/mm: fix races on gmap_shadow creation
Before any thread is allowed to use a gmap_shadow, it has to be fully initialized. However, for invalidation to work properly, we have to register the new gmap_shadow before we protect the parent gmap table. Because locking is tricky, and we have to avoid duplicate gmaps, let's introduce an initialized field, that signalizes other threads if that gmap_shadow can already be used or if they have to retry. Let's properly return errors using ERR_PTR() instead of simply returning NULL, so a caller can properly react on the error. Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/include/asm/gmap.h b/arch/s390/include/asm/gmap.h
index 4a47055f58d7..54a2487efce4 100644
--- a/arch/s390/include/asm/gmap.h
+++ b/arch/s390/include/asm/gmap.h
@@ -27,6 +27,7 @@
* @parent: pointer to the parent gmap for shadow guest address spaces
* @orig_asce: ASCE for which the shadow page table has been created
* @removed: flag to indicate if a shadow guest address space has been removed
+ * @initialized: flag to indicate if a shadow guest address space can be used
*/
struct gmap {
struct list_head list;
@@ -49,6 +50,7 @@ struct gmap {
struct gmap *parent;
unsigned long orig_asce;
bool removed;
+ bool initialized;
};
/**