Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4
+2
arch/s390/include/asm/diag.h
··· 109 109 DIAG204_SUBC_STIB7 = 7 110 110 }; 111 111 112 + #define DIAG204_SUBCODE_MASK 0xffff 113 + 112 114 /* The two available diag 204 data formats */ 113 115 enum diag204_format { 114 116 DIAG204_INFO_SIMPLE = 0,
+2
arch/s390/kernel/diag.c
··· 171 171 int diag204(unsigned long subcode, unsigned long size, void *addr) 172 172 { 173 173 diag_stat_inc(DIAG_STAT_X204); 174 + if ((subcode & DIAG204_SUBCODE_MASK) == DIAG204_SUBC_STIB4) 175 + addr = (void *)__pa(addr); 174 176 size = __diag204(&subcode, size, addr); 175 177 if (subcode) 176 178 return -1;