summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2024-01-25 12:48:58 +0300
committerHeiko Carstens <hca@linux.ibm.com>2024-02-09 15:58:14 +0300
commiteec561024b3e733ba4ed3515ba81b45f5e647d0d (patch)
treed7665620e2b489b651c2bd2c6ce5fb7bf78b0e21 /arch
parent0ad92cbd5a55df4cf4610a9124b24e3f74b1ac50 (diff)
downloadlinux-eec561024b3e733ba4ed3515ba81b45f5e647d0d.tar.xz
s390/diag: add missing virt_to_phys() translation to diag14()
diag14() is currently only used by the vmur device driver. The third parameter, called subcommand, determines the type of the first parameter. For some subcommands the value of the first parameter is an address to a memory buffer and needs virtual to physical address conversion. Other subcommands interpret the first parameter is an integer. This doesn't fix a bug since virtual and physical addresses are currently the same. Suggested-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/diag.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c
index d8d97f970af4..8dee9aa0ec95 100644
--- a/arch/s390/kernel/diag.c
+++ b/arch/s390/kernel/diag.c
@@ -157,10 +157,30 @@ void diag0c(struct hypfs_diag0c_entry *data)
/*
* Diagnose 14: Input spool file manipulation
+ *
+ * The subcode parameter determines the type of the first parameter rx.
+ * Currently used are the following 3 subcommands:
+ * 0x0: Read the Next Spool File Buffer (Data Record)
+ * 0x28: Position a Spool File to the Designated Record
+ * 0xfff: Retrieve Next File Descriptor
+ *
+ * For subcommands 0x0 and 0xfff, the value of the first parameter is
+ * a virtual address of a memory buffer and needs virtual to physical
+ * address translation. For other subcommands the rx parameter is not
+ * a virtual address.
*/
int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode)
{
diag_stat_inc(DIAG_STAT_X014);
+ switch (subcode) {
+ case 0x0:
+ case 0xfff:
+ rx = virt_to_phys((void *)rx);
+ break;
+ default:
+ /* Do nothing */
+ break;
+ }
return diag_amode31_ops.diag14(rx, ry1, subcode);
}
EXPORT_SYMBOL(diag14);