s390/cpcmd: use physical address for command and response
authorAlexander Gordeev <agordeev@linux.ibm.com>
Fri, 18 Jun 2021 06:46:32 +0000 (08:46 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 26 Oct 2021 13:21:28 +0000 (15:21 +0200)
Virtual Console Function DIAGNOSE 8 accepts physical
addresses of command and response strings.

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

index 54efc279f54eee79370b823e8786f8fa8bd043c5..72e106cfd8c7fa3f4dc9cf5cdcd07c32ca0f9b6e 100644 (file)
@@ -29,7 +29,7 @@ static int diag8_noresponse(int cmdlen)
        asm volatile(
                "       diag    %[rx],%[ry],0x8\n"
                : [ry] "+&d" (cmdlen)
-               : [rx] "d" ((addr_t) cpcmd_buf)
+               : [rx] "d" (__pa(cpcmd_buf))
                : "cc");
        return cmdlen;
 }
@@ -39,8 +39,8 @@ static int diag8_response(int cmdlen, char *response, int *rlen)
        union register_pair rx, ry;
        int cc;
 
-       rx.even = (addr_t) cpcmd_buf;
-       rx.odd  = (addr_t) response;
+       rx.even = __pa(cpcmd_buf);
+       rx.odd  = __pa(response);
        ry.even = cmdlen | 0x40000000L;
        ry.odd  = *rlen;
        asm volatile(