summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-07-02 21:20:09 +0200
committerHeiko Carstens <hca@linux.ibm.com>2023-07-24 12:12:21 +0200
commitc83cd4fe31d52bca0587370d9e98f00072aefa27 (patch)
treeb9acbb4cfa7528cd67f80e608dca88fd1fd2c624 /arch
parent8cf57d7217c32133d25615324c0ab4aaacf4d9c4 (diff)
downloadlinux-stable-c83cd4fe31d52bca0587370d9e98f00072aefa27.tar.gz
linux-stable-c83cd4fe31d52bca0587370d9e98f00072aefa27.tar.bz2
linux-stable-c83cd4fe31d52bca0587370d9e98f00072aefa27.zip
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/diag.h2
-rw-r--r--arch/s390/kernel/diag.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/include/asm/diag.h b/arch/s390/include/asm/diag.h
index fb5a886ff47f..bed804137537 100644
--- a/arch/s390/include/asm/diag.h
+++ b/arch/s390/include/asm/diag.h
@@ -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,
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c
index cca56b649ca3..f3a0f39cbd6c 100644
--- a/arch/s390/kernel/diag.c
+++ b/arch/s390/kernel/diag.c
@@ -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;