summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/itcw.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2021-06-18 08:39:12 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2022-12-01 10:58:04 +0100
commit5c2e5a0cf5b12c156b0cb07af43b51627c086480 (patch)
treebd5b9271732eff13b5fc28198546086204fdb96a /drivers/s390/cio/itcw.c
parents390/sclp: allow to change sclp_console_drop during runtime (diff)
downloadlinux-5c2e5a0cf5b12c156b0cb07af43b51627c086480.tar.xz
linux-5c2e5a0cf5b12c156b0cb07af43b51627c086480.zip
s390/cio: sort out physical vs virtual pointers usage
This does not fix a real bug, since virtual addresses are currently indentical to physical ones. Use virt_to_phys() for intparm interrupt parameter to convert a 64-bit virtual address to the 32-bit physical address, which is expected to be below 2GB. Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio/itcw.c')
-rw-r--r--drivers/s390/cio/itcw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/s390/cio/itcw.c b/drivers/s390/cio/itcw.c
index 19e46363348c..dbd3099c520e 100644
--- a/drivers/s390/cio/itcw.c
+++ b/drivers/s390/cio/itcw.c
@@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/string.h>
+#include <linux/io.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/module.h>
@@ -187,7 +188,7 @@ struct itcw *itcw_init(void *buffer, size_t size, int op, int intrg,
/* Check for 2G limit. */
start = (addr_t) buffer;
end = start + size;
- if (end > (1 << 31))
+ if ((virt_to_phys(buffer) + size) > (1 << 31))
return ERR_PTR(-EINVAL);
memset(buffer, 0, size);
/* ITCW. */