s390/diag: handle diag 204 subcode 4 address correctly

Diagnose 204 subcode 4 requires a real (physical) address, but a
virtual address is passed to the inline assembly.

Convert the address to a physical address for only this specific case.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2023-07-02 21:20:09 +02:00
parent 8cf57d7217
commit c83cd4fe31
2 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,8 @@ enum diag204_sc {
DIAG204_SUBC_STIB7 = 7
};
#define DIAG204_SUBCODE_MASK 0xffff
/* The two available diag 204 data formats */
enum diag204_format {
DIAG204_INFO_SIMPLE = 0,

View File

@ -171,6 +171,8 @@ static inline int __diag204(unsigned long *subcode, unsigned long size, void *ad
int diag204(unsigned long subcode, unsigned long size, void *addr)
{
diag_stat_inc(DIAG_STAT_X204);
if ((subcode & DIAG204_SUBCODE_MASK) == DIAG204_SUBC_STIB4)
addr = (void *)__pa(addr);
size = __diag204(&subcode, size, addr);
if (subcode)
return -1;