diff options
32 files changed, 204 insertions, 137 deletions
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index fbe2932fa9e9..6251a4b10be7 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -291,6 +291,28 @@ struct hvcall_mpp_data { | |||
291 | }; | 291 | }; |
292 | 292 | ||
293 | int h_get_mpp(struct hvcall_mpp_data *); | 293 | int h_get_mpp(struct hvcall_mpp_data *); |
294 | |||
295 | #ifdef CONFIG_PPC_PSERIES | ||
296 | extern int CMO_PrPSP; | ||
297 | extern int CMO_SecPSP; | ||
298 | extern unsigned long CMO_PageSize; | ||
299 | |||
300 | static inline int cmo_get_primary_psp(void) | ||
301 | { | ||
302 | return CMO_PrPSP; | ||
303 | } | ||
304 | |||
305 | static inline int cmo_get_secondary_psp(void) | ||
306 | { | ||
307 | return CMO_SecPSP; | ||
308 | } | ||
309 | |||
310 | static inline unsigned long cmo_get_page_size(void) | ||
311 | { | ||
312 | return CMO_PageSize; | ||
313 | } | ||
314 | #endif /* CONFIG_PPC_PSERIES */ | ||
315 | |||
294 | #endif /* __ASSEMBLY__ */ | 316 | #endif /* __ASSEMBLY__ */ |
295 | #endif /* __KERNEL__ */ | 317 | #endif /* __KERNEL__ */ |
296 | #endif /* _ASM_POWERPC_HVCALL_H */ | 318 | #endif /* _ASM_POWERPC_HVCALL_H */ |
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h index 17ba3a881bfd..5f68ecfdf516 100644 --- a/arch/powerpc/include/asm/irqflags.h +++ b/arch/powerpc/include/asm/irqflags.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on | 20 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on |
21 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off | 21 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off |
22 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ | 22 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ |
23 | cmpdi en, 0; \ | 23 | cmpdi en,0; \ |
24 | bne 95f; \ | 24 | bne 95f; \ |
25 | stb en,PACASOFTIRQEN(r13); \ | 25 | stb en,PACASOFTIRQEN(r13); \ |
26 | bl .trace_hardirqs_off; \ | 26 | bl .trace_hardirqs_off; \ |
@@ -29,7 +29,8 @@ | |||
29 | li en,1; | 29 | li en,1; |
30 | #define TRACE_AND_RESTORE_IRQ(en) \ | 30 | #define TRACE_AND_RESTORE_IRQ(en) \ |
31 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ | 31 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ |
32 | 96: stb en,PACASOFTIRQEN(r13) | 32 | stb en,PACASOFTIRQEN(r13); \ |
33 | 96: | ||
33 | #else | 34 | #else |
34 | #define TRACE_ENABLE_INTS | 35 | #define TRACE_ENABLE_INTS |
35 | #define TRACE_DISABLE_INTS | 36 | #define TRACE_DISABLE_INTS |
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 9102b8bf0ead..6b993ef452ff 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h | |||
@@ -147,7 +147,6 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
147 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) | 147 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) |
148 | { | 148 | { |
149 | mm->context.id = NO_CONTEXT; | 149 | mm->context.id = NO_CONTEXT; |
150 | mm->context.vdso_base = 0; | ||
151 | return 0; | 150 | return 0; |
152 | } | 151 | } |
153 | 152 | ||
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index e084272ed1c2..f6cc7a43b4fa 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink) | |||
92 | SYSCALL(uselib) | 92 | SYSCALL(uselib) |
93 | SYSCALL(swapon) | 93 | SYSCALL(swapon) |
94 | SYSCALL(reboot) | 94 | SYSCALL(reboot) |
95 | SYSX(sys_ni_syscall,old32_readdir,old_readdir) | 95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) |
96 | SYSCALL_SPU(mmap) | 96 | SYSCALL_SPU(mmap) |
97 | SYSCALL_SPU(munmap) | 97 | SYSCALL_SPU(munmap) |
98 | SYSCALL_SPU(truncate) | 98 | SYSCALL_SPU(truncate) |
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 99ee2f0f0f2b..8bb657519299 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S | |||
@@ -1155,7 +1155,7 @@ flush_tlbs: | |||
1155 | lis r10, 0x40 | 1155 | lis r10, 0x40 |
1156 | 1: addic. r10, r10, -0x1000 | 1156 | 1: addic. r10, r10, -0x1000 |
1157 | tlbie r10 | 1157 | tlbie r10 |
1158 | blt 1b | 1158 | bgt 1b |
1159 | sync | 1159 | sync |
1160 | blr | 1160 | blr |
1161 | 1161 | ||
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1a09719c7628..b3eef30b5131 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -416,6 +416,8 @@ static void pseries_cmo_data(struct seq_file *m) | |||
416 | unsigned long cmo_faults = 0; | 416 | unsigned long cmo_faults = 0; |
417 | unsigned long cmo_fault_time = 0; | 417 | unsigned long cmo_fault_time = 0; |
418 | 418 | ||
419 | seq_printf(m, "cmo_enabled=%d\n", firmware_has_feature(FW_FEATURE_CMO)); | ||
420 | |||
419 | if (!firmware_has_feature(FW_FEATURE_CMO)) | 421 | if (!firmware_has_feature(FW_FEATURE_CMO)) |
420 | return; | 422 | return; |
421 | 423 | ||
@@ -427,6 +429,9 @@ static void pseries_cmo_data(struct seq_file *m) | |||
427 | seq_printf(m, "cmo_faults=%lu\n", cmo_faults); | 429 | seq_printf(m, "cmo_faults=%lu\n", cmo_faults); |
428 | seq_printf(m, "cmo_fault_time_usec=%lu\n", | 430 | seq_printf(m, "cmo_fault_time_usec=%lu\n", |
429 | cmo_fault_time / tb_ticks_per_usec); | 431 | cmo_fault_time / tb_ticks_per_usec); |
432 | seq_printf(m, "cmo_primary_psp=%d\n", cmo_get_primary_psp()); | ||
433 | seq_printf(m, "cmo_secondary_psp=%d\n", cmo_get_secondary_psp()); | ||
434 | seq_printf(m, "cmo_page_size=%lu\n", cmo_get_page_size()); | ||
430 | } | 435 | } |
431 | 436 | ||
432 | static int pseries_lparcfg_data(struct seq_file *m, void *v) | 437 | static int pseries_lparcfg_data(struct seq_file *m, void *v) |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 6321ae36f729..7a6dfbca7682 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -899,7 +899,7 @@ relocate_new_kernel: | |||
899 | 899 | ||
900 | /* set a new stack at the bottom of our page... */ | 900 | /* set a new stack at the bottom of our page... */ |
901 | /* (not really needed now) */ | 901 | /* (not really needed now) */ |
902 | addi r1, r4, KEXEC_CONTROL_CODE_SIZE - 8 /* for LR Save+Back Chain */ | 902 | addi r1, r4, KEXEC_CONTROL_PAGE_SIZE - 8 /* for LR Save+Back Chain */ |
903 | stw r0, 0(r1) | 903 | stw r0, 0(r1) |
904 | 904 | ||
905 | /* Do the copies */ | 905 | /* Do the copies */ |
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c index af07003573c4..7ff292475269 100644 --- a/arch/powerpc/kernel/module.c +++ b/arch/powerpc/kernel/module.c | |||
@@ -99,18 +99,3 @@ void module_arch_cleanup(struct module *mod) | |||
99 | { | 99 | { |
100 | module_bug_cleanup(mod); | 100 | module_bug_cleanup(mod); |
101 | } | 101 | } |
102 | |||
103 | struct bug_entry *module_find_bug(unsigned long bugaddr) | ||
104 | { | ||
105 | struct mod_arch_specific *mod; | ||
106 | unsigned int i; | ||
107 | struct bug_entry *bug; | ||
108 | |||
109 | list_for_each_entry(mod, &module_bug_list, bug_list) { | ||
110 | bug = mod->bug_table; | ||
111 | for (i = 0; i < mod->num_bugs; ++i, ++bug) | ||
112 | if (bugaddr == bug->bug_addr) | ||
113 | return bug; | ||
114 | } | ||
115 | return NULL; | ||
116 | } | ||
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 709f8cb8bfca..d98634c76060 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -52,63 +52,6 @@ | |||
52 | #include <asm/ppc-pci.h> | 52 | #include <asm/ppc-pci.h> |
53 | #include <asm/syscalls.h> | 53 | #include <asm/syscalls.h> |
54 | 54 | ||
55 | struct old_linux_dirent32 { | ||
56 | u32 d_ino; | ||
57 | u32 d_offset; | ||
58 | unsigned short d_namlen; | ||
59 | char d_name[1]; | ||
60 | }; | ||
61 | |||
62 | struct readdir_callback32 { | ||
63 | struct old_linux_dirent32 __user * dirent; | ||
64 | int count; | ||
65 | }; | ||
66 | |||
67 | static int fillonedir(void * __buf, const char * name, int namlen, | ||
68 | off_t offset, u64 ino, unsigned int d_type) | ||
69 | { | ||
70 | struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf; | ||
71 | struct old_linux_dirent32 __user * dirent; | ||
72 | ino_t d_ino; | ||
73 | |||
74 | if (buf->count) | ||
75 | return -EINVAL; | ||
76 | d_ino = ino; | ||
77 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | ||
78 | return -EOVERFLOW; | ||
79 | buf->count++; | ||
80 | dirent = buf->dirent; | ||
81 | put_user(d_ino, &dirent->d_ino); | ||
82 | put_user(offset, &dirent->d_offset); | ||
83 | put_user(namlen, &dirent->d_namlen); | ||
84 | copy_to_user(dirent->d_name, name, namlen); | ||
85 | put_user(0, dirent->d_name + namlen); | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count) | ||
90 | { | ||
91 | int error = -EBADF; | ||
92 | struct file * file; | ||
93 | struct readdir_callback32 buf; | ||
94 | |||
95 | file = fget(fd); | ||
96 | if (!file) | ||
97 | goto out; | ||
98 | |||
99 | buf.count = 0; | ||
100 | buf.dirent = dirent; | ||
101 | |||
102 | error = vfs_readdir(file, (filldir_t)fillonedir, &buf); | ||
103 | if (error < 0) | ||
104 | goto out_putf; | ||
105 | error = buf.count; | ||
106 | |||
107 | out_putf: | ||
108 | fput(file); | ||
109 | out: | ||
110 | return error; | ||
111 | } | ||
112 | 55 | ||
113 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, | 56 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, |
114 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 57 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index a437267c6bf8..d967c1893ab5 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _PSERIES_PLPAR_WRAPPERS_H | 2 | #define _PSERIES_PLPAR_WRAPPERS_H |
3 | 3 | ||
4 | #include <asm/hvcall.h> | 4 | #include <asm/hvcall.h> |
5 | #include <asm/page.h> | ||
5 | 6 | ||
6 | static inline long poll_pending(void) | 7 | static inline long poll_pending(void) |
7 | { | 8 | { |
@@ -44,12 +45,34 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa) | |||
44 | 45 | ||
45 | static inline long plpar_page_set_loaned(unsigned long vpa) | 46 | static inline long plpar_page_set_loaned(unsigned long vpa) |
46 | { | 47 | { |
47 | return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa, 0); | 48 | unsigned long cmo_page_sz = cmo_get_page_size(); |
49 | long rc = 0; | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) | ||
53 | rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa + i, 0); | ||
54 | |||
55 | for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) | ||
56 | plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, | ||
57 | vpa + i - cmo_page_sz, 0); | ||
58 | |||
59 | return rc; | ||
48 | } | 60 | } |
49 | 61 | ||
50 | static inline long plpar_page_set_active(unsigned long vpa) | 62 | static inline long plpar_page_set_active(unsigned long vpa) |
51 | { | 63 | { |
52 | return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa, 0); | 64 | unsigned long cmo_page_sz = cmo_get_page_size(); |
65 | long rc = 0; | ||
66 | int i; | ||
67 | |||
68 | for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) | ||
69 | rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa + i, 0); | ||
70 | |||
71 | for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) | ||
72 | plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, | ||
73 | vpa + i - cmo_page_sz, 0); | ||
74 | |||
75 | return rc; | ||
53 | } | 76 | } |
54 | 77 | ||
55 | extern void vpa_init(int cpu); | 78 | extern void vpa_init(int cpu); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 063a0d2fba30..3ce8a139b85d 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -68,6 +68,9 @@ | |||
68 | #include "plpar_wrappers.h" | 68 | #include "plpar_wrappers.h" |
69 | #include "pseries.h" | 69 | #include "pseries.h" |
70 | 70 | ||
71 | int CMO_PrPSP = -1; | ||
72 | int CMO_SecPSP = -1; | ||
73 | unsigned long CMO_PageSize = (ASM_CONST(1) << IOMMU_PAGE_SHIFT); | ||
71 | 74 | ||
72 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ | 75 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ |
73 | 76 | ||
@@ -325,8 +328,7 @@ void pSeries_cmo_feature_init(void) | |||
325 | { | 328 | { |
326 | char *ptr, *key, *value, *end; | 329 | char *ptr, *key, *value, *end; |
327 | int call_status; | 330 | int call_status; |
328 | int PrPSP = -1; | 331 | int page_order = IOMMU_PAGE_SHIFT; |
329 | int SecPSP = -1; | ||
330 | 332 | ||
331 | pr_debug(" -> fw_cmo_feature_init()\n"); | 333 | pr_debug(" -> fw_cmo_feature_init()\n"); |
332 | spin_lock(&rtas_data_buf_lock); | 334 | spin_lock(&rtas_data_buf_lock); |
@@ -365,21 +367,31 @@ void pSeries_cmo_feature_init(void) | |||
365 | break; | 367 | break; |
366 | } | 368 | } |
367 | 369 | ||
368 | if (0 == strcmp(key, "PrPSP")) | 370 | if (0 == strcmp(key, "CMOPageSize")) |
369 | PrPSP = simple_strtol(value, NULL, 10); | 371 | page_order = simple_strtol(value, NULL, 10); |
372 | else if (0 == strcmp(key, "PrPSP")) | ||
373 | CMO_PrPSP = simple_strtol(value, NULL, 10); | ||
370 | else if (0 == strcmp(key, "SecPSP")) | 374 | else if (0 == strcmp(key, "SecPSP")) |
371 | SecPSP = simple_strtol(value, NULL, 10); | 375 | CMO_SecPSP = simple_strtol(value, NULL, 10); |
372 | value = key = ptr + 1; | 376 | value = key = ptr + 1; |
373 | } | 377 | } |
374 | ptr++; | 378 | ptr++; |
375 | } | 379 | } |
376 | 380 | ||
377 | if (PrPSP != -1 || SecPSP != -1) { | 381 | /* Page size is returned as the power of 2 of the page size, |
382 | * convert to the page size in bytes before returning | ||
383 | */ | ||
384 | CMO_PageSize = 1 << page_order; | ||
385 | pr_debug("CMO_PageSize = %lu\n", CMO_PageSize); | ||
386 | |||
387 | if (CMO_PrPSP != -1 || CMO_SecPSP != -1) { | ||
378 | pr_info("CMO enabled\n"); | 388 | pr_info("CMO enabled\n"); |
379 | pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); | 389 | pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, |
390 | CMO_SecPSP); | ||
380 | powerpc_firmware_features |= FW_FEATURE_CMO; | 391 | powerpc_firmware_features |= FW_FEATURE_CMO; |
381 | } else | 392 | } else |
382 | pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); | 393 | pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, |
394 | CMO_SecPSP); | ||
383 | spin_unlock(&rtas_data_buf_lock); | 395 | spin_unlock(&rtas_data_buf_lock); |
384 | pr_debug(" <- fw_cmo_feature_init()\n"); | 396 | pr_debug(" <- fw_cmo_feature_init()\n"); |
385 | } | 397 | } |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 217de3ea29e8..b4aeb0f696dc 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -796,6 +796,9 @@ static unsigned long nid_range(unsigned long start, unsigned long end, | |||
796 | start += PAGE_SIZE; | 796 | start += PAGE_SIZE; |
797 | } | 797 | } |
798 | 798 | ||
799 | if (start > end) | ||
800 | start = end; | ||
801 | |||
799 | return start; | 802 | return start; |
800 | } | 803 | } |
801 | #else | 804 | #else |
@@ -1723,8 +1726,7 @@ void __init paging_init(void) | |||
1723 | 1726 | ||
1724 | find_ramdisk(phys_base); | 1727 | find_ramdisk(phys_base); |
1725 | 1728 | ||
1726 | if (cmdline_memory_size) | 1729 | lmb_enforce_memory_limit(cmdline_memory_size); |
1727 | lmb_enforce_memory_limit(phys_base + cmdline_memory_size); | ||
1728 | 1730 | ||
1729 | lmb_analyze(); | 1731 | lmb_analyze(); |
1730 | lmb_dump_all(); | 1732 | lmb_dump_all(); |
@@ -1961,6 +1963,15 @@ void __init mem_init(void) | |||
1961 | void free_initmem(void) | 1963 | void free_initmem(void) |
1962 | { | 1964 | { |
1963 | unsigned long addr, initend; | 1965 | unsigned long addr, initend; |
1966 | int do_free = 1; | ||
1967 | |||
1968 | /* If the physical memory maps were trimmed by kernel command | ||
1969 | * line options, don't even try freeing this initmem stuff up. | ||
1970 | * The kernel image could have been in the trimmed out region | ||
1971 | * and if so the freeing below will free invalid page structs. | ||
1972 | */ | ||
1973 | if (cmdline_memory_size) | ||
1974 | do_free = 0; | ||
1964 | 1975 | ||
1965 | /* | 1976 | /* |
1966 | * The init section is aligned to 8k in vmlinux.lds. Page align for >8k pagesizes. | 1977 | * The init section is aligned to 8k in vmlinux.lds. Page align for >8k pagesizes. |
@@ -1975,13 +1986,16 @@ void free_initmem(void) | |||
1975 | ((unsigned long) __va(kern_base)) - | 1986 | ((unsigned long) __va(kern_base)) - |
1976 | ((unsigned long) KERNBASE)); | 1987 | ((unsigned long) KERNBASE)); |
1977 | memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); | 1988 | memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); |
1978 | p = virt_to_page(page); | ||
1979 | 1989 | ||
1980 | ClearPageReserved(p); | 1990 | if (do_free) { |
1981 | init_page_count(p); | 1991 | p = virt_to_page(page); |
1982 | __free_page(p); | 1992 | |
1983 | num_physpages++; | 1993 | ClearPageReserved(p); |
1984 | totalram_pages++; | 1994 | init_page_count(p); |
1995 | __free_page(p); | ||
1996 | num_physpages++; | ||
1997 | totalram_pages++; | ||
1998 | } | ||
1985 | } | 1999 | } |
1986 | } | 2000 | } |
1987 | 2001 | ||
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 616b804a2295..cc0ef13fba7a 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h | |||
@@ -30,6 +30,8 @@ | |||
30 | /* Useful macros */ | 30 | /* Useful macros */ |
31 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 31 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
32 | 32 | ||
33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) | ||
34 | |||
33 | extern struct setup_header hdr; | 35 | extern struct setup_header hdr; |
34 | extern struct boot_params boot_params; | 36 | extern struct boot_params boot_params; |
35 | 37 | ||
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c index 53165c97336b..8c3c25f35578 100644 --- a/arch/x86/boot/memory.c +++ b/arch/x86/boot/memory.c | |||
@@ -13,7 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "boot.h" | 15 | #include "boot.h" |
16 | #include <linux/kernel.h> | ||
17 | 16 | ||
18 | #define SMAP 0x534d4150 /* ASCII "SMAP" */ | 17 | #define SMAP 0x534d4150 /* ASCII "SMAP" */ |
19 | 18 | ||
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 81e5ab6542d8..426e5d91b63a 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -86,7 +86,7 @@ int acpi_save_state_mem(void) | |||
86 | #endif /* !CONFIG_64BIT */ | 86 | #endif /* !CONFIG_64BIT */ |
87 | 87 | ||
88 | header->pmode_cr0 = read_cr0(); | 88 | header->pmode_cr0 = read_cr0(); |
89 | header->pmode_cr4 = read_cr4(); | 89 | header->pmode_cr4 = read_cr4_safe(); |
90 | header->realmode_flags = acpi_realmode_flags; | 90 | header->realmode_flags = acpi_realmode_flags; |
91 | header->real_magic = 0x12345678; | 91 | header->real_magic = 0x12345678; |
92 | 92 | ||
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c index 4b63c8e1f13b..5cab48ee61a4 100644 --- a/arch/x86/kernel/efi_32.c +++ b/arch/x86/kernel/efi_32.c | |||
@@ -53,7 +53,7 @@ void efi_call_phys_prelog(void) | |||
53 | * directory. If I have PAE, I just need to duplicate one entry in | 53 | * directory. If I have PAE, I just need to duplicate one entry in |
54 | * page directory. | 54 | * page directory. |
55 | */ | 55 | */ |
56 | cr4 = read_cr4(); | 56 | cr4 = read_cr4_safe(); |
57 | 57 | ||
58 | if (cr4 & X86_CR4_PAE) { | 58 | if (cr4 & X86_CR4_PAE) { |
59 | efi_bak_pg_dir_pointer[0].pgd = | 59 | efi_bak_pg_dir_pointer[0].pgd = |
@@ -91,7 +91,7 @@ void efi_call_phys_epilog(void) | |||
91 | gdt_descr.size = GDT_SIZE - 1; | 91 | gdt_descr.size = GDT_SIZE - 1; |
92 | load_gdt(&gdt_descr); | 92 | load_gdt(&gdt_descr); |
93 | 93 | ||
94 | cr4 = read_cr4(); | 94 | cr4 = read_cr4_safe(); |
95 | 95 | ||
96 | if (cr4 & X86_CR4_PAE) { | 96 | if (cr4 & X86_CR4_PAE) { |
97 | swapper_pg_dir[pgd_index(0)].pgd = | 97 | swapper_pg_dir[pgd_index(0)].pgd = |
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c index fdfdc550b366..efc2f361fe85 100644 --- a/arch/x86/kernel/mmconf-fam10h_64.c +++ b/arch/x86/kernel/mmconf-fam10h_64.c | |||
@@ -238,7 +238,7 @@ static struct dmi_system_id __devinitdata mmconf_dmi_table[] = { | |||
238 | {} | 238 | {} |
239 | }; | 239 | }; |
240 | 240 | ||
241 | void __init check_enable_amd_mmconf_dmi(void) | 241 | void __cpuinit check_enable_amd_mmconf_dmi(void) |
242 | { | 242 | { |
243 | dmi_check_system(mmconf_dmi_table); | 243 | dmi_check_system(mmconf_dmi_table); |
244 | } | 244 | } |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 678090508a62..b3fb430725cb 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -49,7 +49,7 @@ static int __init mpf_checksum(unsigned char *mp, int len) | |||
49 | return sum & 0xFF; | 49 | return sum & 0xFF; |
50 | } | 50 | } |
51 | 51 | ||
52 | static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | 52 | static void __init MP_processor_info(struct mpc_config_processor *m) |
53 | { | 53 | { |
54 | int apicid; | 54 | int apicid; |
55 | char *bootup_cpu = ""; | 55 | char *bootup_cpu = ""; |
@@ -484,7 +484,7 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type) | |||
484 | } | 484 | } |
485 | 485 | ||
486 | 486 | ||
487 | static void construct_ioapic_table(int mpc_default_type) | 487 | static void __init construct_ioapic_table(int mpc_default_type) |
488 | { | 488 | { |
489 | struct mpc_config_ioapic ioapic; | 489 | struct mpc_config_ioapic ioapic; |
490 | struct mpc_config_bus bus; | 490 | struct mpc_config_bus bus; |
@@ -529,7 +529,7 @@ static void construct_ioapic_table(int mpc_default_type) | |||
529 | construct_default_ioirq_mptable(mpc_default_type); | 529 | construct_default_ioirq_mptable(mpc_default_type); |
530 | } | 530 | } |
531 | #else | 531 | #else |
532 | static inline void construct_ioapic_table(int mpc_default_type) { } | 532 | static inline void __init construct_ioapic_table(int mpc_default_type) { } |
533 | #endif | 533 | #endif |
534 | 534 | ||
535 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) | 535 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 02d19328525d..218d783ed7a8 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1350,7 +1350,7 @@ static void calgary_init_bitmap_from_tce_table(struct iommu_table *tbl) | |||
1350 | * Function for kdump case. Get the tce tables from first kernel | 1350 | * Function for kdump case. Get the tce tables from first kernel |
1351 | * by reading the contents of the base adress register of calgary iommu | 1351 | * by reading the contents of the base adress register of calgary iommu |
1352 | */ | 1352 | */ |
1353 | static void get_tce_space_from_tar(void) | 1353 | static void __init get_tce_space_from_tar(void) |
1354 | { | 1354 | { |
1355 | int bus; | 1355 | int bus; |
1356 | void __iomem *target; | 1356 | void __iomem *target; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a8fb8a980fae..e139e617f422 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -756,6 +756,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work) | |||
756 | } | 756 | } |
757 | 757 | ||
758 | #ifdef CONFIG_X86_64 | 758 | #ifdef CONFIG_X86_64 |
759 | |||
760 | /* __ref because it's safe to call free_bootmem when after_bootmem == 0. */ | ||
761 | static void __ref free_bootmem_pda(struct x8664_pda *oldpda) | ||
762 | { | ||
763 | if (!after_bootmem) | ||
764 | free_bootmem((unsigned long)oldpda, sizeof(*oldpda)); | ||
765 | } | ||
766 | |||
759 | /* | 767 | /* |
760 | * Allocate node local memory for the AP pda. | 768 | * Allocate node local memory for the AP pda. |
761 | * | 769 | * |
@@ -784,8 +792,7 @@ int __cpuinit get_local_pda(int cpu) | |||
784 | 792 | ||
785 | if (oldpda) { | 793 | if (oldpda) { |
786 | memcpy(newpda, oldpda, size); | 794 | memcpy(newpda, oldpda, size); |
787 | if (!after_bootmem) | 795 | free_bootmem_pda(oldpda); |
788 | free_bootmem((unsigned long)oldpda, size); | ||
789 | } | 796 | } |
790 | 797 | ||
791 | newpda->in_bootmem = 0; | 798 | newpda->in_bootmem = 0; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 7603c0553909..46af71676738 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -104,7 +104,7 @@ __setup("notsc", notsc_setup); | |||
104 | /* | 104 | /* |
105 | * Read TSC and the reference counters. Take care of SMI disturbance | 105 | * Read TSC and the reference counters. Take care of SMI disturbance |
106 | */ | 106 | */ |
107 | static u64 __init tsc_read_refs(u64 *pm, u64 *hpet) | 107 | static u64 tsc_read_refs(u64 *pm, u64 *hpet) |
108 | { | 108 | { |
109 | u64 t1, t2; | 109 | u64 t1, t2; |
110 | int i; | 110 | int i; |
diff --git a/arch/x86/power/cpu_32.c b/arch/x86/power/cpu_32.c index 7dc5d5cf50a2..d3e083dea720 100644 --- a/arch/x86/power/cpu_32.c +++ b/arch/x86/power/cpu_32.c | |||
@@ -45,7 +45,7 @@ static void __save_processor_state(struct saved_context *ctxt) | |||
45 | ctxt->cr0 = read_cr0(); | 45 | ctxt->cr0 = read_cr0(); |
46 | ctxt->cr2 = read_cr2(); | 46 | ctxt->cr2 = read_cr2(); |
47 | ctxt->cr3 = read_cr3(); | 47 | ctxt->cr3 = read_cr3(); |
48 | ctxt->cr4 = read_cr4(); | 48 | ctxt->cr4 = read_cr4_safe(); |
49 | } | 49 | } |
50 | 50 | ||
51 | /* Needed by apm.c */ | 51 | /* Needed by apm.c */ |
@@ -98,7 +98,9 @@ static void __restore_processor_state(struct saved_context *ctxt) | |||
98 | /* | 98 | /* |
99 | * control registers | 99 | * control registers |
100 | */ | 100 | */ |
101 | write_cr4(ctxt->cr4); | 101 | /* cr4 was introduced in the Pentium CPU */ |
102 | if (ctxt->cr4) | ||
103 | write_cr4(ctxt->cr4); | ||
102 | write_cr3(ctxt->cr3); | 104 | write_cr3(ctxt->cr3); |
103 | write_cr2(ctxt->cr2); | 105 | write_cr2(ctxt->cr2); |
104 | write_cr0(ctxt->cr0); | 106 | write_cr0(ctxt->cr0); |
diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S index b95aa6cfe3cb..4fc7e872c85e 100644 --- a/arch/x86/power/hibernate_asm_32.S +++ b/arch/x86/power/hibernate_asm_32.S | |||
@@ -28,9 +28,9 @@ ENTRY(swsusp_arch_suspend) | |||
28 | ret | 28 | ret |
29 | 29 | ||
30 | ENTRY(restore_image) | 30 | ENTRY(restore_image) |
31 | movl resume_pg_dir, %ecx | 31 | movl resume_pg_dir, %eax |
32 | subl $__PAGE_OFFSET, %ecx | 32 | subl $__PAGE_OFFSET, %eax |
33 | movl %ecx, %cr3 | 33 | movl %eax, %cr3 |
34 | 34 | ||
35 | movl restore_pblist, %edx | 35 | movl restore_pblist, %edx |
36 | .p2align 4,,7 | 36 | .p2align 4,,7 |
@@ -52,17 +52,21 @@ copy_loop: | |||
52 | 52 | ||
53 | done: | 53 | done: |
54 | /* go back to the original page tables */ | 54 | /* go back to the original page tables */ |
55 | movl $swapper_pg_dir, %ecx | 55 | movl $swapper_pg_dir, %eax |
56 | subl $__PAGE_OFFSET, %ecx | 56 | subl $__PAGE_OFFSET, %eax |
57 | movl %ecx, %cr3 | 57 | movl %eax, %cr3 |
58 | /* Flush TLB, including "global" things (vmalloc) */ | 58 | /* Flush TLB, including "global" things (vmalloc) */ |
59 | movl mmu_cr4_features, %eax | 59 | movl mmu_cr4_features, %ecx |
60 | movl %eax, %edx | 60 | jecxz 1f # cr4 Pentium and higher, skip if zero |
61 | movl %ecx, %edx | ||
61 | andl $~(1<<7), %edx; # PGE | 62 | andl $~(1<<7), %edx; # PGE |
62 | movl %edx, %cr4; # turn off PGE | 63 | movl %edx, %cr4; # turn off PGE |
63 | movl %cr3, %ecx; # flush TLB | 64 | 1: |
64 | movl %ecx, %cr3 | 65 | movl %cr3, %eax; # flush TLB |
65 | movl %eax, %cr4; # turn PGE back on | 66 | movl %eax, %cr3 |
67 | jecxz 1f # cr4 Pentium and higher, skip if zero | ||
68 | movl %ecx, %cr4; # turn PGE back on | ||
69 | 1: | ||
66 | 70 | ||
67 | movl saved_context_esp, %esp | 71 | movl saved_context_esp, %esp |
68 | movl saved_context_ebp, %ebp | 72 | movl saved_context_ebp, %ebp |
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 7c994e1ae276..ae16d845d746 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c | |||
@@ -595,8 +595,9 @@ static irqreturn_t s3cmci_irq_cd(int irq, void *dev_id) | |||
595 | return IRQ_HANDLED; | 595 | return IRQ_HANDLED; |
596 | } | 596 | } |
597 | 597 | ||
598 | void s3cmci_dma_done_callback(struct s3c2410_dma_chan *dma_ch, void *buf_id, | 598 | static void s3cmci_dma_done_callback(struct s3c2410_dma_chan *dma_ch, |
599 | int size, enum s3c2410_dma_buffresult result) | 599 | void *buf_id, int size, |
600 | enum s3c2410_dma_buffresult result) | ||
600 | { | 601 | { |
601 | struct s3cmci_host *host = buf_id; | 602 | struct s3cmci_host *host = buf_id; |
602 | unsigned long iflags; | 603 | unsigned long iflags; |
@@ -740,8 +741,8 @@ request_done: | |||
740 | mmc_request_done(host->mmc, mrq); | 741 | mmc_request_done(host->mmc, mrq); |
741 | } | 742 | } |
742 | 743 | ||
743 | 744 | static void s3cmci_dma_setup(struct s3cmci_host *host, | |
744 | void s3cmci_dma_setup(struct s3cmci_host *host, enum s3c2410_dmasrc source) | 745 | enum s3c2410_dmasrc source) |
745 | { | 746 | { |
746 | static enum s3c2410_dmasrc last_source = -1; | 747 | static enum s3c2410_dmasrc last_source = -1; |
747 | static int setup_ok; | 748 | static int setup_ok; |
@@ -1003,8 +1004,9 @@ static void s3cmci_send_request(struct mmc_host *mmc) | |||
1003 | enable_irq(host->irq); | 1004 | enable_irq(host->irq); |
1004 | } | 1005 | } |
1005 | 1006 | ||
1006 | static int s3cmci_card_present(struct s3cmci_host *host) | 1007 | static int s3cmci_card_present(struct mmc_host *mmc) |
1007 | { | 1008 | { |
1009 | struct s3cmci_host *host = mmc_priv(mmc); | ||
1008 | struct s3c24xx_mci_pdata *pdata = host->pdata; | 1010 | struct s3c24xx_mci_pdata *pdata = host->pdata; |
1009 | int ret; | 1011 | int ret; |
1010 | 1012 | ||
@@ -1023,7 +1025,7 @@ static void s3cmci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
1023 | host->cmd_is_stop = 0; | 1025 | host->cmd_is_stop = 0; |
1024 | host->mrq = mrq; | 1026 | host->mrq = mrq; |
1025 | 1027 | ||
1026 | if (s3cmci_card_present(host) == 0) { | 1028 | if (s3cmci_card_present(mmc) == 0) { |
1027 | dbg(host, dbg_err, "%s: no medium present\n", __func__); | 1029 | dbg(host, dbg_err, "%s: no medium present\n", __func__); |
1028 | host->mrq->cmd->error = -ENOMEDIUM; | 1030 | host->mrq->cmd->error = -ENOMEDIUM; |
1029 | mmc_request_done(mmc, mrq); | 1031 | mmc_request_done(mmc, mrq); |
@@ -1138,6 +1140,7 @@ static struct mmc_host_ops s3cmci_ops = { | |||
1138 | .request = s3cmci_request, | 1140 | .request = s3cmci_request, |
1139 | .set_ios = s3cmci_set_ios, | 1141 | .set_ios = s3cmci_set_ios, |
1140 | .get_ro = s3cmci_get_ro, | 1142 | .get_ro = s3cmci_get_ro, |
1143 | .get_cd = s3cmci_card_present, | ||
1141 | }; | 1144 | }; |
1142 | 1145 | ||
1143 | static struct s3c24xx_mci_pdata s3cmci_def_pdata = { | 1146 | static struct s3c24xx_mci_pdata s3cmci_def_pdata = { |
@@ -1206,7 +1209,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) | |||
1206 | } | 1209 | } |
1207 | 1210 | ||
1208 | host->base = ioremap(host->mem->start, RESSIZE(host->mem)); | 1211 | host->base = ioremap(host->mem->start, RESSIZE(host->mem)); |
1209 | if (host->base == 0) { | 1212 | if (!host->base) { |
1210 | dev_err(&pdev->dev, "failed to ioremap() io memory region.\n"); | 1213 | dev_err(&pdev->dev, "failed to ioremap() io memory region.\n"); |
1211 | ret = -EINVAL; | 1214 | ret = -EINVAL; |
1212 | goto probe_free_mem_region; | 1215 | goto probe_free_mem_region; |
diff --git a/drivers/mmc/host/sdricoh_cs.c b/drivers/mmc/host/sdricoh_cs.c index f99e9f721629..1df44d966bdb 100644 --- a/drivers/mmc/host/sdricoh_cs.c +++ b/drivers/mmc/host/sdricoh_cs.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
31 | #include <linux/scatterlist.h> | 31 | #include <linux/scatterlist.h> |
32 | #include <linux/version.h> | ||
33 | 32 | ||
34 | #include <pcmcia/cs_types.h> | 33 | #include <pcmcia/cs_types.h> |
35 | #include <pcmcia/cs.h> | 34 | #include <pcmcia/cs.h> |
diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h index a0095191c02e..91c7d03e65bc 100644 --- a/include/asm-x86/atomic_64.h +++ b/include/asm-x86/atomic_64.h | |||
@@ -228,7 +228,7 @@ static inline void atomic64_add(long i, atomic64_t *v) | |||
228 | { | 228 | { |
229 | asm volatile(LOCK_PREFIX "addq %1,%0" | 229 | asm volatile(LOCK_PREFIX "addq %1,%0" |
230 | : "=m" (v->counter) | 230 | : "=m" (v->counter) |
231 | : "ir" (i), "m" (v->counter)); | 231 | : "er" (i), "m" (v->counter)); |
232 | } | 232 | } |
233 | 233 | ||
234 | /** | 234 | /** |
@@ -242,7 +242,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) | |||
242 | { | 242 | { |
243 | asm volatile(LOCK_PREFIX "subq %1,%0" | 243 | asm volatile(LOCK_PREFIX "subq %1,%0" |
244 | : "=m" (v->counter) | 244 | : "=m" (v->counter) |
245 | : "ir" (i), "m" (v->counter)); | 245 | : "er" (i), "m" (v->counter)); |
246 | } | 246 | } |
247 | 247 | ||
248 | /** | 248 | /** |
@@ -260,7 +260,7 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v) | |||
260 | 260 | ||
261 | asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" | 261 | asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" |
262 | : "=m" (v->counter), "=qm" (c) | 262 | : "=m" (v->counter), "=qm" (c) |
263 | : "ir" (i), "m" (v->counter) : "memory"); | 263 | : "er" (i), "m" (v->counter) : "memory"); |
264 | return c; | 264 | return c; |
265 | } | 265 | } |
266 | 266 | ||
@@ -341,7 +341,7 @@ static inline int atomic64_add_negative(long i, atomic64_t *v) | |||
341 | 341 | ||
342 | asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" | 342 | asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" |
343 | : "=m" (v->counter), "=qm" (c) | 343 | : "=m" (v->counter), "=qm" (c) |
344 | : "ir" (i), "m" (v->counter) : "memory"); | 344 | : "er" (i), "m" (v->counter) : "memory"); |
345 | return c; | 345 | return c; |
346 | } | 346 | } |
347 | 347 | ||
diff --git a/include/asm-x86/mmconfig.h b/include/asm-x86/mmconfig.h index 95beda07c6fa..e293ab81e850 100644 --- a/include/asm-x86/mmconfig.h +++ b/include/asm-x86/mmconfig.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_PCI_MMCONFIG | 4 | #ifdef CONFIG_PCI_MMCONFIG |
5 | extern void __cpuinit fam10h_check_enable_mmcfg(void); | 5 | extern void __cpuinit fam10h_check_enable_mmcfg(void); |
6 | extern void __init check_enable_amd_mmconf_dmi(void); | 6 | extern void __cpuinit check_enable_amd_mmconf_dmi(void); |
7 | #else | 7 | #else |
8 | static inline void fam10h_check_enable_mmcfg(void) { } | 8 | static inline void fam10h_check_enable_mmcfg(void) { } |
9 | static inline void check_enable_amd_mmconf_dmi(void) { } | 9 | static inline void check_enable_amd_mmconf_dmi(void) { } |
diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h index 4e91ee1e37aa..f643a3a92da0 100644 --- a/include/asm-x86/percpu.h +++ b/include/asm-x86/percpu.h | |||
@@ -182,7 +182,7 @@ do { \ | |||
182 | DEFINE_PER_CPU(_type, _name) = _initvalue; \ | 182 | DEFINE_PER_CPU(_type, _name) = _initvalue; \ |
183 | __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \ | 183 | __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \ |
184 | { [0 ... NR_CPUS-1] = _initvalue }; \ | 184 | { [0 ... NR_CPUS-1] = _initvalue }; \ |
185 | __typeof__(_type) *_name##_early_ptr = _name##_early_map | 185 | __typeof__(_type) *_name##_early_ptr __refdata = _name##_early_map |
186 | 186 | ||
187 | #define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \ | 187 | #define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \ |
188 | EXPORT_PER_CPU_SYMBOL(_name) | 188 | EXPORT_PER_CPU_SYMBOL(_name) |
diff --git a/include/linux/security.h b/include/linux/security.h index 2ee5ecfb2393..80c4d002864c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1755,7 +1755,7 @@ static inline int security_ptrace_may_access(struct task_struct *child, | |||
1755 | return cap_ptrace_may_access(child, mode); | 1755 | return cap_ptrace_may_access(child, mode); |
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | static inline int security_ptrace_traceme(struct task_struct *child) | 1758 | static inline int security_ptrace_traceme(struct task_struct *parent) |
1759 | { | 1759 | { |
1760 | return cap_ptrace_traceme(parent); | 1760 | return cap_ptrace_traceme(parent); |
1761 | } | 1761 | } |
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 77fa776a2da8..3bfb1877a003 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2582,7 +2582,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
2582 | hlock->trylock = trylock; | 2582 | hlock->trylock = trylock; |
2583 | hlock->read = read; | 2583 | hlock->read = read; |
2584 | hlock->check = check; | 2584 | hlock->check = check; |
2585 | hlock->hardirqs_off = hardirqs_off; | 2585 | hlock->hardirqs_off = !!hardirqs_off; |
2586 | #ifdef CONFIG_LOCK_STAT | 2586 | #ifdef CONFIG_LOCK_STAT |
2587 | hlock->waittime_stamp = 0; | 2587 | hlock->waittime_stamp = 0; |
2588 | hlock->holdtime_stamp = sched_clock(); | 2588 | hlock->holdtime_stamp = sched_clock(); |
@@ -462,6 +462,8 @@ void __init lmb_enforce_memory_limit(u64 memory_limit) | |||
462 | if (lmb.memory.region[0].size < lmb.rmo_size) | 462 | if (lmb.memory.region[0].size < lmb.rmo_size) |
463 | lmb.rmo_size = lmb.memory.region[0].size; | 463 | lmb.rmo_size = lmb.memory.region[0].size; |
464 | 464 | ||
465 | memory_limit = lmb_end_of_DRAM(); | ||
466 | |||
465 | /* And truncate any reserves above the limit also. */ | 467 | /* And truncate any reserves above the limit also. */ |
466 | for (i = 0; i < lmb.reserved.cnt; i++) { | 468 | for (i = 0; i < lmb.reserved.cnt; i++) { |
467 | p = &lmb.reserved.region[i]; | 469 | p = &lmb.reserved.region[i]; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index add4e87e0b20..b80e725432f0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -6437,6 +6437,39 @@ static void alc882_auto_init_analog_input(struct hda_codec *codec) | |||
6437 | } | 6437 | } |
6438 | } | 6438 | } |
6439 | 6439 | ||
6440 | static void alc882_auto_init_input_src(struct hda_codec *codec) | ||
6441 | { | ||
6442 | struct alc_spec *spec = codec->spec; | ||
6443 | const struct hda_input_mux *imux = spec->input_mux; | ||
6444 | int c; | ||
6445 | |||
6446 | for (c = 0; c < spec->num_adc_nids; c++) { | ||
6447 | hda_nid_t conn_list[HDA_MAX_NUM_INPUTS]; | ||
6448 | hda_nid_t nid = spec->capsrc_nids[c]; | ||
6449 | int conns, mute, idx, item; | ||
6450 | |||
6451 | conns = snd_hda_get_connections(codec, nid, conn_list, | ||
6452 | ARRAY_SIZE(conn_list)); | ||
6453 | if (conns < 0) | ||
6454 | continue; | ||
6455 | for (idx = 0; idx < conns; idx++) { | ||
6456 | /* if the current connection is the selected one, | ||
6457 | * unmute it as default - otherwise mute it | ||
6458 | */ | ||
6459 | mute = AMP_IN_MUTE(idx); | ||
6460 | for (item = 0; item < imux->num_items; item++) { | ||
6461 | if (imux->items[item].index == idx) { | ||
6462 | if (spec->cur_mux[c] == item) | ||
6463 | mute = AMP_IN_UNMUTE(idx); | ||
6464 | break; | ||
6465 | } | ||
6466 | } | ||
6467 | snd_hda_codec_write(codec, nid, 0, | ||
6468 | AC_VERB_SET_AMP_GAIN_MUTE, mute); | ||
6469 | } | ||
6470 | } | ||
6471 | } | ||
6472 | |||
6440 | /* add mic boosts if needed */ | 6473 | /* add mic boosts if needed */ |
6441 | static int alc_auto_add_mic_boost(struct hda_codec *codec) | 6474 | static int alc_auto_add_mic_boost(struct hda_codec *codec) |
6442 | { | 6475 | { |
@@ -6491,6 +6524,7 @@ static void alc882_auto_init(struct hda_codec *codec) | |||
6491 | alc882_auto_init_multi_out(codec); | 6524 | alc882_auto_init_multi_out(codec); |
6492 | alc882_auto_init_hp_out(codec); | 6525 | alc882_auto_init_hp_out(codec); |
6493 | alc882_auto_init_analog_input(codec); | 6526 | alc882_auto_init_analog_input(codec); |
6527 | alc882_auto_init_input_src(codec); | ||
6494 | if (spec->unsol_event) | 6528 | if (spec->unsol_event) |
6495 | alc_sku_automute(codec); | 6529 | alc_sku_automute(codec); |
6496 | } | 6530 | } |
@@ -8285,6 +8319,8 @@ static void alc883_auto_init_analog_input(struct hda_codec *codec) | |||
8285 | } | 8319 | } |
8286 | } | 8320 | } |
8287 | 8321 | ||
8322 | #define alc883_auto_init_input_src alc882_auto_init_input_src | ||
8323 | |||
8288 | /* almost identical with ALC880 parser... */ | 8324 | /* almost identical with ALC880 parser... */ |
8289 | static int alc883_parse_auto_config(struct hda_codec *codec) | 8325 | static int alc883_parse_auto_config(struct hda_codec *codec) |
8290 | { | 8326 | { |
@@ -8315,6 +8351,7 @@ static void alc883_auto_init(struct hda_codec *codec) | |||
8315 | alc883_auto_init_multi_out(codec); | 8351 | alc883_auto_init_multi_out(codec); |
8316 | alc883_auto_init_hp_out(codec); | 8352 | alc883_auto_init_hp_out(codec); |
8317 | alc883_auto_init_analog_input(codec); | 8353 | alc883_auto_init_analog_input(codec); |
8354 | alc883_auto_init_input_src(codec); | ||
8318 | if (spec->unsol_event) | 8355 | if (spec->unsol_event) |
8319 | alc_sku_automute(codec); | 8356 | alc_sku_automute(codec); |
8320 | } | 8357 | } |
@@ -9663,6 +9700,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec) | |||
9663 | #define alc262_auto_init_multi_out alc882_auto_init_multi_out | 9700 | #define alc262_auto_init_multi_out alc882_auto_init_multi_out |
9664 | #define alc262_auto_init_hp_out alc882_auto_init_hp_out | 9701 | #define alc262_auto_init_hp_out alc882_auto_init_hp_out |
9665 | #define alc262_auto_init_analog_input alc882_auto_init_analog_input | 9702 | #define alc262_auto_init_analog_input alc882_auto_init_analog_input |
9703 | #define alc262_auto_init_input_src alc882_auto_init_input_src | ||
9666 | 9704 | ||
9667 | 9705 | ||
9668 | /* init callback for auto-configuration model -- overriding the default init */ | 9706 | /* init callback for auto-configuration model -- overriding the default init */ |
@@ -9672,6 +9710,7 @@ static void alc262_auto_init(struct hda_codec *codec) | |||
9672 | alc262_auto_init_multi_out(codec); | 9710 | alc262_auto_init_multi_out(codec); |
9673 | alc262_auto_init_hp_out(codec); | 9711 | alc262_auto_init_hp_out(codec); |
9674 | alc262_auto_init_analog_input(codec); | 9712 | alc262_auto_init_analog_input(codec); |
9713 | alc262_auto_init_input_src(codec); | ||
9675 | if (spec->unsol_event) | 9714 | if (spec->unsol_event) |
9676 | alc_sku_automute(codec); | 9715 | alc_sku_automute(codec); |
9677 | } | 9716 | } |
@@ -13330,6 +13369,8 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec) | |||
13330 | } | 13369 | } |
13331 | } | 13370 | } |
13332 | 13371 | ||
13372 | #define alc861vd_auto_init_input_src alc882_auto_init_input_src | ||
13373 | |||
13333 | #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02) | 13374 | #define alc861vd_idx_to_mixer_vol(nid) ((nid) + 0x02) |
13334 | #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) | 13375 | #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) |
13335 | 13376 | ||
@@ -13512,6 +13553,7 @@ static void alc861vd_auto_init(struct hda_codec *codec) | |||
13512 | alc861vd_auto_init_multi_out(codec); | 13553 | alc861vd_auto_init_multi_out(codec); |
13513 | alc861vd_auto_init_hp_out(codec); | 13554 | alc861vd_auto_init_hp_out(codec); |
13514 | alc861vd_auto_init_analog_input(codec); | 13555 | alc861vd_auto_init_analog_input(codec); |
13556 | alc861vd_auto_init_input_src(codec); | ||
13515 | if (spec->unsol_event) | 13557 | if (spec->unsol_event) |
13516 | alc_sku_automute(codec); | 13558 | alc_sku_automute(codec); |
13517 | } | 13559 | } |
@@ -14677,6 +14719,8 @@ static void alc662_auto_init_analog_input(struct hda_codec *codec) | |||
14677 | } | 14719 | } |
14678 | } | 14720 | } |
14679 | 14721 | ||
14722 | #define alc662_auto_init_input_src alc882_auto_init_input_src | ||
14723 | |||
14680 | static int alc662_parse_auto_config(struct hda_codec *codec) | 14724 | static int alc662_parse_auto_config(struct hda_codec *codec) |
14681 | { | 14725 | { |
14682 | struct alc_spec *spec = codec->spec; | 14726 | struct alc_spec *spec = codec->spec; |
@@ -14733,6 +14777,7 @@ static void alc662_auto_init(struct hda_codec *codec) | |||
14733 | alc662_auto_init_multi_out(codec); | 14777 | alc662_auto_init_multi_out(codec); |
14734 | alc662_auto_init_hp_out(codec); | 14778 | alc662_auto_init_hp_out(codec); |
14735 | alc662_auto_init_analog_input(codec); | 14779 | alc662_auto_init_analog_input(codec); |
14780 | alc662_auto_init_input_src(codec); | ||
14736 | if (spec->unsol_event) | 14781 | if (spec->unsol_event) |
14737 | alc_sku_automute(codec); | 14782 | alc_sku_automute(codec); |
14738 | } | 14783 | } |