s390/pfault: do not use stack buffers for hardware data
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 7 Sep 2018 09:20:08 +0000 (11:20 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 9 Oct 2018 09:20:54 +0000 (11:20 +0200)
With CONFIG_VMAP_STACK=y the stack is allocated from the vmalloc space.
Data structures passed to a hardware or a hypervisor interface that
requires V=R can not be allocated on the stack anymore.

Make the init and fini pfault parameter blocks static variables.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/fault.c

index 72af23bacbb586ee87dce086fac2e28dd85bc7ec..2b8f32f56e0c20870ef250741562d6d6146d72be 100644 (file)
@@ -636,17 +636,19 @@ struct pfault_refbk {
        u64 reserved;
 } __attribute__ ((packed, aligned(8)));
 
+static struct pfault_refbk pfault_init_refbk = {
+       .refdiagc = 0x258,
+       .reffcode = 0,
+       .refdwlen = 5,
+       .refversn = 2,
+       .refgaddr = __LC_LPP,
+       .refselmk = 1ULL << 48,
+       .refcmpmk = 1ULL << 48,
+       .reserved = __PF_RES_FIELD
+};
+
 int pfault_init(void)
 {
-       struct pfault_refbk refbk = {
-               .refdiagc = 0x258,
-               .reffcode = 0,
-               .refdwlen = 5,
-               .refversn = 2,
-               .refgaddr = __LC_LPP,
-               .refselmk = 1ULL << 48,
-               .refcmpmk = 1ULL << 48,
-               .reserved = __PF_RES_FIELD };
         int rc;
 
        if (pfault_disable)
@@ -658,18 +660,20 @@ int pfault_init(void)
                "1:     la      %0,8\n"
                "2:\n"
                EX_TABLE(0b,1b)
-               : "=d" (rc) : "a" (&refbk), "m" (refbk) : "cc");
+               : "=d" (rc)
+               : "a" (&pfault_init_refbk), "m" (pfault_init_refbk) : "cc");
         return rc;
 }
 
+static struct pfault_refbk pfault_fini_refbk = {
+       .refdiagc = 0x258,
+       .reffcode = 1,
+       .refdwlen = 5,
+       .refversn = 2,
+};
+
 void pfault_fini(void)
 {
-       struct pfault_refbk refbk = {
-               .refdiagc = 0x258,
-               .reffcode = 1,
-               .refdwlen = 5,
-               .refversn = 2,
-       };
 
        if (pfault_disable)
                return;
@@ -678,7 +682,7 @@ void pfault_fini(void)
                "       diag    %0,0,0x258\n"
                "0:     nopr    %%r7\n"
                EX_TABLE(0b,0b)
-               : : "a" (&refbk), "m" (refbk) : "cc");
+               : : "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk) : "cc");
 }
 
 static DEFINE_SPINLOCK(pfault_lock);