summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/diag.h
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2011-05-10 17:13:41 +0200
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-05-10 17:13:43 +0200
commit83ace2701b81be549cca7af33c5b0499cb2602d6 (patch)
tree17c74e48a1d67b7691fbdd4955835f16db76ae88 /arch/s390/include/asm/diag.h
parent91d378088b104f8e31baba8c518f32a7a219d58c (diff)
downloadblackbird-op-linux-83ace2701b81be549cca7af33c5b0499cb2602d6.tar.gz
blackbird-op-linux-83ace2701b81be549cca7af33c5b0499cb2602d6.zip
[S390] replace diag10() with diag10_range() function
Currently the diag10() function can only release one page. For exploiters that have to call diag10 on a contiguous memory region this is suboptimal. This patch replaces the diag10() function with diag10_range() that is able to release multiple pages. In addition to that the new function now allows to release memory with addresses higher than 2047 MiB. This was due to a restriction of the diagnose implementation under z/VM prior to release 5.2. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/diag.h')
-rw-r--r--arch/s390/include/asm/diag.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/s390/include/asm/diag.h b/arch/s390/include/asm/diag.h
index 72b2e2f2d32d..7e91c58072e2 100644
--- a/arch/s390/include/asm/diag.h
+++ b/arch/s390/include/asm/diag.h
@@ -9,9 +9,22 @@
#define _ASM_S390_DIAG_H
/*
- * Diagnose 10: Release pages
+ * Diagnose 10: Release page range
*/
-extern void diag10(unsigned long addr);
+static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
+{
+ unsigned long start_addr, end_addr;
+
+ start_addr = start_pfn << PAGE_SHIFT;
+ end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
+
+ asm volatile(
+ "0: diag %0,%1,0x10\n"
+ "1:\n"
+ EX_TABLE(0b, 1b)
+ EX_TABLE(1b, 1b)
+ : : "a" (start_addr), "a" (end_addr));
+}
/*
* Diagnose 14: Input spool file manipulation
OpenPOWER on IntegriCloud