diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-20 03:02:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-20 03:02:39 -0500 |
commit | fbc2a06056c9aa3cb8c44bf1cfeb1d260e229e5c (patch) | |
tree | feb2a1c13ad3dff5a8c7ab3c0265e8eca7a0c5a3 /arch/s390 | |
parent | a3d732f93785da17e0137210deadb4616f5536fc (diff) | |
parent | ee2f6cc7f9ea2542ad46070ed62ba7aa04d08871 (diff) |
Merge branch 'linus' into x86/uv
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/Kconfig | 16 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 2 | ||||
-rw-r--r-- | arch/s390/include/asm/kvm_virtio.h | 2 | ||||
-rw-r--r-- | arch/s390/include/asm/mmu.h | 3 | ||||
-rw-r--r-- | arch/s390/include/asm/mmu_context.h | 19 | ||||
-rw-r--r-- | arch/s390/include/asm/pgtable.h | 8 | ||||
-rw-r--r-- | arch/s390/include/asm/thread_info.h | 5 | ||||
-rw-r--r-- | arch/s390/kernel/entry.S | 20 | ||||
-rw-r--r-- | arch/s390/kernel/entry64.S | 11 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 24 | ||||
-rw-r--r-- | arch/s390/kernel/sys_s390.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 11 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 16 |
15 files changed, 81 insertions, 65 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 70b7645ce745..8116a3328a19 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -241,19 +241,17 @@ config PACK_STACK | |||
241 | Say Y if you are unsure. | 241 | Say Y if you are unsure. |
242 | 242 | ||
243 | config SMALL_STACK | 243 | config SMALL_STACK |
244 | bool "Use 4kb/8kb for kernel stack instead of 8kb/16kb" | 244 | bool "Use 8kb for kernel stack instead of 16kb" |
245 | depends on PACK_STACK && !LOCKDEP | 245 | depends on PACK_STACK && 64BIT && !LOCKDEP |
246 | help | 246 | help |
247 | If you say Y here and the compiler supports the -mkernel-backchain | 247 | If you say Y here and the compiler supports the -mkernel-backchain |
248 | option the kernel will use a smaller kernel stack size. For 31 bit | 248 | option the kernel will use a smaller kernel stack size. The reduced |
249 | the reduced size is 4kb instead of 8kb and for 64 bit it is 8kb | 249 | size is 8kb instead of 16kb. This allows to run more threads on a |
250 | instead of 16kb. This allows to run more thread on a system and | 250 | system and reduces the pressure on the memory management for higher |
251 | reduces the pressure on the memory management for higher order | 251 | order page allocations. |
252 | page allocations. | ||
253 | 252 | ||
254 | Say N if you are unsure. | 253 | Say N if you are unsure. |
255 | 254 | ||
256 | |||
257 | config CHECK_STACK | 255 | config CHECK_STACK |
258 | bool "Detect kernel stack overflow" | 256 | bool "Detect kernel stack overflow" |
259 | help | 257 | help |
@@ -384,7 +382,7 @@ config IPL | |||
384 | choice | 382 | choice |
385 | prompt "IPL method generated into head.S" | 383 | prompt "IPL method generated into head.S" |
386 | depends on IPL | 384 | depends on IPL |
387 | default IPL_TAPE | 385 | default IPL_VM |
388 | help | 386 | help |
389 | Select "tape" if you want to IPL the image from a Tape. | 387 | Select "tape" if you want to IPL the image from a Tape. |
390 | 388 | ||
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index a7f8979fb925..a06a47cdd5e0 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -424,7 +424,7 @@ out: | |||
424 | */ | 424 | */ |
425 | int appldata_register_ops(struct appldata_ops *ops) | 425 | int appldata_register_ops(struct appldata_ops *ops) |
426 | { | 426 | { |
427 | if ((ops->size > APPLDATA_MAX_REC_SIZE) || (ops->size < 0)) | 427 | if (ops->size > APPLDATA_MAX_REC_SIZE) |
428 | return -EINVAL; | 428 | return -EINVAL; |
429 | 429 | ||
430 | ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); | 430 | ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); |
diff --git a/arch/s390/include/asm/kvm_virtio.h b/arch/s390/include/asm/kvm_virtio.h index 146100224def..c13568b9351c 100644 --- a/arch/s390/include/asm/kvm_virtio.h +++ b/arch/s390/include/asm/kvm_virtio.h | |||
@@ -52,7 +52,7 @@ struct kvm_vqconfig { | |||
52 | 52 | ||
53 | #ifdef __KERNEL__ | 53 | #ifdef __KERNEL__ |
54 | /* early virtio console setup */ | 54 | /* early virtio console setup */ |
55 | #ifdef CONFIG_VIRTIO_CONSOLE | 55 | #ifdef CONFIG_S390_GUEST |
56 | extern void s390_virtio_console_init(void); | 56 | extern void s390_virtio_console_init(void); |
57 | #else | 57 | #else |
58 | static inline void s390_virtio_console_init(void) | 58 | static inline void s390_virtio_console_init(void) |
diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h index 5dd5e7b3476f..d2b4ff831477 100644 --- a/arch/s390/include/asm/mmu.h +++ b/arch/s390/include/asm/mmu.h | |||
@@ -7,7 +7,8 @@ typedef struct { | |||
7 | unsigned long asce_bits; | 7 | unsigned long asce_bits; |
8 | unsigned long asce_limit; | 8 | unsigned long asce_limit; |
9 | int noexec; | 9 | int noexec; |
10 | int pgstes; | 10 | int has_pgste; /* The mmu context has extended page tables */ |
11 | int alloc_pgste; /* cloned contexts will have extended page tables */ | ||
11 | } mm_context_t; | 12 | } mm_context_t; |
12 | 13 | ||
13 | #endif | 14 | #endif |
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h index 4c2fbf48c9c4..28ec870655af 100644 --- a/arch/s390/include/asm/mmu_context.h +++ b/arch/s390/include/asm/mmu_context.h | |||
@@ -20,12 +20,25 @@ static inline int init_new_context(struct task_struct *tsk, | |||
20 | #ifdef CONFIG_64BIT | 20 | #ifdef CONFIG_64BIT |
21 | mm->context.asce_bits |= _ASCE_TYPE_REGION3; | 21 | mm->context.asce_bits |= _ASCE_TYPE_REGION3; |
22 | #endif | 22 | #endif |
23 | if (current->mm->context.pgstes) { | 23 | if (current->mm->context.alloc_pgste) { |
24 | /* | ||
25 | * alloc_pgste indicates, that any NEW context will be created | ||
26 | * with extended page tables. The old context is unchanged. The | ||
27 | * page table allocation and the page table operations will | ||
28 | * look at has_pgste to distinguish normal and extended page | ||
29 | * tables. The only way to create extended page tables is to | ||
30 | * set alloc_pgste and then create a new context (e.g. dup_mm). | ||
31 | * The page table allocation is called after init_new_context | ||
32 | * and if has_pgste is set, it will create extended page | ||
33 | * tables. | ||
34 | */ | ||
24 | mm->context.noexec = 0; | 35 | mm->context.noexec = 0; |
25 | mm->context.pgstes = 1; | 36 | mm->context.has_pgste = 1; |
37 | mm->context.alloc_pgste = 1; | ||
26 | } else { | 38 | } else { |
27 | mm->context.noexec = s390_noexec; | 39 | mm->context.noexec = s390_noexec; |
28 | mm->context.pgstes = 0; | 40 | mm->context.has_pgste = 0; |
41 | mm->context.alloc_pgste = 0; | ||
29 | } | 42 | } |
30 | mm->context.asce_limit = STACK_TOP_MAX; | 43 | mm->context.asce_limit = STACK_TOP_MAX; |
31 | crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm)); | 44 | crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm)); |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 1a928f84afd6..7fc76133b3e4 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -679,7 +679,7 @@ static inline void pmd_clear(pmd_t *pmd) | |||
679 | 679 | ||
680 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 680 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
681 | { | 681 | { |
682 | if (mm->context.pgstes) | 682 | if (mm->context.has_pgste) |
683 | ptep_rcp_copy(ptep); | 683 | ptep_rcp_copy(ptep); |
684 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; | 684 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; |
685 | if (mm->context.noexec) | 685 | if (mm->context.noexec) |
@@ -763,7 +763,7 @@ static inline int kvm_s390_test_and_clear_page_dirty(struct mm_struct *mm, | |||
763 | struct page *page; | 763 | struct page *page; |
764 | unsigned int skey; | 764 | unsigned int skey; |
765 | 765 | ||
766 | if (!mm->context.pgstes) | 766 | if (!mm->context.has_pgste) |
767 | return -EINVAL; | 767 | return -EINVAL; |
768 | rcp_lock(ptep); | 768 | rcp_lock(ptep); |
769 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); | 769 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); |
@@ -794,7 +794,7 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, | |||
794 | int young; | 794 | int young; |
795 | unsigned long *pgste; | 795 | unsigned long *pgste; |
796 | 796 | ||
797 | if (!vma->vm_mm->context.pgstes) | 797 | if (!vma->vm_mm->context.has_pgste) |
798 | return 0; | 798 | return 0; |
799 | physpage = pte_val(*ptep) & PAGE_MASK; | 799 | physpage = pte_val(*ptep) & PAGE_MASK; |
800 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); | 800 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); |
@@ -844,7 +844,7 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep) | |||
844 | static inline void ptep_invalidate(struct mm_struct *mm, | 844 | static inline void ptep_invalidate(struct mm_struct *mm, |
845 | unsigned long address, pte_t *ptep) | 845 | unsigned long address, pte_t *ptep) |
846 | { | 846 | { |
847 | if (mm->context.pgstes) { | 847 | if (mm->context.has_pgste) { |
848 | rcp_lock(ptep); | 848 | rcp_lock(ptep); |
849 | __ptep_ipte(address, ptep); | 849 | __ptep_ipte(address, ptep); |
850 | ptep_rcp_copy(ptep); | 850 | ptep_rcp_copy(ptep); |
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index de3fad60c682..c1eaf9604da7 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h | |||
@@ -15,13 +15,8 @@ | |||
15 | * Size of kernel stack for each process | 15 | * Size of kernel stack for each process |
16 | */ | 16 | */ |
17 | #ifndef __s390x__ | 17 | #ifndef __s390x__ |
18 | #ifndef __SMALL_STACK | ||
19 | #define THREAD_ORDER 1 | 18 | #define THREAD_ORDER 1 |
20 | #define ASYNC_ORDER 1 | 19 | #define ASYNC_ORDER 1 |
21 | #else | ||
22 | #define THREAD_ORDER 0 | ||
23 | #define ASYNC_ORDER 0 | ||
24 | #endif | ||
25 | #else /* __s390x__ */ | 20 | #else /* __s390x__ */ |
26 | #ifndef __SMALL_STACK | 21 | #ifndef __SMALL_STACK |
27 | #define THREAD_ORDER 2 | 22 | #define THREAD_ORDER 2 |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index ed500ef799b7..08844fc24a2e 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -61,22 +61,25 @@ STACK_SIZE = 1 << STACK_SHIFT | |||
61 | 61 | ||
62 | #ifdef CONFIG_TRACE_IRQFLAGS | 62 | #ifdef CONFIG_TRACE_IRQFLAGS |
63 | .macro TRACE_IRQS_ON | 63 | .macro TRACE_IRQS_ON |
64 | l %r1,BASED(.Ltrace_irq_on) | 64 | basr %r2,%r0 |
65 | l %r1,BASED(.Ltrace_irq_on_caller) | ||
65 | basr %r14,%r1 | 66 | basr %r14,%r1 |
66 | .endm | 67 | .endm |
67 | 68 | ||
68 | .macro TRACE_IRQS_OFF | 69 | .macro TRACE_IRQS_OFF |
69 | l %r1,BASED(.Ltrace_irq_off) | 70 | basr %r2,%r0 |
71 | l %r1,BASED(.Ltrace_irq_off_caller) | ||
70 | basr %r14,%r1 | 72 | basr %r14,%r1 |
71 | .endm | 73 | .endm |
72 | 74 | ||
73 | .macro TRACE_IRQS_CHECK | 75 | .macro TRACE_IRQS_CHECK |
76 | basr %r2,%r0 | ||
74 | tm SP_PSW(%r15),0x03 # irqs enabled? | 77 | tm SP_PSW(%r15),0x03 # irqs enabled? |
75 | jz 0f | 78 | jz 0f |
76 | l %r1,BASED(.Ltrace_irq_on) | 79 | l %r1,BASED(.Ltrace_irq_on_caller) |
77 | basr %r14,%r1 | 80 | basr %r14,%r1 |
78 | j 1f | 81 | j 1f |
79 | 0: l %r1,BASED(.Ltrace_irq_off) | 82 | 0: l %r1,BASED(.Ltrace_irq_off_caller) |
80 | basr %r14,%r1 | 83 | basr %r14,%r1 |
81 | 1: | 84 | 1: |
82 | .endm | 85 | .endm |
@@ -1113,9 +1116,12 @@ cleanup_io_leave_insn: | |||
1113 | .Lschedtail: .long schedule_tail | 1116 | .Lschedtail: .long schedule_tail |
1114 | .Lsysc_table: .long sys_call_table | 1117 | .Lsysc_table: .long sys_call_table |
1115 | #ifdef CONFIG_TRACE_IRQFLAGS | 1118 | #ifdef CONFIG_TRACE_IRQFLAGS |
1116 | .Ltrace_irq_on: .long trace_hardirqs_on | 1119 | .Ltrace_irq_on_caller: |
1117 | .Ltrace_irq_off: | 1120 | .long trace_hardirqs_on_caller |
1118 | .long trace_hardirqs_off | 1121 | .Ltrace_irq_off_caller: |
1122 | .long trace_hardirqs_off_caller | ||
1123 | #endif | ||
1124 | #ifdef CONFIG_LOCKDEP | ||
1119 | .Llockdep_sys_exit: | 1125 | .Llockdep_sys_exit: |
1120 | .long lockdep_sys_exit | 1126 | .long lockdep_sys_exit |
1121 | #endif | 1127 | #endif |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index d7ce150453f2..41aca06682aa 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
@@ -61,19 +61,22 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ | |||
61 | 61 | ||
62 | #ifdef CONFIG_TRACE_IRQFLAGS | 62 | #ifdef CONFIG_TRACE_IRQFLAGS |
63 | .macro TRACE_IRQS_ON | 63 | .macro TRACE_IRQS_ON |
64 | brasl %r14,trace_hardirqs_on | 64 | basr %r2,%r0 |
65 | brasl %r14,trace_hardirqs_on_caller | ||
65 | .endm | 66 | .endm |
66 | 67 | ||
67 | .macro TRACE_IRQS_OFF | 68 | .macro TRACE_IRQS_OFF |
68 | brasl %r14,trace_hardirqs_off | 69 | basr %r2,%r0 |
70 | brasl %r14,trace_hardirqs_off_caller | ||
69 | .endm | 71 | .endm |
70 | 72 | ||
71 | .macro TRACE_IRQS_CHECK | 73 | .macro TRACE_IRQS_CHECK |
74 | basr %r2,%r0 | ||
72 | tm SP_PSW(%r15),0x03 # irqs enabled? | 75 | tm SP_PSW(%r15),0x03 # irqs enabled? |
73 | jz 0f | 76 | jz 0f |
74 | brasl %r14,trace_hardirqs_on | 77 | brasl %r14,trace_hardirqs_on_caller |
75 | j 1f | 78 | j 1f |
76 | 0: brasl %r14,trace_hardirqs_off | 79 | 0: brasl %r14,trace_hardirqs_off_caller |
77 | 1: | 80 | 1: |
78 | .endm | 81 | .endm |
79 | #else | 82 | #else |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 3e2c05cb6a87..04f8c67a6101 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -136,9 +136,12 @@ static void default_idle(void) | |||
136 | return; | 136 | return; |
137 | } | 137 | } |
138 | trace_hardirqs_on(); | 138 | trace_hardirqs_on(); |
139 | /* Don't trace preempt off for idle. */ | ||
140 | stop_critical_timings(); | ||
139 | /* Wait for external, I/O or machine check interrupt. */ | 141 | /* Wait for external, I/O or machine check interrupt. */ |
140 | __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | | 142 | __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | |
141 | PSW_MASK_IO | PSW_MASK_EXT); | 143 | PSW_MASK_IO | PSW_MASK_EXT); |
144 | start_critical_timings(); | ||
142 | } | 145 | } |
143 | 146 | ||
144 | void cpu_idle(void) | 147 | void cpu_idle(void) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 62122bad1e33..400b040df7fa 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -604,13 +604,13 @@ setup_memory(void) | |||
604 | if (memory_chunk[i].type != CHUNK_READ_WRITE) | 604 | if (memory_chunk[i].type != CHUNK_READ_WRITE) |
605 | continue; | 605 | continue; |
606 | start_chunk = PFN_DOWN(memory_chunk[i].addr); | 606 | start_chunk = PFN_DOWN(memory_chunk[i].addr); |
607 | end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1; | 607 | end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size); |
608 | end_chunk = min(end_chunk, end_pfn); | 608 | end_chunk = min(end_chunk, end_pfn); |
609 | if (start_chunk >= end_chunk) | 609 | if (start_chunk >= end_chunk) |
610 | continue; | 610 | continue; |
611 | add_active_range(0, start_chunk, end_chunk); | 611 | add_active_range(0, start_chunk, end_chunk); |
612 | pfn = max(start_chunk, start_pfn); | 612 | pfn = max(start_chunk, start_pfn); |
613 | for (; pfn <= end_chunk; pfn++) | 613 | for (; pfn < end_chunk; pfn++) |
614 | page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); | 614 | page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY); |
615 | } | 615 | } |
616 | 616 | ||
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 9e8b1f9b8f4d..b5595688a477 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -1119,9 +1119,7 @@ out: | |||
1119 | return rc; | 1119 | return rc; |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | static ssize_t __ref rescan_store(struct sys_device *dev, | 1122 | static ssize_t __ref rescan_store(struct sysdev_class *class, const char *buf, |
1123 | struct sysdev_attribute *attr, | ||
1124 | const char *buf, | ||
1125 | size_t count) | 1123 | size_t count) |
1126 | { | 1124 | { |
1127 | int rc; | 1125 | int rc; |
@@ -1129,12 +1127,10 @@ static ssize_t __ref rescan_store(struct sys_device *dev, | |||
1129 | rc = smp_rescan_cpus(); | 1127 | rc = smp_rescan_cpus(); |
1130 | return rc ? rc : count; | 1128 | return rc ? rc : count; |
1131 | } | 1129 | } |
1132 | static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store); | 1130 | static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store); |
1133 | #endif /* CONFIG_HOTPLUG_CPU */ | 1131 | #endif /* CONFIG_HOTPLUG_CPU */ |
1134 | 1132 | ||
1135 | static ssize_t dispatching_show(struct sys_device *dev, | 1133 | static ssize_t dispatching_show(struct sysdev_class *class, char *buf) |
1136 | struct sysdev_attribute *attr, | ||
1137 | char *buf) | ||
1138 | { | 1134 | { |
1139 | ssize_t count; | 1135 | ssize_t count; |
1140 | 1136 | ||
@@ -1144,9 +1140,8 @@ static ssize_t dispatching_show(struct sys_device *dev, | |||
1144 | return count; | 1140 | return count; |
1145 | } | 1141 | } |
1146 | 1142 | ||
1147 | static ssize_t dispatching_store(struct sys_device *dev, | 1143 | static ssize_t dispatching_store(struct sysdev_class *dev, const char *buf, |
1148 | struct sysdev_attribute *attr, | 1144 | size_t count) |
1149 | const char *buf, size_t count) | ||
1150 | { | 1145 | { |
1151 | int val, rc; | 1146 | int val, rc; |
1152 | char delim; | 1147 | char delim; |
@@ -1168,7 +1163,8 @@ out: | |||
1168 | put_online_cpus(); | 1163 | put_online_cpus(); |
1169 | return rc ? rc : count; | 1164 | return rc ? rc : count; |
1170 | } | 1165 | } |
1171 | static SYSDEV_ATTR(dispatching, 0644, dispatching_show, dispatching_store); | 1166 | static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, |
1167 | dispatching_store); | ||
1172 | 1168 | ||
1173 | static int __init topology_init(void) | 1169 | static int __init topology_init(void) |
1174 | { | 1170 | { |
@@ -1178,13 +1174,11 @@ static int __init topology_init(void) | |||
1178 | register_cpu_notifier(&smp_cpu_nb); | 1174 | register_cpu_notifier(&smp_cpu_nb); |
1179 | 1175 | ||
1180 | #ifdef CONFIG_HOTPLUG_CPU | 1176 | #ifdef CONFIG_HOTPLUG_CPU |
1181 | rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 1177 | rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan); |
1182 | &attr_rescan.attr); | ||
1183 | if (rc) | 1178 | if (rc) |
1184 | return rc; | 1179 | return rc; |
1185 | #endif | 1180 | #endif |
1186 | rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 1181 | rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching); |
1187 | &attr_dispatching.attr); | ||
1188 | if (rc) | 1182 | if (rc) |
1189 | return rc; | 1183 | return rc; |
1190 | for_each_present_cpu(cpu) { | 1184 | for_each_present_cpu(cpu) { |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 5fdb799062b7..4fe952e557ac 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -198,7 +198,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name) | |||
198 | { | 198 | { |
199 | int ret = sys_newuname(name); | 199 | int ret = sys_newuname(name); |
200 | 200 | ||
201 | if (current->personality == PER_LINUX32 && !ret) { | 201 | if (personality(current->personality) == PER_LINUX32 && !ret) { |
202 | ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); | 202 | ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); |
203 | if (ret) ret = -EFAULT; | 203 | if (ret) ret = -EFAULT; |
204 | } | 204 | } |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 632b13e10053..a947899dcba1 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -65,18 +65,21 @@ static int machine_has_topology_irq; | |||
65 | static struct timer_list topology_timer; | 65 | static struct timer_list topology_timer; |
66 | static void set_topology_timer(void); | 66 | static void set_topology_timer(void); |
67 | static DECLARE_WORK(topology_work, topology_work_fn); | 67 | static DECLARE_WORK(topology_work, topology_work_fn); |
68 | /* topology_lock protects the core linked list */ | ||
69 | static DEFINE_SPINLOCK(topology_lock); | ||
68 | 70 | ||
69 | cpumask_t cpu_core_map[NR_CPUS]; | 71 | cpumask_t cpu_core_map[NR_CPUS]; |
70 | 72 | ||
71 | cpumask_t cpu_coregroup_map(unsigned int cpu) | 73 | cpumask_t cpu_coregroup_map(unsigned int cpu) |
72 | { | 74 | { |
73 | struct core_info *core = &core_info; | 75 | struct core_info *core = &core_info; |
76 | unsigned long flags; | ||
74 | cpumask_t mask; | 77 | cpumask_t mask; |
75 | 78 | ||
76 | cpus_clear(mask); | 79 | cpus_clear(mask); |
77 | if (!machine_has_topology) | 80 | if (!machine_has_topology) |
78 | return cpu_present_map; | 81 | return cpu_present_map; |
79 | mutex_lock(&smp_cpu_state_mutex); | 82 | spin_lock_irqsave(&topology_lock, flags); |
80 | while (core) { | 83 | while (core) { |
81 | if (cpu_isset(cpu, core->mask)) { | 84 | if (cpu_isset(cpu, core->mask)) { |
82 | mask = core->mask; | 85 | mask = core->mask; |
@@ -84,7 +87,7 @@ cpumask_t cpu_coregroup_map(unsigned int cpu) | |||
84 | } | 87 | } |
85 | core = core->next; | 88 | core = core->next; |
86 | } | 89 | } |
87 | mutex_unlock(&smp_cpu_state_mutex); | 90 | spin_unlock_irqrestore(&topology_lock, flags); |
88 | if (cpus_empty(mask)) | 91 | if (cpus_empty(mask)) |
89 | mask = cpumask_of_cpu(cpu); | 92 | mask = cpumask_of_cpu(cpu); |
90 | return mask; | 93 | return mask; |
@@ -133,7 +136,7 @@ static void tl_to_cores(struct tl_info *info) | |||
133 | union tl_entry *tle, *end; | 136 | union tl_entry *tle, *end; |
134 | struct core_info *core = &core_info; | 137 | struct core_info *core = &core_info; |
135 | 138 | ||
136 | mutex_lock(&smp_cpu_state_mutex); | 139 | spin_lock_irq(&topology_lock); |
137 | clear_cores(); | 140 | clear_cores(); |
138 | tle = info->tle; | 141 | tle = info->tle; |
139 | end = (union tl_entry *)((unsigned long)info + info->length); | 142 | end = (union tl_entry *)((unsigned long)info + info->length); |
@@ -157,7 +160,7 @@ static void tl_to_cores(struct tl_info *info) | |||
157 | } | 160 | } |
158 | tle = next_tle(tle); | 161 | tle = next_tle(tle); |
159 | } | 162 | } |
160 | mutex_unlock(&smp_cpu_state_mutex); | 163 | spin_unlock_irq(&topology_lock); |
161 | } | 164 | } |
162 | 165 | ||
163 | static void topology_update_polarization_simple(void) | 166 | static void topology_update_polarization_simple(void) |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 3d98ba82ea67..ef3635b52fc0 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -169,7 +169,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) | |||
169 | unsigned long *table; | 169 | unsigned long *table; |
170 | unsigned long bits; | 170 | unsigned long bits; |
171 | 171 | ||
172 | bits = (mm->context.noexec || mm->context.pgstes) ? 3UL : 1UL; | 172 | bits = (mm->context.noexec || mm->context.has_pgste) ? 3UL : 1UL; |
173 | spin_lock(&mm->page_table_lock); | 173 | spin_lock(&mm->page_table_lock); |
174 | page = NULL; | 174 | page = NULL; |
175 | if (!list_empty(&mm->context.pgtable_list)) { | 175 | if (!list_empty(&mm->context.pgtable_list)) { |
@@ -186,7 +186,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) | |||
186 | pgtable_page_ctor(page); | 186 | pgtable_page_ctor(page); |
187 | page->flags &= ~FRAG_MASK; | 187 | page->flags &= ~FRAG_MASK; |
188 | table = (unsigned long *) page_to_phys(page); | 188 | table = (unsigned long *) page_to_phys(page); |
189 | if (mm->context.pgstes) | 189 | if (mm->context.has_pgste) |
190 | clear_table_pgstes(table); | 190 | clear_table_pgstes(table); |
191 | else | 191 | else |
192 | clear_table(table, _PAGE_TYPE_EMPTY, PAGE_SIZE); | 192 | clear_table(table, _PAGE_TYPE_EMPTY, PAGE_SIZE); |
@@ -210,7 +210,7 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) | |||
210 | struct page *page; | 210 | struct page *page; |
211 | unsigned long bits; | 211 | unsigned long bits; |
212 | 212 | ||
213 | bits = (mm->context.noexec || mm->context.pgstes) ? 3UL : 1UL; | 213 | bits = (mm->context.noexec || mm->context.has_pgste) ? 3UL : 1UL; |
214 | bits <<= (__pa(table) & (PAGE_SIZE - 1)) / 256 / sizeof(unsigned long); | 214 | bits <<= (__pa(table) & (PAGE_SIZE - 1)) / 256 / sizeof(unsigned long); |
215 | page = pfn_to_page(__pa(table) >> PAGE_SHIFT); | 215 | page = pfn_to_page(__pa(table) >> PAGE_SHIFT); |
216 | spin_lock(&mm->page_table_lock); | 216 | spin_lock(&mm->page_table_lock); |
@@ -257,7 +257,7 @@ int s390_enable_sie(void) | |||
257 | struct mm_struct *mm, *old_mm; | 257 | struct mm_struct *mm, *old_mm; |
258 | 258 | ||
259 | /* Do we have pgstes? if yes, we are done */ | 259 | /* Do we have pgstes? if yes, we are done */ |
260 | if (tsk->mm->context.pgstes) | 260 | if (tsk->mm->context.has_pgste) |
261 | return 0; | 261 | return 0; |
262 | 262 | ||
263 | /* lets check if we are allowed to replace the mm */ | 263 | /* lets check if we are allowed to replace the mm */ |
@@ -269,14 +269,14 @@ int s390_enable_sie(void) | |||
269 | } | 269 | } |
270 | task_unlock(tsk); | 270 | task_unlock(tsk); |
271 | 271 | ||
272 | /* we copy the mm with pgstes enabled */ | 272 | /* we copy the mm and let dup_mm create the page tables with_pgstes */ |
273 | tsk->mm->context.pgstes = 1; | 273 | tsk->mm->context.alloc_pgste = 1; |
274 | mm = dup_mm(tsk); | 274 | mm = dup_mm(tsk); |
275 | tsk->mm->context.pgstes = 0; | 275 | tsk->mm->context.alloc_pgste = 0; |
276 | if (!mm) | 276 | if (!mm) |
277 | return -ENOMEM; | 277 | return -ENOMEM; |
278 | 278 | ||
279 | /* Now lets check again if somebody attached ptrace etc */ | 279 | /* Now lets check again if something happened */ |
280 | task_lock(tsk); | 280 | task_lock(tsk); |
281 | if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || | 281 | if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || |
282 | tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) { | 282 | tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) { |