aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/Kconfig3
-rw-r--r--arch/s390/include/asm/compat.h7
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/crash_dump.c1
-rw-r--r--arch/s390/kernel/process.c6
-rw-r--r--arch/s390/kernel/ptrace.c2
-rw-r--r--arch/s390/kernel/setup.c2
-rw-r--r--arch/s390/kernel/signal.c1
-rw-r--r--arch/s390/kernel/time.c7
-rw-r--r--arch/s390/mm/fault.c1
-rw-r--r--arch/s390/mm/init.c30
-rw-r--r--arch/s390/mm/mmap.c2
-rw-r--r--arch/s390/mm/pgtable.c2
13 files changed, 42 insertions, 24 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index d1727584230a..6d99a5fcc090 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -227,6 +227,9 @@ config COMPAT
227config SYSVIPC_COMPAT 227config SYSVIPC_COMPAT
228 def_bool y if COMPAT && SYSVIPC 228 def_bool y if COMPAT && SYSVIPC
229 229
230config KEYS_COMPAT
231 def_bool y if COMPAT && KEYS
232
230config AUDIT_ARCH 233config AUDIT_ARCH
231 def_bool y 234 def_bool y
232 235
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 2e49748b27da..234f1d859cea 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -172,13 +172,6 @@ static inline int is_compat_task(void)
172 return is_32bit_task(); 172 return is_32bit_task();
173} 173}
174 174
175#else
176
177static inline int is_compat_task(void)
178{
179 return 0;
180}
181
182#endif 175#endif
183 176
184static inline void __user *arch_compat_alloc_user_space(long len) 177static inline void __user *arch_compat_alloc_user_space(long len)
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 18c51df9fe06..ff605a39cf43 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -662,7 +662,7 @@ ENTRY(sys32_getresuid16_wrapper)
662ENTRY(sys32_poll_wrapper) 662ENTRY(sys32_poll_wrapper)
663 llgtr %r2,%r2 # struct pollfd * 663 llgtr %r2,%r2 # struct pollfd *
664 llgfr %r3,%r3 # unsigned int 664 llgfr %r3,%r3 # unsigned int
665 lgfr %r4,%r4 # long 665 lgfr %r4,%r4 # int
666 jg sys_poll # branch to system call 666 jg sys_poll # branch to system call
667 667
668ENTRY(sys32_setresgid16_wrapper) 668ENTRY(sys32_setresgid16_wrapper)
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index 39f8fd4438fc..c383ce440d99 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -11,7 +11,6 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/gfp.h> 12#include <linux/gfp.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/crash_dump.h>
15#include <linux/bootmem.h> 14#include <linux/bootmem.h>
16#include <linux/elf.h> 15#include <linux/elf.h>
17#include <asm/ipl.h> 16#include <asm/ipl.h>
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 3201ae447990..e795933eb2cb 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -29,7 +29,6 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/timer.h> 30#include <asm/timer.h>
31#include <asm/nmi.h> 31#include <asm/nmi.h>
32#include <asm/compat.h>
33#include <asm/smp.h> 32#include <asm/smp.h>
34#include "entry.h" 33#include "entry.h"
35 34
@@ -76,7 +75,6 @@ static void default_idle(void)
76 if (test_thread_flag(TIF_MCCK_PENDING)) { 75 if (test_thread_flag(TIF_MCCK_PENDING)) {
77 local_mcck_enable(); 76 local_mcck_enable();
78 local_irq_enable(); 77 local_irq_enable();
79 s390_handle_mcck();
80 return; 78 return;
81 } 79 }
82 trace_hardirqs_on(); 80 trace_hardirqs_on();
@@ -93,10 +91,12 @@ void cpu_idle(void)
93 for (;;) { 91 for (;;) {
94 tick_nohz_idle_enter(); 92 tick_nohz_idle_enter();
95 rcu_idle_enter(); 93 rcu_idle_enter();
96 while (!need_resched()) 94 while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
97 default_idle(); 95 default_idle();
98 rcu_idle_exit(); 96 rcu_idle_exit();
99 tick_nohz_idle_exit(); 97 tick_nohz_idle_exit();
98 if (test_thread_flag(TIF_MCCK_PENDING))
99 s390_handle_mcck();
100 preempt_enable_no_resched(); 100 preempt_enable_no_resched();
101 schedule(); 101 schedule();
102 preempt_disable(); 102 preempt_disable();
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 9d82ed4bcb27..61f95489d70c 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -20,8 +20,8 @@
20#include <linux/regset.h> 20#include <linux/regset.h>
21#include <linux/tracehook.h> 21#include <linux/tracehook.h>
22#include <linux/seccomp.h> 22#include <linux/seccomp.h>
23#include <linux/compat.h>
23#include <trace/syscall.h> 24#include <trace/syscall.h>
24#include <asm/compat.h>
25#include <asm/segment.h> 25#include <asm/segment.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 354de0763eff..3b2efc81f34e 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -46,6 +46,7 @@
46#include <linux/kexec.h> 46#include <linux/kexec.h>
47#include <linux/crash_dump.h> 47#include <linux/crash_dump.h>
48#include <linux/memory.h> 48#include <linux/memory.h>
49#include <linux/compat.h>
49 50
50#include <asm/ipl.h> 51#include <asm/ipl.h>
51#include <asm/uaccess.h> 52#include <asm/uaccess.h>
@@ -59,7 +60,6 @@
59#include <asm/ptrace.h> 60#include <asm/ptrace.h>
60#include <asm/sections.h> 61#include <asm/sections.h>
61#include <asm/ebcdic.h> 62#include <asm/ebcdic.h>
62#include <asm/compat.h>
63#include <asm/kvm_virtio.h> 63#include <asm/kvm_virtio.h>
64#include <asm/diag.h> 64#include <asm/diag.h>
65 65
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index a8ba840294ff..2d421d90fada 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -30,7 +30,6 @@
30#include <asm/ucontext.h> 30#include <asm/ucontext.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/lowcore.h> 32#include <asm/lowcore.h>
33#include <asm/compat.h>
34#include "entry.h" 33#include "entry.h"
35 34
36#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 35#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index fa02f443f5f6..14da278febbf 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -113,11 +113,14 @@ static void fixup_clock_comparator(unsigned long long delta)
113static int s390_next_ktime(ktime_t expires, 113static int s390_next_ktime(ktime_t expires,
114 struct clock_event_device *evt) 114 struct clock_event_device *evt)
115{ 115{
116 struct timespec ts;
116 u64 nsecs; 117 u64 nsecs;
117 118
118 nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset())); 119 ts.tv_sec = ts.tv_nsec = 0;
120 monotonic_to_bootbased(&ts);
121 nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
119 do_div(nsecs, 125); 122 do_div(nsecs, 125);
120 S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9); 123 S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
121 set_clock_comparator(S390_lowcore.clock_comparator); 124 set_clock_comparator(S390_lowcore.clock_comparator);
122 return 0; 125 return 0;
123} 126}
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 354dd39073ef..e8fcd928dc78 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -36,7 +36,6 @@
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <asm/mmu_context.h> 38#include <asm/mmu_context.h>
39#include <asm/compat.h>
40#include "../kernel/entry.h" 39#include "../kernel/entry.h"
41 40
42#ifndef CONFIG_64BIT 41#ifndef CONFIG_64BIT
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 5d633019d8f3..50236610de83 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -223,16 +223,38 @@ void free_initrd_mem(unsigned long start, unsigned long end)
223#ifdef CONFIG_MEMORY_HOTPLUG 223#ifdef CONFIG_MEMORY_HOTPLUG
224int arch_add_memory(int nid, u64 start, u64 size) 224int arch_add_memory(int nid, u64 start, u64 size)
225{ 225{
226 struct pglist_data *pgdat; 226 unsigned long zone_start_pfn, zone_end_pfn, nr_pages;
227 unsigned long start_pfn = PFN_DOWN(start);
228 unsigned long size_pages = PFN_DOWN(size);
227 struct zone *zone; 229 struct zone *zone;
228 int rc; 230 int rc;
229 231
230 pgdat = NODE_DATA(nid);
231 zone = pgdat->node_zones + ZONE_MOVABLE;
232 rc = vmem_add_mapping(start, size); 232 rc = vmem_add_mapping(start, size);
233 if (rc) 233 if (rc)
234 return rc; 234 return rc;
235 rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size)); 235 for_each_zone(zone) {
236 if (zone_idx(zone) != ZONE_MOVABLE) {
237 /* Add range within existing zone limits */
238 zone_start_pfn = zone->zone_start_pfn;
239 zone_end_pfn = zone->zone_start_pfn +
240 zone->spanned_pages;
241 } else {
242 /* Add remaining range to ZONE_MOVABLE */
243 zone_start_pfn = start_pfn;
244 zone_end_pfn = start_pfn + size_pages;
245 }
246 if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn)
247 continue;
248 nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
249 zone_end_pfn - start_pfn : size_pages;
250 rc = __add_pages(nid, zone, start_pfn, nr_pages);
251 if (rc)
252 break;
253 start_pfn += nr_pages;
254 size_pages -= nr_pages;
255 if (!size_pages)
256 break;
257 }
236 if (rc) 258 if (rc)
237 vmem_remove_mapping(start, size); 259 vmem_remove_mapping(start, size);
238 return rc; 260 return rc;
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index f09c74881b7e..a0155c02e324 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -29,8 +29,8 @@
29#include <linux/mman.h> 29#include <linux/mman.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/random.h> 31#include <linux/random.h>
32#include <linux/compat.h>
32#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
33#include <asm/compat.h>
34 34
35static unsigned long stack_maxrandom_size(void) 35static unsigned long stack_maxrandom_size(void)
36{ 36{
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 9a4d02f64f16..51b0738e13d1 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -574,7 +574,7 @@ static inline void page_table_free_pgste(unsigned long *table)
574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); 574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
575 mp = (struct gmap_pgtable *) page->index; 575 mp = (struct gmap_pgtable *) page->index;
576 BUG_ON(!list_empty(&mp->mapper)); 576 BUG_ON(!list_empty(&mp->mapper));
577 pgtable_page_ctor(page); 577 pgtable_page_dtor(page);
578 atomic_set(&page->_mapcount, -1); 578 atomic_set(&page->_mapcount, -1);
579 kfree(mp); 579 kfree(mp);
580 __free_page(page); 580 __free_page(page);