s390/pfault: do not use stack buffers for hardware data

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>
This commit is contained in:
Martin Schwidefsky 2018-09-07 11:20:08 +02:00
parent c0f07ff93b
commit 00e9e6645a
1 changed files with 21 additions and 17 deletions

View File

@ -636,17 +636,19 @@ struct pfault_refbk {
u64 reserved; u64 reserved;
} __attribute__ ((packed, aligned(8))); } __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) 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; int rc;
if (pfault_disable) if (pfault_disable)
@ -658,18 +660,20 @@ int pfault_init(void)
"1: la %0,8\n" "1: la %0,8\n"
"2:\n" "2:\n"
EX_TABLE(0b,1b) EX_TABLE(0b,1b)
: "=d" (rc) : "a" (&refbk), "m" (refbk) : "cc"); : "=d" (rc)
: "a" (&pfault_init_refbk), "m" (pfault_init_refbk) : "cc");
return rc; return rc;
} }
static struct pfault_refbk pfault_fini_refbk = {
.refdiagc = 0x258,
.reffcode = 1,
.refdwlen = 5,
.refversn = 2,
};
void pfault_fini(void) void pfault_fini(void)
{ {
struct pfault_refbk refbk = {
.refdiagc = 0x258,
.reffcode = 1,
.refdwlen = 5,
.refversn = 2,
};
if (pfault_disable) if (pfault_disable)
return; return;
@ -678,7 +682,7 @@ void pfault_fini(void)
" diag %0,0,0x258\n" " diag %0,0,0x258\n"
"0: nopr %%r7\n" "0: nopr %%r7\n"
EX_TABLE(0b,0b) EX_TABLE(0b,0b)
: : "a" (&refbk), "m" (refbk) : "cc"); : : "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk) : "cc");
} }
static DEFINE_SPINLOCK(pfault_lock); static DEFINE_SPINLOCK(pfault_lock);