s390/diag: add missing virt_to_phys() translation to diag224()
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 18 Oct 2023 10:33:05 +0000 (12:33 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 23 Oct 2023 16:21:23 +0000 (18:21 +0200)
Diagnose 224 expects a physical address, but all users pass a virtual
address. Translate the address to fix this.

Reported-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/diag.c

index f9f06cd8fcee660c0ce7899800254cf77f6daa53..92fdc35f028c7984129954eb35547e0569d3712a 100644 (file)
@@ -245,6 +245,7 @@ EXPORT_SYMBOL(diag8c);
 
 int diag224(void *ptr)
 {
+       unsigned long addr = __pa(ptr);
        int rc = -EOPNOTSUPP;
 
        diag_stat_inc(DIAG_STAT_X224);
@@ -253,7 +254,7 @@ int diag224(void *ptr)
                "0:     lhi     %0,0x0\n"
                "1:\n"
                EX_TABLE(0b,1b)
-               : "+d" (rc) :"d" (0), "d" (ptr) : "memory");
+               : "+d" (rc) :"d" (0), "d" (addr) : "memory");
        return rc;
 }
 EXPORT_SYMBOL(diag224);