From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Michael Holzheu <holzheu@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 09/16] Program check in diag 210 under 31 bit
Date: Tue, 10 Jul 2007 11:29:44 +0200 [thread overview]
Message-ID: <20070710093118.053202681@de.ibm.com> (raw)
In-Reply-To: 20070710092935.896013926@de.ibm.com
[-- Attachment #1: 009-diag210.diff --]
[-- Type: text/plain, Size: 1990 bytes --]
From: Michael Holzheu <holzheu@de.ibm.com>
If a virtual address is passed to the diag210 function under 31 bit, we get a
programming exception, since diag 210 only works with physical addresses. To
fix this, the content of the diag210 data structure is copied to a local
structure and the physical address of that structure is passed to diagnose 210.
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
drivers/s390/cio/device_id.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
Index: quilt-2.6/drivers/s390/cio/device_id.c
===================================================================
--- quilt-2.6.orig/drivers/s390/cio/device_id.c
+++ quilt-2.6/drivers/s390/cio/device_id.c
@@ -27,7 +27,6 @@
/*
* diag210 is used under VM to get information about a virtual device
*/
-#ifdef CONFIG_64BIT
int
diag210(struct diag210 * addr)
{
@@ -43,6 +42,7 @@ diag210(struct diag210 * addr)
spin_lock_irqsave(&diag210_lock, flags);
diag210_tmp = *addr;
+#ifdef CONFIG_64BIT
asm volatile(
" lhi %0,-1\n"
" sam31\n"
@@ -51,19 +51,8 @@ diag210(struct diag210 * addr)
" srl %0,28\n"
"1: sam64\n"
EX_TABLE(0b,1b)
- : "=&d" (ccode) : "a" (__pa(&diag210_tmp)) : "cc", "memory");
-
- *addr = diag210_tmp;
- spin_unlock_irqrestore(&diag210_lock, flags);
-
- return ccode;
-}
+ : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory");
#else
-int
-diag210(struct diag210 * addr)
-{
- int ccode;
-
asm volatile(
" lhi %0,-1\n"
" diag %1,0,0x210\n"
@@ -71,11 +60,14 @@ diag210(struct diag210 * addr)
" srl %0,28\n"
"1:\n"
EX_TABLE(0b,1b)
- : "=&d" (ccode) : "a" (__pa(addr)) : "cc", "memory");
+ : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory");
+#endif
+
+ *addr = diag210_tmp;
+ spin_unlock_irqrestore(&diag210_lock, flags);
return ccode;
}
-#endif
/*
* Input :
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2007-07-10 9:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 9:29 [patch 00/16] First s390 patchset for 2.6.22+ Martin Schwidefsky
2007-07-10 9:29 ` [patch 01/16] vmcp cleanup Martin Schwidefsky
2007-07-10 9:29 ` [patch 02/16] Fixed comment typo Martin Schwidefsky
2007-07-10 9:29 ` [patch 03/16] sclp: introduce some new interfaces Martin Schwidefsky
2007-07-10 9:29 ` [patch 04/16] sclp: Test facility list before executing a service call Martin Schwidefsky
2007-07-10 9:29 ` [patch 05/16] fixed cdl-format detection Martin Schwidefsky
2007-07-10 9:29 ` [patch 06/16] zcore: Fix __user annotation Martin Schwidefsky
2007-07-10 9:29 ` [patch 07/16] smp: Merge smp_count_cpus() and smp_get_save_areas() Martin Schwidefsky
2007-07-10 9:29 ` [patch 08/16] Bogomips calculation for 64 bit Martin Schwidefsky
2007-07-10 9:29 ` Martin Schwidefsky [this message]
2007-07-10 9:29 ` [patch 10/16] Remove volatile from atomic_t Martin Schwidefsky
2007-07-10 9:29 ` [patch 11/16] dasd: Avoid compile warnings on !CONFIG_DASD_PROFILE Martin Schwidefsky
2007-07-10 9:29 ` [patch 12/16] system call optimization Martin Schwidefsky
2007-07-10 9:29 ` [patch 13/16] zcrypt: fix request timeout handling Martin Schwidefsky
2007-07-10 9:29 ` [patch 14/16] cio: Remove prototype for non-existing function cmf_reset() Martin Schwidefsky
2007-07-10 9:29 ` [patch 15/16] s390: rename CPU_IDLE to S390_CPU_IDLE Martin Schwidefsky
2007-07-10 9:29 ` [patch 16/16] vmlogrdr function annotation Martin Schwidefsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070710093118.053202681@de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=holzheu@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox