s390/zcrypt: get rid of variable length arrays
The variable length arrays used to specify clobbered memory within ap_nqap and ap_dqap would only work if the length would be known at compile time. This is not the case for both usages. Therefore simply use a full memory clobber and get rid of the old construct. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
227374b1dd
commit
57c52ae757
@ -129,7 +129,6 @@ static inline struct ap_queue_status ap_nqap(ap_qid_t qid,
|
|||||||
unsigned long long psmid,
|
unsigned long long psmid,
|
||||||
void *msg, size_t length)
|
void *msg, size_t length)
|
||||||
{
|
{
|
||||||
struct msgblock { char _[length]; };
|
|
||||||
register unsigned long reg0 asm ("0") = qid | 0x40000000UL;
|
register unsigned long reg0 asm ("0") = qid | 0x40000000UL;
|
||||||
register struct ap_queue_status reg1 asm ("1");
|
register struct ap_queue_status reg1 asm ("1");
|
||||||
register unsigned long reg2 asm ("2") = (unsigned long) msg;
|
register unsigned long reg2 asm ("2") = (unsigned long) msg;
|
||||||
@ -141,8 +140,8 @@ static inline struct ap_queue_status ap_nqap(ap_qid_t qid,
|
|||||||
"0: .long 0xb2ad0042\n" /* NQAP */
|
"0: .long 0xb2ad0042\n" /* NQAP */
|
||||||
" brc 2,0b"
|
" brc 2,0b"
|
||||||
: "+d" (reg0), "=d" (reg1), "+d" (reg2), "+d" (reg3)
|
: "+d" (reg0), "=d" (reg1), "+d" (reg2), "+d" (reg3)
|
||||||
: "d" (reg4), "d" (reg5), "m" (*(struct msgblock *) msg)
|
: "d" (reg4), "d" (reg5)
|
||||||
: "cc");
|
: "cc", "memory");
|
||||||
return reg1;
|
return reg1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +167,6 @@ static inline struct ap_queue_status ap_dqap(ap_qid_t qid,
|
|||||||
unsigned long long *psmid,
|
unsigned long long *psmid,
|
||||||
void *msg, size_t length)
|
void *msg, size_t length)
|
||||||
{
|
{
|
||||||
struct msgblock { char _[length]; };
|
|
||||||
register unsigned long reg0 asm("0") = qid | 0x80000000UL;
|
register unsigned long reg0 asm("0") = qid | 0x80000000UL;
|
||||||
register struct ap_queue_status reg1 asm ("1");
|
register struct ap_queue_status reg1 asm ("1");
|
||||||
register unsigned long reg2 asm("2") = 0UL;
|
register unsigned long reg2 asm("2") = 0UL;
|
||||||
@ -182,8 +180,8 @@ static inline struct ap_queue_status ap_dqap(ap_qid_t qid,
|
|||||||
"0: .long 0xb2ae0064\n" /* DQAP */
|
"0: .long 0xb2ae0064\n" /* DQAP */
|
||||||
" brc 6,0b\n"
|
" brc 6,0b\n"
|
||||||
: "+d" (reg0), "=d" (reg1), "+d" (reg2),
|
: "+d" (reg0), "=d" (reg1), "+d" (reg2),
|
||||||
"+d" (reg4), "+d" (reg5), "+d" (reg6), "+d" (reg7),
|
"+d" (reg4), "+d" (reg5), "+d" (reg6), "+d" (reg7)
|
||||||
"=m" (*(struct msgblock *) msg) : : "cc");
|
: : "cc", "memory");
|
||||||
*psmid = (((unsigned long long) reg6) << 32) + reg7;
|
*psmid = (((unsigned long long) reg6) << 32) + reg7;
|
||||||
return reg1;
|
return reg1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user