[PATCH] s390: core changes.
From: Christian Borntr?ger <[email protected]>
From: Martin Schwidefsky <[email protected]>
From: Thomas Spatzier <[email protected]>
s390 core changes:
- Add default storage key and introduce page_{set,get}_storage_key.
- Fix access to siginfo in copy_siginfo_from_user32.
- Regenerate default configuration.
Signed-off-by: Martin Schwidefsky <[email protected]>
diffstat:
arch/s390/defconfig | 6 +++---
arch/s390/kernel/compat_signal.c | 4 ++--
arch/s390/kernel/s390_ksyms.c | 1 +
arch/s390/kernel/setup.c | 1 +
include/asm-s390/page.h | 19 +++++++++++++++++++
include/asm-s390/pgtable.h | 23 +++++++++--------------
6 files changed, 35 insertions(+), 19 deletions(-)
diff -urN linux-2.6/arch/s390/defconfig linux-2.6-patched/arch/s390/defconfig
--- linux-2.6/arch/s390/defconfig 2004-10-08 19:18:57.000000000 +0200
+++ linux-2.6-patched/arch/s390/defconfig 2004-10-08 19:19:09.000000000 +0200
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.9-rc2
-# Mon Sep 20 17:16:38 2004
+# Linux kernel version: 2.6.9-rc3
+# Fri Oct 8 19:17:35 2004
#
CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -520,7 +520,7 @@
# CONFIG_CRYPTO_SHA1_Z990 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WHIRLPOOL is not set
+# CONFIG_CRYPTO_WP512 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_DES_Z990 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
diff -urN linux-2.6/arch/s390/kernel/compat_signal.c linux-2.6-patched/arch/s390/kernel/compat_signal.c
--- linux-2.6/arch/s390/kernel/compat_signal.c 2004-10-08 19:18:57.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/compat_signal.c 2004-10-08 19:19:09.000000000 +0200
@@ -118,10 +118,10 @@
err |= __get_user(to->si_errno, &from->si_errno);
err |= __get_user(to->si_code, &from->si_code);
- if (from->si_code < 0)
+ if (to->si_code < 0)
err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
else {
- switch (from->si_code >> 16) {
+ switch (to->si_code >> 16) {
case __SI_RT >> 16: /* This is not generated by the kernel as of now. */
case __SI_MESGQ >> 16:
err |= __get_user(to->si_int, &from->si_int);
diff -urN linux-2.6/arch/s390/kernel/s390_ksyms.c linux-2.6-patched/arch/s390/kernel/s390_ksyms.c
--- linux-2.6/arch/s390/kernel/s390_ksyms.c 2004-10-08 19:18:57.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/s390_ksyms.c 2004-10-08 19:19:09.000000000 +0200
@@ -34,6 +34,7 @@
EXPORT_SYMBOL(__strncpy_from_user_asm);
EXPORT_SYMBOL(__strnlen_user_asm);
EXPORT_SYMBOL(diag10);
+EXPORT_SYMBOL(default_storage_key);
/*
* semaphore ops
diff -urN linux-2.6/arch/s390/kernel/setup.c linux-2.6-patched/arch/s390/kernel/setup.c
--- linux-2.6/arch/s390/kernel/setup.c 2004-10-08 19:18:57.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/setup.c 2004-10-08 19:19:09.000000000 +0200
@@ -53,6 +53,7 @@
unsigned int console_irq = -1;
unsigned long memory_size = 0;
unsigned long machine_flags = 0;
+unsigned int default_storage_key = 0;
struct {
unsigned long addr, size, type;
} memory_chunk[MEMORY_CHUNKS] = { { 0 } };
diff -urN linux-2.6/include/asm-s390/page.h linux-2.6-patched/include/asm-s390/page.h
--- linux-2.6/include/asm-s390/page.h 2004-08-14 12:54:51.000000000 +0200
+++ linux-2.6-patched/include/asm-s390/page.h 2004-10-08 19:19:09.000000000 +0200
@@ -162,6 +162,25 @@
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )
+/* default storage key used for all pages */
+extern unsigned int default_storage_key;
+
+static inline void
+page_set_storage_key(unsigned long addr, unsigned int skey)
+{
+ asm volatile ( "sske %0,%1" : : "d" (skey), "a" (addr) );
+}
+
+static inline unsigned int
+page_get_storage_key(unsigned long addr)
+{
+ unsigned int skey;
+
+ asm volatile ( "iske %0,%1" : "=d" (skey) : "a" (addr), "0" (0) );
+
+ return skey;
+}
+
#endif /* !__ASSEMBLY__ */
/* to align the pointer to the (next) page boundary */
diff -urN linux-2.6/include/asm-s390/pgtable.h linux-2.6-patched/include/asm-s390/pgtable.h
--- linux-2.6/include/asm-s390/pgtable.h 2004-08-14 12:55:59.000000000 +0200
+++ linux-2.6-patched/include/asm-s390/pgtable.h 2004-10-08 19:19:09.000000000 +0200
@@ -597,17 +597,13 @@
* should therefore only be called if it is not mapped in any
* address space.
*/
-#define page_test_and_clear_dirty(page) \
+#define page_test_and_clear_dirty(_page) \
({ \
- struct page *__page = (page); \
+ struct page *__page = (_page); \
unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \
- int __skey; \
- asm volatile ("iske %0,%1" : "=d" (__skey) : "a" (__physpage)); \
- if (__skey & _PAGE_CHANGED) { \
- asm volatile ("sske %0,%1" \
- : : "d" (__skey & ~_PAGE_CHANGED), \
- "a" (__physpage)); \
- } \
+ int __skey = page_get_storage_key(__physpage); \
+ if (__skey & _PAGE_CHANGED) \
+ page_set_storage_key(__physpage, __skey & ~_PAGE_CHANGED);\
(__skey & _PAGE_CHANGED); \
})
@@ -655,11 +651,10 @@
})
#define SetPageUptodate(_page) \
- do { \
- struct page *__page = (_page); \
- if (!test_and_set_bit(PG_uptodate, &__page->flags)) \
- asm volatile ("sske %0,%1" : : "d" (0), \
- "a" (__pa((__page-mem_map) << PAGE_SHIFT)));\
+ do { \
+ struct page *__page = (_page); \
+ if (!test_and_set_bit(PG_uptodate, &__page->flags)) \
+ page_test_and_clear_dirty(_page); \
} while (0)
#ifdef __s390x__
--
blue skies,
Martin.