diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-22 14:12:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-22 14:12:08 -0400 |
commit | 53ce2dc2718c57346c543dab254fc900c6fe6c65 (patch) | |
tree | 451fcbc89084b1d9b83c105294794f29bf6d59f3 /arch | |
parent | 8b14cb9953c6b569327e9372718cff09a98f9589 (diff) | |
parent | c51b9621796c31810fb66509ea1faee4597d9c03 (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] Change atomic_read/set to inline functions with barrier semantics.
[S390] kprobes: fix instruction length calculation
[S390] hypfs: inode corruption due to missing locking
[S390] disassembler: fix b2 opcodes like srst, bsg, and others
[S390] vmur: fix reference counting for vmur device structure
[S390] vmur: fix diag14 exceptions with addresses > 2GB.
[S390] qdio: Refresh buffer states for IQDIO Asynchronous output queue
[S390] qdio: fix EQBS handling on CCQ96
[S390] cio: change confusing message in cmf.
[S390] cio: dont forget to set last slot to NULL in ccw_uevent().
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/hypfs/inode.c | 33 | ||||
-rw-r--r-- | arch/s390/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/s390/kernel/diag.c | 102 | ||||
-rw-r--r-- | arch/s390/kernel/dis.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/kprobes.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/s390_ksyms.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/cmm.c | 1 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 17 |
8 files changed, 131 insertions, 29 deletions
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index ad4ca75c0f04..5245717295b8 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -60,17 +60,28 @@ static void hypfs_add_dentry(struct dentry *dentry) | |||
60 | hypfs_last_dentry = dentry; | 60 | hypfs_last_dentry = dentry; |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline int hypfs_positive(struct dentry *dentry) | ||
64 | { | ||
65 | return dentry->d_inode && !d_unhashed(dentry); | ||
66 | } | ||
67 | |||
63 | static void hypfs_remove(struct dentry *dentry) | 68 | static void hypfs_remove(struct dentry *dentry) |
64 | { | 69 | { |
65 | struct dentry *parent; | 70 | struct dentry *parent; |
66 | 71 | ||
67 | parent = dentry->d_parent; | 72 | parent = dentry->d_parent; |
68 | if (S_ISDIR(dentry->d_inode->i_mode)) | 73 | if (!parent || !parent->d_inode) |
69 | simple_rmdir(parent->d_inode, dentry); | 74 | return; |
70 | else | 75 | mutex_lock(&parent->d_inode->i_mutex); |
71 | simple_unlink(parent->d_inode, dentry); | 76 | if (hypfs_positive(dentry)) { |
77 | if (S_ISDIR(dentry->d_inode->i_mode)) | ||
78 | simple_rmdir(parent->d_inode, dentry); | ||
79 | else | ||
80 | simple_unlink(parent->d_inode, dentry); | ||
81 | } | ||
72 | d_delete(dentry); | 82 | d_delete(dentry); |
73 | dput(dentry); | 83 | dput(dentry); |
84 | mutex_unlock(&parent->d_inode->i_mutex); | ||
74 | } | 85 | } |
75 | 86 | ||
76 | static void hypfs_delete_tree(struct dentry *root) | 87 | static void hypfs_delete_tree(struct dentry *root) |
@@ -315,6 +326,7 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) | |||
315 | } | 326 | } |
316 | hypfs_update_update(sb); | 327 | hypfs_update_update(sb); |
317 | sb->s_root = root_dentry; | 328 | sb->s_root = root_dentry; |
329 | printk(KERN_INFO "hypfs: Hypervisor filesystem mounted\n"); | ||
318 | return 0; | 330 | return 0; |
319 | 331 | ||
320 | err_tree: | 332 | err_tree: |
@@ -356,13 +368,17 @@ static struct dentry *hypfs_create_file(struct super_block *sb, | |||
356 | qname.name = name; | 368 | qname.name = name; |
357 | qname.len = strlen(name); | 369 | qname.len = strlen(name); |
358 | qname.hash = full_name_hash(name, qname.len); | 370 | qname.hash = full_name_hash(name, qname.len); |
371 | mutex_lock(&parent->d_inode->i_mutex); | ||
359 | dentry = lookup_one_len(name, parent, strlen(name)); | 372 | dentry = lookup_one_len(name, parent, strlen(name)); |
360 | if (IS_ERR(dentry)) | 373 | if (IS_ERR(dentry)) { |
361 | return ERR_PTR(-ENOMEM); | 374 | dentry = ERR_PTR(-ENOMEM); |
375 | goto fail; | ||
376 | } | ||
362 | inode = hypfs_make_inode(sb, mode); | 377 | inode = hypfs_make_inode(sb, mode); |
363 | if (!inode) { | 378 | if (!inode) { |
364 | dput(dentry); | 379 | dput(dentry); |
365 | return ERR_PTR(-ENOMEM); | 380 | dentry = ERR_PTR(-ENOMEM); |
381 | goto fail; | ||
366 | } | 382 | } |
367 | if (mode & S_IFREG) { | 383 | if (mode & S_IFREG) { |
368 | inode->i_fop = &hypfs_file_ops; | 384 | inode->i_fop = &hypfs_file_ops; |
@@ -379,6 +395,8 @@ static struct dentry *hypfs_create_file(struct super_block *sb, | |||
379 | inode->i_private = data; | 395 | inode->i_private = data; |
380 | d_instantiate(dentry, inode); | 396 | d_instantiate(dentry, inode); |
381 | dget(dentry); | 397 | dget(dentry); |
398 | fail: | ||
399 | mutex_unlock(&parent->d_inode->i_mutex); | ||
382 | return dentry; | 400 | return dentry; |
383 | } | 401 | } |
384 | 402 | ||
@@ -391,7 +409,6 @@ struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent, | |||
391 | if (IS_ERR(dentry)) | 409 | if (IS_ERR(dentry)) |
392 | return dentry; | 410 | return dentry; |
393 | hypfs_add_dentry(dentry); | 411 | hypfs_add_dentry(dentry); |
394 | parent->d_inode->i_nlink++; | ||
395 | return dentry; | 412 | return dentry; |
396 | } | 413 | } |
397 | 414 | ||
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 3195d375bd51..56cb71007cd9 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile | |||
@@ -6,7 +6,7 @@ EXTRA_AFLAGS := -traditional | |||
6 | 6 | ||
7 | obj-y := bitmap.o traps.o time.o process.o base.o early.o \ | 7 | obj-y := bitmap.o traps.o time.o process.o base.o early.o \ |
8 | setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ | 8 | setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ |
9 | semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o | 9 | semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o |
10 | 10 | ||
11 | obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) | 11 | obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) |
12 | obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) | 12 | obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) |
diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c new file mode 100644 index 000000000000..c032d11da8a1 --- /dev/null +++ b/arch/s390/kernel/diag.c | |||
@@ -0,0 +1,102 @@ | |||
1 | /* | ||
2 | * Implementation of s390 diagnose codes | ||
3 | * | ||
4 | * Copyright IBM Corp. 2007 | ||
5 | * Author(s): Michael Holzheu <holzheu@de.ibm.com> | ||
6 | */ | ||
7 | |||
8 | #include <linux/module.h> | ||
9 | #include <asm/diag.h> | ||
10 | |||
11 | /* | ||
12 | * Diagnose 10: Release pages | ||
13 | */ | ||
14 | void diag10(unsigned long addr) | ||
15 | { | ||
16 | if (addr >= 0x7ff00000) | ||
17 | return; | ||
18 | asm volatile( | ||
19 | #ifdef CONFIG_64BIT | ||
20 | " sam31\n" | ||
21 | " diag %0,%0,0x10\n" | ||
22 | "0: sam64\n" | ||
23 | #else | ||
24 | " diag %0,%0,0x10\n" | ||
25 | "0:\n" | ||
26 | #endif | ||
27 | EX_TABLE(0b, 0b) | ||
28 | : : "a" (addr)); | ||
29 | } | ||
30 | EXPORT_SYMBOL(diag10); | ||
31 | |||
32 | /* | ||
33 | * Diagnose 14: Input spool file manipulation | ||
34 | */ | ||
35 | int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode) | ||
36 | { | ||
37 | register unsigned long _ry1 asm("2") = ry1; | ||
38 | register unsigned long _ry2 asm("3") = subcode; | ||
39 | int rc = 0; | ||
40 | |||
41 | asm volatile( | ||
42 | #ifdef CONFIG_64BIT | ||
43 | " sam31\n" | ||
44 | " diag %2,2,0x14\n" | ||
45 | " sam64\n" | ||
46 | #else | ||
47 | " diag %2,2,0x14\n" | ||
48 | #endif | ||
49 | " ipm %0\n" | ||
50 | " srl %0,28\n" | ||
51 | : "=d" (rc), "+d" (_ry2) | ||
52 | : "d" (rx), "d" (_ry1) | ||
53 | : "cc"); | ||
54 | |||
55 | return rc; | ||
56 | } | ||
57 | EXPORT_SYMBOL(diag14); | ||
58 | |||
59 | /* | ||
60 | * Diagnose 210: Get information about a virtual device | ||
61 | */ | ||
62 | int diag210(struct diag210 *addr) | ||
63 | { | ||
64 | /* | ||
65 | * diag 210 needs its data below the 2GB border, so we | ||
66 | * use a static data area to be sure | ||
67 | */ | ||
68 | static struct diag210 diag210_tmp; | ||
69 | static DEFINE_SPINLOCK(diag210_lock); | ||
70 | unsigned long flags; | ||
71 | int ccode; | ||
72 | |||
73 | spin_lock_irqsave(&diag210_lock, flags); | ||
74 | diag210_tmp = *addr; | ||
75 | |||
76 | #ifdef CONFIG_64BIT | ||
77 | asm volatile( | ||
78 | " lhi %0,-1\n" | ||
79 | " sam31\n" | ||
80 | " diag %1,0,0x210\n" | ||
81 | "0: ipm %0\n" | ||
82 | " srl %0,28\n" | ||
83 | "1: sam64\n" | ||
84 | EX_TABLE(0b, 1b) | ||
85 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
86 | #else | ||
87 | asm volatile( | ||
88 | " lhi %0,-1\n" | ||
89 | " diag %1,0,0x210\n" | ||
90 | "0: ipm %0\n" | ||
91 | " srl %0,28\n" | ||
92 | "1:\n" | ||
93 | EX_TABLE(0b, 1b) | ||
94 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
95 | #endif | ||
96 | |||
97 | *addr = diag210_tmp; | ||
98 | spin_unlock_irqrestore(&diag210_lock, flags); | ||
99 | |||
100 | return ccode; | ||
101 | } | ||
102 | EXPORT_SYMBOL(diag210); | ||
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index d3057318f2bf..50d2235df732 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c | |||
@@ -577,7 +577,7 @@ static struct insn opcode_b2[] = { | |||
577 | { "esta", 0x4a, INSTR_RRE_RR }, | 577 | { "esta", 0x4a, INSTR_RRE_RR }, |
578 | { "lura", 0x4b, INSTR_RRE_RR }, | 578 | { "lura", 0x4b, INSTR_RRE_RR }, |
579 | { "tar", 0x4c, INSTR_RRE_AR }, | 579 | { "tar", 0x4c, INSTR_RRE_AR }, |
580 | { "cpya", INSTR_RRE_AA }, | 580 | { "cpya", 0x4d, INSTR_RRE_AA }, |
581 | { "sar", 0x4e, INSTR_RRE_AR }, | 581 | { "sar", 0x4e, INSTR_RRE_AR }, |
582 | { "ear", 0x4f, INSTR_RRE_RA }, | 582 | { "ear", 0x4f, INSTR_RRE_RA }, |
583 | { "csp", 0x50, INSTR_RRE_RR }, | 583 | { "csp", 0x50, INSTR_RRE_RR }, |
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 358d2bbbc481..e40373d9fbce 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -85,7 +85,7 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn) | |||
85 | ainsn->reg = (*ainsn->insn & 0xf0) >> 4; | 85 | ainsn->reg = (*ainsn->insn & 0xf0) >> 4; |
86 | 86 | ||
87 | /* save the instruction length (pop 5-5) in bytes */ | 87 | /* save the instruction length (pop 5-5) in bytes */ |
88 | switch (*(__u8 *) (ainsn->insn) >> 4) { | 88 | switch (*(__u8 *) (ainsn->insn) >> 6) { |
89 | case 0: | 89 | case 0: |
90 | ainsn->ilen = 2; | 90 | ainsn->ilen = 2; |
91 | break; | 91 | break; |
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c index 90b5ef529eb7..7234c737f825 100644 --- a/arch/s390/kernel/s390_ksyms.c +++ b/arch/s390/kernel/s390_ksyms.c | |||
@@ -25,7 +25,6 @@ EXPORT_SYMBOL(_oi_bitmap); | |||
25 | EXPORT_SYMBOL(_ni_bitmap); | 25 | EXPORT_SYMBOL(_ni_bitmap); |
26 | EXPORT_SYMBOL(_zb_findmap); | 26 | EXPORT_SYMBOL(_zb_findmap); |
27 | EXPORT_SYMBOL(_sb_findmap); | 27 | EXPORT_SYMBOL(_sb_findmap); |
28 | EXPORT_SYMBOL(diag10); | ||
29 | 28 | ||
30 | /* | 29 | /* |
31 | * semaphore ops | 30 | * semaphore ops |
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index c5b2f4f078bc..fabc50adc46a 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/pgalloc.h> | 21 | #include <asm/pgalloc.h> |
22 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
23 | #include <asm/diag.h> | ||
23 | 24 | ||
24 | static char *sender = "VMRMSVM"; | 25 | static char *sender = "VMRMSVM"; |
25 | module_param(sender, charp, 0400); | 26 | module_param(sender, charp, 0400); |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 9098531a2671..3a25bbf2eb0a 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -42,23 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | |||
42 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); | 42 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); |
43 | char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); | 43 | char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); |
44 | 44 | ||
45 | void diag10(unsigned long addr) | ||
46 | { | ||
47 | if (addr >= 0x7ff00000) | ||
48 | return; | ||
49 | asm volatile( | ||
50 | #ifdef CONFIG_64BIT | ||
51 | " sam31\n" | ||
52 | " diag %0,%0,0x10\n" | ||
53 | "0: sam64\n" | ||
54 | #else | ||
55 | " diag %0,%0,0x10\n" | ||
56 | "0:\n" | ||
57 | #endif | ||
58 | EX_TABLE(0b,0b) | ||
59 | : : "a" (addr)); | ||
60 | } | ||
61 | |||
62 | void show_mem(void) | 45 | void show_mem(void) |
63 | { | 46 | { |
64 | int i, total = 0, reserved = 0; | 47 | int i, total = 0, reserved = 0; |