mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
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:
parent
c0f07ff93b
commit
00e9e6645a
1 changed files with 21 additions and 17 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue