aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-05-02 06:10:17 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-20 03:55:07 -0400
commit717c05554afa69a36398a57dac64b95972f138d5 (patch)
treef713b8b2a0d8e43c3903e062e1e6c4a5fa8c32e5 /arch/s390/mm
parent3218f7094b6b583f4f01bffcf84572c6beacdcc2 (diff)
s390/mm: limit number of real-space gmap shadows
We have no known user of real-space designation and only support it to be architecture compliant. Gmap shadows with real-space designation are never unshadowed automatically, as there is nothing to protect for the top level table. So let's simply limit the number of such shadows to one by removing existing ones on creation of another one. 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/mm')
-rw-r--r--arch/s390/mm/gmap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index c07d64f5cdb5..4a1434bc2f0e 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -1455,6 +1455,19 @@ struct gmap *gmap_shadow(struct gmap *parent, unsigned long asce,
1455 gmap_free(new); 1455 gmap_free(new);
1456 return sg; 1456 return sg;
1457 } 1457 }
1458 if (asce & _ASCE_REAL_SPACE) {
1459 /* only allow one real-space gmap shadow */
1460 list_for_each_entry(sg, &parent->children, list) {
1461 if (sg->orig_asce & _ASCE_REAL_SPACE) {
1462 spin_lock(&sg->guest_table_lock);
1463 gmap_unshadow(sg);
1464 spin_unlock(&sg->guest_table_lock);
1465 list_del(&sg->list);
1466 gmap_put(sg);
1467 break;
1468 }
1469 }
1470 }
1458 atomic_set(&new->ref_count, 2); 1471 atomic_set(&new->ref_count, 2);
1459 list_add(&new->list, &parent->children); 1472 list_add(&new->list, &parent->children);
1460 if (asce & _ASCE_REAL_SPACE) { 1473 if (asce & _ASCE_REAL_SPACE) {