浏览代码

s390/memory hotplug: initialize storage keys

Add missing storage key initialization when memory comes online.
Didn't hurt until now, since the kernel always uses access key 0.

However for debugging purposes we sometimes use a different key
and it might be good if everything is properly initialized...

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Heiko Carstens 13 年之前
父节点
当前提交
0cd2f6201c
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      drivers/s390/char/sclp_cmd.c

+ 11 - 1
drivers/s390/char/sclp_cmd.c

@@ -352,7 +352,17 @@ out:
 
 static int sclp_assign_storage(u16 rn)
 {
-	return do_assign_storage(0x000d0001, rn);
+	unsigned long long start, address;
+	int rc;
+
+	rc = do_assign_storage(0x000d0001, rn);
+	if (rc)
+		goto out;
+	start = address = rn2addr(rn);
+	for (; address < start + rzm; address += PAGE_SIZE)
+		page_set_storage_key(address, PAGE_DEFAULT_KEY, 0);
+out:
+	return rc;
 }
 
 static int sclp_unassign_storage(u16 rn)