diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-28 12:44:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-28 12:44:59 -0400 |
commit | b30fc14c5c94728baa42b7c17d83ea17185b5c40 (patch) | |
tree | 57ac6011666e6ded22128ae4be35cd9950ff90d6 /arch | |
parent | 3c136f29ba5ae8dfcae4958bbcb581420b43a74d (diff) | |
parent | ea4bfdf52a5a84492cce881baadc5fab36adeade (diff) |
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] s390: Fix build for !CONFIG_S390_GUEST + CONFIG_VIRTIO_CONSOLE
[S390] No more 4kb stacks.
[S390] Change default IPL method to IPL_VM.
[S390] tape: disable interrupts in tape_open and tape_release
[S390] appldata: unsigned ops->size cannot be negative
[S390] tape block: complete request with correct locking
[S390] Fix sysdev class file creation.
[S390] pgtables: Fix race in enable_sie vs. page table ops
[S390] qdio: remove incorrect memset
[S390] qdio: prevent double qdio shutdown in case of I/O errors
Diffstat (limited to 'arch')
-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/smp.c | 24 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 16 |
9 files changed, 48 insertions, 47 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/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/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) { |