diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-01 14:36:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-01 14:36:13 -0500 |
commit | f6d2e6f57bba66272b28dd20c949b14ce39cb804 (patch) | |
tree | 2bf153af4d5b4b33ad2c1e88347c7fd752fb6332 /arch | |
parent | 8caac56305cef98f9357b060a77939d17699937d (diff) | |
parent | 7b1dedca42ac0d0d0be01e39d8461bb53a2389b3 (diff) |
Merge branch 'x86/urgent' into x86/iommu
Diffstat (limited to 'arch')
60 files changed, 405 insertions, 294 deletions
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h index 56dcb0a2d244..77295666c34b 100644 --- a/arch/blackfin/include/asm/bfin-global.h +++ b/arch/blackfin/include/asm/bfin-global.h | |||
@@ -101,7 +101,7 @@ extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */ | |||
101 | extern unsigned long _ramstart, _ramend, _rambase; | 101 | extern unsigned long _ramstart, _ramend, _rambase; |
102 | extern unsigned long memory_start, memory_end, physical_mem_end; | 102 | extern unsigned long memory_start, memory_end, physical_mem_end; |
103 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], | 103 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], |
104 | _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[], | 104 | _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[], |
105 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], | 105 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], |
106 | _ebss_l2[], _l2_lma_start[]; | 106 | _ebss_l2[], _l2_lma_start[]; |
107 | 107 | ||
diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h index ede748d67efd..d7d9148e433c 100644 --- a/arch/blackfin/include/asm/dma-mapping.h +++ b/arch/blackfin/include/asm/dma-mapping.h | |||
@@ -15,7 +15,11 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
15 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 15 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
16 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 16 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
17 | 17 | ||
18 | #define dma_mapping_error | 18 | static inline |
19 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
19 | 23 | ||
20 | /* | 24 | /* |
21 | * Map a single buffer of the indicated size for DMA in streaming mode. | 25 | * Map a single buffer of the indicated size for DMA in streaming mode. |
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 6e08f425bb44..5c0800adb4dd 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -218,7 +218,7 @@ inline int check_gpio(unsigned gpio) | |||
218 | if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 | 218 | if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 |
219 | || gpio == GPIO_PH14 || gpio == GPIO_PH15 | 219 | || gpio == GPIO_PH14 || gpio == GPIO_PH15 |
220 | || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 | 220 | || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 |
221 | || gpio > MAX_BLACKFIN_GPIOS) | 221 | || gpio >= MAX_BLACKFIN_GPIOS) |
222 | return -EINVAL; | 222 | return -EINVAL; |
223 | return 0; | 223 | return 0; |
224 | } | 224 | } |
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c index 512f8c92ead5..2debc900e246 100644 --- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c | |||
@@ -188,10 +188,11 @@ static struct cplb_desc cplb_data[] = { | |||
188 | 188 | ||
189 | static u16 __init lock_kernel_check(u32 start, u32 end) | 189 | static u16 __init lock_kernel_check(u32 start, u32 end) |
190 | { | 190 | { |
191 | if ((end <= (u32) _end && end >= (u32)_stext) || | 191 | if (start >= (u32)_end || end <= (u32)_stext) |
192 | (start <= (u32) _end && start >= (u32)_stext)) | 192 | return 0; |
193 | return IN_KERNEL; | 193 | |
194 | return 0; | 194 | /* This cplb block overlapped with kernel area. */ |
195 | return IN_KERNEL; | ||
195 | } | 196 | } |
196 | 197 | ||
197 | static unsigned short __init | 198 | static unsigned short __init |
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 77800dd83e57..0c3ea118b657 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -351,10 +351,15 @@ int _access_ok(unsigned long addr, unsigned long size) | |||
351 | return 1; | 351 | return 1; |
352 | #endif | 352 | #endif |
353 | #if L1_DATA_B_LENGTH != 0 | 353 | #if L1_DATA_B_LENGTH != 0 |
354 | if (addr >= L1_DATA_B_START | 354 | if (addr >= L1_DATA_B_START + (_ebss_b_l1 - _sdata_b_l1) |
355 | && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH) | 355 | && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH) |
356 | return 1; | 356 | return 1; |
357 | #endif | 357 | #endif |
358 | #if L2_LENGTH != 0 | ||
359 | if (addr >= L2_START + (_ebss_l2 - _stext_l2) | ||
360 | && addr + size <= L2_START + L2_LENGTH) | ||
361 | return 1; | ||
362 | #endif | ||
358 | return 0; | 363 | return 0; |
359 | } | 364 | } |
360 | EXPORT_SYMBOL(_access_ok); | 365 | EXPORT_SYMBOL(_access_ok); |
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 7f35d1046cd8..71a9a8c53cea 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -119,23 +119,23 @@ void __init bfin_relocate_l1_mem(void) | |||
119 | /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ | 119 | /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ |
120 | dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); | 120 | dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); |
121 | 121 | ||
122 | l1_data_a_length = _ebss_l1 - _sdata_l1; | 122 | l1_data_a_length = _sbss_l1 - _sdata_l1; |
123 | if (l1_data_a_length > L1_DATA_A_LENGTH) | 123 | if (l1_data_a_length > L1_DATA_A_LENGTH) |
124 | panic("L1 Data SRAM Bank A Overflow\n"); | 124 | panic("L1 Data SRAM Bank A Overflow\n"); |
125 | 125 | ||
126 | /* Copy _sdata_l1 to _ebss_l1 to L1 data bank A SRAM */ | 126 | /* Copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */ |
127 | dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); | 127 | dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); |
128 | 128 | ||
129 | l1_data_b_length = _ebss_b_l1 - _sdata_b_l1; | 129 | l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; |
130 | if (l1_data_b_length > L1_DATA_B_LENGTH) | 130 | if (l1_data_b_length > L1_DATA_B_LENGTH) |
131 | panic("L1 Data SRAM Bank B Overflow\n"); | 131 | panic("L1 Data SRAM Bank B Overflow\n"); |
132 | 132 | ||
133 | /* Copy _sdata_b_l1 to _ebss_b_l1 to L1 data bank B SRAM */ | 133 | /* Copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */ |
134 | dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + | 134 | dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + |
135 | l1_data_a_length, l1_data_b_length); | 135 | l1_data_a_length, l1_data_b_length); |
136 | 136 | ||
137 | if (L2_LENGTH != 0) { | 137 | if (L2_LENGTH != 0) { |
138 | l2_length = _ebss_l2 - _stext_l2; | 138 | l2_length = _sbss_l2 - _stext_l2; |
139 | if (l2_length > L2_LENGTH) | 139 | if (l2_length > L2_LENGTH) |
140 | panic("L2 SRAM Overflow\n"); | 140 | panic("L2 SRAM Overflow\n"); |
141 | 141 | ||
@@ -827,7 +827,7 @@ void __init setup_arch(char **cmdline_p) | |||
827 | printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", | 827 | printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", |
828 | bfin_compiled_revid(), bfin_revid()); | 828 | bfin_compiled_revid(), bfin_revid()); |
829 | } | 829 | } |
830 | if (bfin_revid() <= CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) | 830 | if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) |
831 | printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n", | 831 | printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n", |
832 | CPU, bfin_revid()); | 832 | CPU, bfin_revid()); |
833 | } | 833 | } |
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 1aa2c788e228..bef025b07443 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | 61 | ||
62 | #ifdef CONFIG_VERBOSE_DEBUG | 62 | #ifdef CONFIG_DEBUG_VERBOSE |
63 | #define verbose_printk(fmt, arg...) \ | 63 | #define verbose_printk(fmt, arg...) \ |
64 | printk(fmt, ##arg) | 64 | printk(fmt, ##arg) |
65 | #else | 65 | #else |
@@ -147,9 +147,12 @@ static void decode_address(char *buf, unsigned long address) | |||
147 | char *name = p->comm; | 147 | char *name = p->comm; |
148 | struct file *file = vma->vm_file; | 148 | struct file *file = vma->vm_file; |
149 | 149 | ||
150 | if (file) | 150 | if (file) { |
151 | name = d_path(&file->f_path, _tmpbuf, | 151 | char *d_name = d_path(&file->f_path, _tmpbuf, |
152 | sizeof(_tmpbuf)); | 152 | sizeof(_tmpbuf)); |
153 | if (!IS_ERR(d_name)) | ||
154 | name = d_name; | ||
155 | } | ||
153 | 156 | ||
154 | /* FLAT does not have its text aligned to the start of | 157 | /* FLAT does not have its text aligned to the start of |
155 | * the map while FDPIC ELF does ... | 158 | * the map while FDPIC ELF does ... |
@@ -571,7 +574,7 @@ asmlinkage void trap_c(struct pt_regs *fp) | |||
571 | #endif | 574 | #endif |
572 | panic("Kernel exception"); | 575 | panic("Kernel exception"); |
573 | } else { | 576 | } else { |
574 | #ifdef CONFIG_VERBOSE_DEBUG | 577 | #ifdef CONFIG_DEBUG_VERBOSE |
575 | unsigned long *stack; | 578 | unsigned long *stack; |
576 | /* Dump the user space stack */ | 579 | /* Dump the user space stack */ |
577 | stack = (unsigned long *)rdusp(); | 580 | stack = (unsigned long *)rdusp(); |
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S index db532181fbde..a028e9450419 100644 --- a/arch/blackfin/mach-common/cache.S +++ b/arch/blackfin/mach-common/cache.S | |||
@@ -25,9 +25,13 @@ | |||
25 | */ | 25 | */ |
26 | .macro do_flush flushins:req optflushins optnopins label | 26 | .macro do_flush flushins:req optflushins optnopins label |
27 | 27 | ||
28 | R2 = -L1_CACHE_BYTES; | ||
29 | |||
30 | /* start = (start & -L1_CACHE_BYTES) */ | ||
31 | R0 = R0 & R2; | ||
32 | |||
28 | /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */ | 33 | /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */ |
29 | R1 += -1; | 34 | R1 += -1; |
30 | R2 = -L1_CACHE_BYTES; | ||
31 | R1 = R1 & R2; | 35 | R1 = R1 & R2; |
32 | R1 += L1_CACHE_BYTES; | 36 | R1 += L1_CACHE_BYTES; |
33 | 37 | ||
@@ -63,7 +67,7 @@ ENDPROC(_blackfin_icache_flush_range) | |||
63 | 67 | ||
64 | /* Flush all cache lines assocoiated with this area of memory. */ | 68 | /* Flush all cache lines assocoiated with this area of memory. */ |
65 | ENTRY(_blackfin_icache_dcache_flush_range) | 69 | ENTRY(_blackfin_icache_dcache_flush_range) |
66 | do_flush IFLUSH, FLUSH | 70 | do_flush FLUSH, IFLUSH |
67 | ENDPROC(_blackfin_icache_dcache_flush_range) | 71 | ENDPROC(_blackfin_icache_dcache_flush_range) |
68 | 72 | ||
69 | /* Throw away all D-cached data in specified region without any obligation to | 73 | /* Throw away all D-cached data in specified region without any obligation to |
diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index c22c47b60127..dda5443b37ed 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c | |||
@@ -72,13 +72,13 @@ unsigned int __bfin_cycles_mod; | |||
72 | 72 | ||
73 | /**************************************************************************/ | 73 | /**************************************************************************/ |
74 | 74 | ||
75 | static unsigned int bfin_getfreq(unsigned int cpu) | 75 | static unsigned int bfin_getfreq_khz(unsigned int cpu) |
76 | { | 76 | { |
77 | /* The driver only support single cpu */ | 77 | /* The driver only support single cpu */ |
78 | if (cpu != 0) | 78 | if (cpu != 0) |
79 | return -1; | 79 | return -1; |
80 | 80 | ||
81 | return get_cclk(); | 81 | return get_cclk() / 1000; |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
@@ -96,7 +96,7 @@ static int bfin_target(struct cpufreq_policy *policy, | |||
96 | 96 | ||
97 | cclk_hz = bfin_freq_table[index].frequency; | 97 | cclk_hz = bfin_freq_table[index].frequency; |
98 | 98 | ||
99 | freqs.old = bfin_getfreq(0); | 99 | freqs.old = bfin_getfreq_khz(0); |
100 | freqs.new = cclk_hz; | 100 | freqs.new = cclk_hz; |
101 | freqs.cpu = 0; | 101 | freqs.cpu = 0; |
102 | 102 | ||
@@ -137,8 +137,8 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy) | |||
137 | if (policy->cpu != 0) | 137 | if (policy->cpu != 0) |
138 | return -EINVAL; | 138 | return -EINVAL; |
139 | 139 | ||
140 | cclk = get_cclk(); | 140 | cclk = get_cclk() / 1000; |
141 | sclk = get_sclk(); | 141 | sclk = get_sclk() / 1000; |
142 | 142 | ||
143 | #if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE)) | 143 | #if ANOMALY_05000273 || (!defined(CONFIG_BF54x) && defined(CONFIG_BFIN_DCACHE)) |
144 | min_cclk = sclk * 2; | 144 | min_cclk = sclk * 2; |
@@ -152,7 +152,7 @@ static int __init __bfin_cpu_init(struct cpufreq_policy *policy) | |||
152 | dpm_state_table[index].csel = csel << 4; /* Shift now into PLL_DIV bitpos */ | 152 | dpm_state_table[index].csel = csel << 4; /* Shift now into PLL_DIV bitpos */ |
153 | dpm_state_table[index].tscale = (TIME_SCALE / (1 << csel)) - 1; | 153 | dpm_state_table[index].tscale = (TIME_SCALE / (1 << csel)) - 1; |
154 | 154 | ||
155 | pr_debug("cpufreq: freq:%d csel:%d tscale:%d\n", | 155 | pr_debug("cpufreq: freq:%d csel:0x%x tscale:%d\n", |
156 | bfin_freq_table[index].frequency, | 156 | bfin_freq_table[index].frequency, |
157 | dpm_state_table[index].csel, | 157 | dpm_state_table[index].csel, |
158 | dpm_state_table[index].tscale); | 158 | dpm_state_table[index].tscale); |
@@ -173,7 +173,7 @@ static struct freq_attr *bfin_freq_attr[] = { | |||
173 | static struct cpufreq_driver bfin_driver = { | 173 | static struct cpufreq_driver bfin_driver = { |
174 | .verify = bfin_verify_speed, | 174 | .verify = bfin_verify_speed, |
175 | .target = bfin_target, | 175 | .target = bfin_target, |
176 | .get = bfin_getfreq, | 176 | .get = bfin_getfreq_khz, |
177 | .init = __bfin_cpu_init, | 177 | .init = __bfin_cpu_init, |
178 | .name = "bfin cpufreq", | 178 | .name = "bfin cpufreq", |
179 | .owner = THIS_MODULE, | 179 | .owner = THIS_MODULE, |
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index c13fa8da28c7..bde6dc4e2614 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -277,7 +277,7 @@ ENTRY(_bfin_return_from_exception) | |||
277 | p5.h = hi(ILAT); | 277 | p5.h = hi(ILAT); |
278 | r6 = [p5]; | 278 | r6 = [p5]; |
279 | r7 = 0x20; /* Did I just cause anther HW error? */ | 279 | r7 = 0x20; /* Did I just cause anther HW error? */ |
280 | r7 = r7 & r1; | 280 | r6 = r7 & r6; |
281 | CC = R7 == R6; | 281 | CC = R7 == R6; |
282 | if CC JUMP _double_fault; | 282 | if CC JUMP _double_fault; |
283 | #endif | 283 | #endif |
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c index 0f1ca6930c16..cc6f336e7313 100644 --- a/arch/blackfin/mm/sram-alloc.c +++ b/arch/blackfin/mm/sram-alloc.c | |||
@@ -183,10 +183,10 @@ static void __init l2_sram_init(void) | |||
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | 185 | ||
186 | free_l2_sram_head.next->paddr = (void *)L2_START + | 186 | free_l2_sram_head.next->paddr = |
187 | (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); | 187 | (void *)L2_START + (_ebss_l2 - _stext_l2); |
188 | free_l2_sram_head.next->size = L2_LENGTH - | 188 | free_l2_sram_head.next->size = |
189 | (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); | 189 | L2_LENGTH - (_ebss_l2 - _stext_l2); |
190 | free_l2_sram_head.next->pid = 0; | 190 | free_l2_sram_head.next->pid = 0; |
191 | free_l2_sram_head.next->next = NULL; | 191 | free_l2_sram_head.next->next = NULL; |
192 | 192 | ||
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h index 47d686dba1eb..a3e44a5ed497 100644 --- a/arch/ia64/include/asm/intrinsics.h +++ b/arch/ia64/include/asm/intrinsics.h | |||
@@ -226,7 +226,7 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void); | |||
226 | /************************************************/ | 226 | /************************************************/ |
227 | #define ia64_ssm IA64_INTRINSIC_MACRO(ssm) | 227 | #define ia64_ssm IA64_INTRINSIC_MACRO(ssm) |
228 | #define ia64_rsm IA64_INTRINSIC_MACRO(rsm) | 228 | #define ia64_rsm IA64_INTRINSIC_MACRO(rsm) |
229 | #define ia64_getreg IA64_INTRINSIC_API(getreg) | 229 | #define ia64_getreg IA64_INTRINSIC_MACRO(getreg) |
230 | #define ia64_setreg IA64_INTRINSIC_API(setreg) | 230 | #define ia64_setreg IA64_INTRINSIC_API(setreg) |
231 | #define ia64_set_rr IA64_INTRINSIC_API(set_rr) | 231 | #define ia64_set_rr IA64_INTRINSIC_API(set_rr) |
232 | #define ia64_get_rr IA64_INTRINSIC_API(get_rr) | 232 | #define ia64_get_rr IA64_INTRINSIC_API(get_rr) |
diff --git a/arch/ia64/include/asm/paravirt_privop.h b/arch/ia64/include/asm/paravirt_privop.h index d577aac11835..0b597424fcfc 100644 --- a/arch/ia64/include/asm/paravirt_privop.h +++ b/arch/ia64/include/asm/paravirt_privop.h | |||
@@ -78,6 +78,19 @@ extern unsigned long ia64_native_getreg_func(int regnum); | |||
78 | ia64_native_rsm(mask); \ | 78 | ia64_native_rsm(mask); \ |
79 | } while (0) | 79 | } while (0) |
80 | 80 | ||
81 | /* returned ip value should be the one in the caller, | ||
82 | * not in __paravirt_getreg() */ | ||
83 | #define paravirt_getreg(reg) \ | ||
84 | ({ \ | ||
85 | unsigned long res; \ | ||
86 | BUILD_BUG_ON(!__builtin_constant_p(reg)); \ | ||
87 | if ((reg) == _IA64_REG_IP) \ | ||
88 | res = ia64_native_getreg(_IA64_REG_IP); \ | ||
89 | else \ | ||
90 | res = pv_cpu_ops.getreg(reg); \ | ||
91 | res; \ | ||
92 | }) | ||
93 | |||
81 | /****************************************************************************** | 94 | /****************************************************************************** |
82 | * replacement of hand written assembly codes. | 95 | * replacement of hand written assembly codes. |
83 | */ | 96 | */ |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 7ef0c594f5ed..d435f4a7a96c 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -499,6 +499,7 @@ GLOBAL_ENTRY(prefetch_stack) | |||
499 | END(prefetch_stack) | 499 | END(prefetch_stack) |
500 | 500 | ||
501 | GLOBAL_ENTRY(kernel_execve) | 501 | GLOBAL_ENTRY(kernel_execve) |
502 | rum psr.ac | ||
502 | mov r15=__NR_execve // put syscall number in place | 503 | mov r15=__NR_execve // put syscall number in place |
503 | break __BREAK_SYSCALL | 504 | break __BREAK_SYSCALL |
504 | br.ret.sptk.many rp | 505 | br.ret.sptk.many rp |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 66e491d8baac..59301c472800 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
@@ -260,7 +260,7 @@ start_ap: | |||
260 | * Switch into virtual mode: | 260 | * Switch into virtual mode: |
261 | */ | 261 | */ |
262 | movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \ | 262 | movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \ |
263 | |IA64_PSR_DI) | 263 | |IA64_PSR_DI|IA64_PSR_AC) |
264 | ;; | 264 | ;; |
265 | mov cr.ipsr=r16 | 265 | mov cr.ipsr=r16 |
266 | movl r17=1f | 266 | movl r17=1f |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 7dd96c127177..bab1de2d2f6a 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -1139,7 +1139,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, | |||
1139 | return previous_current; | 1139 | return previous_current; |
1140 | 1140 | ||
1141 | no_mod: | 1141 | no_mod: |
1142 | printk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", | 1142 | mprintk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", |
1143 | smp_processor_id(), type, msg); | 1143 | smp_processor_id(), type, msg); |
1144 | return previous_current; | 1144 | return previous_current; |
1145 | } | 1145 | } |
diff --git a/arch/ia64/kernel/paravirt.c b/arch/ia64/kernel/paravirt.c index de35d8e8b7d2..9f14c16f6369 100644 --- a/arch/ia64/kernel/paravirt.c +++ b/arch/ia64/kernel/paravirt.c | |||
@@ -130,7 +130,7 @@ ia64_native_getreg_func(int regnum) | |||
130 | unsigned long res = -1; | 130 | unsigned long res = -1; |
131 | switch (regnum) { | 131 | switch (regnum) { |
132 | CASE_GET_REG(GP); | 132 | CASE_GET_REG(GP); |
133 | CASE_GET_REG(IP); | 133 | /*CASE_GET_REG(IP);*/ /* returned ip value shouldn't be constant */ |
134 | CASE_GET_REG(PSR); | 134 | CASE_GET_REG(PSR); |
135 | CASE_GET_REG(TP); | 135 | CASE_GET_REG(TP); |
136 | CASE_GET_REG(SP); | 136 | CASE_GET_REG(SP); |
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index dbdb778efa05..2a92f637431d 100644 --- a/arch/ia64/kernel/pci-dma.c +++ b/arch/ia64/kernel/pci-dma.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | 20 | ||
21 | #include <asm/page.h> | 21 | #include <asm/page.h> |
22 | #include <asm/iommu.h> | ||
23 | 22 | ||
24 | dma_addr_t bad_dma_address __read_mostly; | 23 | dma_addr_t bad_dma_address __read_mostly; |
25 | EXPORT_SYMBOL(bad_dma_address); | 24 | EXPORT_SYMBOL(bad_dma_address); |
diff --git a/arch/ia64/xen/hypercall.S b/arch/ia64/xen/hypercall.S index d4ff0b9e79f1..45e02bb64a92 100644 --- a/arch/ia64/xen/hypercall.S +++ b/arch/ia64/xen/hypercall.S | |||
@@ -58,7 +58,7 @@ __HCALL2(xen_set_rr, HYPERPRIVOP_SET_RR) | |||
58 | __HCALL2(xen_set_kr, HYPERPRIVOP_SET_KR) | 58 | __HCALL2(xen_set_kr, HYPERPRIVOP_SET_KR) |
59 | 59 | ||
60 | #ifdef CONFIG_IA32_SUPPORT | 60 | #ifdef CONFIG_IA32_SUPPORT |
61 | __HCALL1(xen_get_eflag, HYPERPRIVOP_GET_EFLAG) | 61 | __HCALL0(xen_get_eflag, HYPERPRIVOP_GET_EFLAG) |
62 | __HCALL1(xen_set_eflag, HYPERPRIVOP_SET_EFLAG) // refer SDM vol1 3.1.8 | 62 | __HCALL1(xen_set_eflag, HYPERPRIVOP_SET_EFLAG) // refer SDM vol1 3.1.8 |
63 | #endif /* CONFIG_IA32_SUPPORT */ | 63 | #endif /* CONFIG_IA32_SUPPORT */ |
64 | 64 | ||
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h index c8e554eafce3..b5cf6457305a 100644 --- a/arch/mips/include/asm/mach-rc32434/gpio.h +++ b/arch/mips/include/asm/mach-rc32434/gpio.h | |||
@@ -84,5 +84,7 @@ extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned | |||
84 | extern unsigned get_434_reg(unsigned reg_offs); | 84 | extern unsigned get_434_reg(unsigned reg_offs); |
85 | extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask); | 85 | extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask); |
86 | extern unsigned char get_latch_u5(void); | 86 | extern unsigned char get_latch_u5(void); |
87 | extern void rb532_gpio_set_ilevel(int bit, unsigned gpio); | ||
88 | extern void rb532_gpio_set_istat(int bit, unsigned gpio); | ||
87 | 89 | ||
88 | #endif /* _RC32434_GPIO_H_ */ | 90 | #endif /* _RC32434_GPIO_H_ */ |
diff --git a/arch/mips/include/asm/mach-rc32434/rb.h b/arch/mips/include/asm/mach-rc32434/rb.h index 79e8ef67d0d3..f25a84916703 100644 --- a/arch/mips/include/asm/mach-rc32434/rb.h +++ b/arch/mips/include/asm/mach-rc32434/rb.h | |||
@@ -40,12 +40,14 @@ | |||
40 | #define BTCS 0x010040 | 40 | #define BTCS 0x010040 |
41 | #define BTCOMPARE 0x010044 | 41 | #define BTCOMPARE 0x010044 |
42 | #define GPIOBASE 0x050000 | 42 | #define GPIOBASE 0x050000 |
43 | #define GPIOCFG 0x050004 | 43 | /* Offsets relative to GPIOBASE */ |
44 | #define GPIOD 0x050008 | 44 | #define GPIOFUNC 0x00 |
45 | #define GPIOILEVEL 0x05000C | 45 | #define GPIOCFG 0x04 |
46 | #define GPIOISTAT 0x050010 | 46 | #define GPIOD 0x08 |
47 | #define GPIONMIEN 0x050014 | 47 | #define GPIOILEVEL 0x0C |
48 | #define IMASK6 0x038038 | 48 | #define GPIOISTAT 0x10 |
49 | #define GPIONMIEN 0x14 | ||
50 | #define IMASK6 0x38 | ||
49 | #define LO_WPX (1 << 0) | 51 | #define LO_WPX (1 << 0) |
50 | #define LO_ALE (1 << 1) | 52 | #define LO_ALE (1 << 1) |
51 | #define LO_CLE (1 << 2) | 53 | #define LO_CLE (1 << 2) |
diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h index d3bd5c5aa2ec..9601ea950542 100644 --- a/arch/mips/include/asm/time.h +++ b/arch/mips/include/asm/time.h | |||
@@ -63,7 +63,7 @@ static inline int mips_clockevent_init(void) | |||
63 | /* | 63 | /* |
64 | * Initialize the count register as a clocksource | 64 | * Initialize the count register as a clocksource |
65 | */ | 65 | */ |
66 | #ifdef CONFIG_CEVT_R4K | 66 | #ifdef CONFIG_CSRC_R4K |
67 | extern int init_mips_clocksource(void); | 67 | extern int init_mips_clocksource(void); |
68 | #else | 68 | #else |
69 | static inline int init_mips_clocksource(void) | 69 | static inline int init_mips_clocksource(void) |
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 86e026f067bc..74fb74583b4e 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c | |||
@@ -27,7 +27,7 @@ int __init init_mips_clocksource(void) | |||
27 | if (!cpu_has_counter || !mips_hpt_frequency) | 27 | if (!cpu_has_counter || !mips_hpt_frequency) |
28 | return -ENXIO; | 28 | return -ENXIO; |
29 | 29 | ||
30 | /* Calclate a somewhat reasonable rating value */ | 30 | /* Calculate a somewhat reasonable rating value */ |
31 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; | 31 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; |
32 | 32 | ||
33 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); | 33 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); |
diff --git a/arch/mips/mm/sc-ip22.c b/arch/mips/mm/sc-ip22.c index 1f602a110e10..13adb5782110 100644 --- a/arch/mips/mm/sc-ip22.c +++ b/arch/mips/mm/sc-ip22.c | |||
@@ -161,7 +161,7 @@ static inline int __init indy_sc_probe(void) | |||
161 | 161 | ||
162 | /* XXX Check with wje if the Indy caches can differenciate between | 162 | /* XXX Check with wje if the Indy caches can differenciate between |
163 | writeback + invalidate and just invalidate. */ | 163 | writeback + invalidate and just invalidate. */ |
164 | struct bcache_ops indy_sc_ops = { | 164 | static struct bcache_ops indy_sc_ops = { |
165 | .bc_enable = indy_sc_enable, | 165 | .bc_enable = indy_sc_enable, |
166 | .bc_disable = indy_sc_disable, | 166 | .bc_disable = indy_sc_disable, |
167 | .bc_wback_inv = indy_sc_wback_invalidate, | 167 | .bc_wback_inv = indy_sc_wback_invalidate, |
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c index 96236bf33838..df9e526312a2 100644 --- a/arch/mips/mti-malta/malta-amon.c +++ b/arch/mips/mti-malta/malta-amon.c | |||
@@ -22,9 +22,9 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/smp.h> | 23 | #include <linux/smp.h> |
24 | 24 | ||
25 | #include <asm-mips/addrspace.h> | 25 | #include <asm/addrspace.h> |
26 | #include <asm-mips/mips-boards/launch.h> | 26 | #include <asm/mips-boards/launch.h> |
27 | #include <asm-mips/mipsmtregs.h> | 27 | #include <asm/mipsmtregs.h> |
28 | 28 | ||
29 | int amon_cpu_avail(int cpu) | 29 | int amon_cpu_avail(int cpu) |
30 | { | 30 | { |
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 2f22d714d5b0..c1c29181bd46 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c | |||
@@ -118,7 +118,7 @@ static struct platform_device cf_slot0 = { | |||
118 | /* Resources and device for NAND */ | 118 | /* Resources and device for NAND */ |
119 | static int rb532_dev_ready(struct mtd_info *mtd) | 119 | static int rb532_dev_ready(struct mtd_info *mtd) |
120 | { | 120 | { |
121 | return readl(IDT434_REG_BASE + GPIOD) & GPIO_RDY; | 121 | return gpio_get_value(GPIO_RDY); |
122 | } | 122 | } |
123 | 123 | ||
124 | static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | 124 | static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index 70c4a6726377..0e84c8ab6a39 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c | |||
@@ -39,10 +39,6 @@ | |||
39 | struct rb532_gpio_chip { | 39 | struct rb532_gpio_chip { |
40 | struct gpio_chip chip; | 40 | struct gpio_chip chip; |
41 | void __iomem *regbase; | 41 | void __iomem *regbase; |
42 | void (*set_int_level)(struct gpio_chip *chip, unsigned offset, int value); | ||
43 | int (*get_int_level)(struct gpio_chip *chip, unsigned offset); | ||
44 | void (*set_int_status)(struct gpio_chip *chip, unsigned offset, int value); | ||
45 | int (*get_int_status)(struct gpio_chip *chip, unsigned offset); | ||
46 | }; | 42 | }; |
47 | 43 | ||
48 | struct mpmc_device dev3; | 44 | struct mpmc_device dev3; |
@@ -111,15 +107,47 @@ unsigned char get_latch_u5(void) | |||
111 | } | 107 | } |
112 | EXPORT_SYMBOL(get_latch_u5); | 108 | EXPORT_SYMBOL(get_latch_u5); |
113 | 109 | ||
110 | /* rb532_set_bit - sanely set a bit | ||
111 | * | ||
112 | * bitval: new value for the bit | ||
113 | * offset: bit index in the 4 byte address range | ||
114 | * ioaddr: 4 byte aligned address being altered | ||
115 | */ | ||
116 | static inline void rb532_set_bit(unsigned bitval, | ||
117 | unsigned offset, void __iomem *ioaddr) | ||
118 | { | ||
119 | unsigned long flags; | ||
120 | u32 val; | ||
121 | |||
122 | bitval = !!bitval; /* map parameter to {0,1} */ | ||
123 | |||
124 | local_irq_save(flags); | ||
125 | |||
126 | val = readl(ioaddr); | ||
127 | val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */ | ||
128 | val |= ( bitval << offset ); /* set bit if bitval == 1 */ | ||
129 | writel(val, ioaddr); | ||
130 | |||
131 | local_irq_restore(flags); | ||
132 | } | ||
133 | |||
134 | /* rb532_get_bit - read a bit | ||
135 | * | ||
136 | * returns the boolean state of the bit, which may be > 1 | ||
137 | */ | ||
138 | static inline int rb532_get_bit(unsigned offset, void __iomem *ioaddr) | ||
139 | { | ||
140 | return (readl(ioaddr) & (1 << offset)); | ||
141 | } | ||
142 | |||
114 | /* | 143 | /* |
115 | * Return GPIO level */ | 144 | * Return GPIO level */ |
116 | static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) | 145 | static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) |
117 | { | 146 | { |
118 | u32 mask = 1 << offset; | ||
119 | struct rb532_gpio_chip *gpch; | 147 | struct rb532_gpio_chip *gpch; |
120 | 148 | ||
121 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 149 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
122 | return readl(gpch->regbase + GPIOD) & mask; | 150 | return rb532_get_bit(offset, gpch->regbase + GPIOD); |
123 | } | 151 | } |
124 | 152 | ||
125 | /* | 153 | /* |
@@ -128,23 +156,10 @@ static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
128 | static void rb532_gpio_set(struct gpio_chip *chip, | 156 | static void rb532_gpio_set(struct gpio_chip *chip, |
129 | unsigned offset, int value) | 157 | unsigned offset, int value) |
130 | { | 158 | { |
131 | unsigned long flags; | ||
132 | u32 mask = 1 << offset; | ||
133 | u32 tmp; | ||
134 | struct rb532_gpio_chip *gpch; | 159 | struct rb532_gpio_chip *gpch; |
135 | void __iomem *gpvr; | ||
136 | 160 | ||
137 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 161 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
138 | gpvr = gpch->regbase + GPIOD; | 162 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); |
139 | |||
140 | local_irq_save(flags); | ||
141 | tmp = readl(gpvr); | ||
142 | if (value) | ||
143 | tmp |= mask; | ||
144 | else | ||
145 | tmp &= ~mask; | ||
146 | writel(tmp, gpvr); | ||
147 | local_irq_restore(flags); | ||
148 | } | 163 | } |
149 | 164 | ||
150 | /* | 165 | /* |
@@ -152,21 +167,14 @@ static void rb532_gpio_set(struct gpio_chip *chip, | |||
152 | */ | 167 | */ |
153 | static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 168 | static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
154 | { | 169 | { |
155 | unsigned long flags; | ||
156 | u32 mask = 1 << offset; | ||
157 | u32 value; | ||
158 | struct rb532_gpio_chip *gpch; | 170 | struct rb532_gpio_chip *gpch; |
159 | void __iomem *gpdr; | ||
160 | 171 | ||
161 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 172 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
162 | gpdr = gpch->regbase + GPIOCFG; | ||
163 | 173 | ||
164 | local_irq_save(flags); | 174 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) |
165 | value = readl(gpdr); | 175 | return 1; /* alternate function, GPIOCFG is ignored */ |
166 | value &= ~mask; | ||
167 | writel(value, gpdr); | ||
168 | local_irq_restore(flags); | ||
169 | 176 | ||
177 | rb532_set_bit(0, offset, gpch->regbase + GPIOCFG); | ||
170 | return 0; | 178 | return 0; |
171 | } | 179 | } |
172 | 180 | ||
@@ -176,117 +184,60 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | |||
176 | static int rb532_gpio_direction_output(struct gpio_chip *chip, | 184 | static int rb532_gpio_direction_output(struct gpio_chip *chip, |
177 | unsigned offset, int value) | 185 | unsigned offset, int value) |
178 | { | 186 | { |
179 | unsigned long flags; | ||
180 | u32 mask = 1 << offset; | ||
181 | u32 tmp; | ||
182 | struct rb532_gpio_chip *gpch; | 187 | struct rb532_gpio_chip *gpch; |
183 | void __iomem *gpdr; | ||
184 | 188 | ||
185 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 189 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
186 | writel(mask, gpch->regbase + GPIOD); | ||
187 | gpdr = gpch->regbase + GPIOCFG; | ||
188 | 190 | ||
189 | local_irq_save(flags); | 191 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) |
190 | tmp = readl(gpdr); | 192 | return 1; /* alternate function, GPIOCFG is ignored */ |
191 | tmp |= mask; | ||
192 | writel(tmp, gpdr); | ||
193 | local_irq_restore(flags); | ||
194 | 193 | ||
194 | /* set the initial output value */ | ||
195 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); | ||
196 | |||
197 | rb532_set_bit(1, offset, gpch->regbase + GPIOCFG); | ||
195 | return 0; | 198 | return 0; |
196 | } | 199 | } |
197 | 200 | ||
198 | /* | 201 | static struct rb532_gpio_chip rb532_gpio_chip[] = { |
199 | * Set the GPIO interrupt level | 202 | [0] = { |
200 | */ | 203 | .chip = { |
201 | static void rb532_gpio_set_int_level(struct gpio_chip *chip, | 204 | .label = "gpio0", |
202 | unsigned offset, int value) | 205 | .direction_input = rb532_gpio_direction_input, |
203 | { | 206 | .direction_output = rb532_gpio_direction_output, |
204 | unsigned long flags; | 207 | .get = rb532_gpio_get, |
205 | u32 mask = 1 << offset; | 208 | .set = rb532_gpio_set, |
206 | u32 tmp; | 209 | .base = 0, |
207 | struct rb532_gpio_chip *gpch; | 210 | .ngpio = 32, |
208 | void __iomem *gpil; | 211 | }, |
209 | 212 | }, | |
210 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 213 | }; |
211 | gpil = gpch->regbase + GPIOILEVEL; | ||
212 | |||
213 | local_irq_save(flags); | ||
214 | tmp = readl(gpil); | ||
215 | if (value) | ||
216 | tmp |= mask; | ||
217 | else | ||
218 | tmp &= ~mask; | ||
219 | writel(tmp, gpil); | ||
220 | local_irq_restore(flags); | ||
221 | } | ||
222 | 214 | ||
223 | /* | 215 | /* |
224 | * Get the GPIO interrupt level | 216 | * Set GPIO interrupt level |
225 | */ | 217 | */ |
226 | static int rb532_gpio_get_int_level(struct gpio_chip *chip, unsigned offset) | 218 | void rb532_gpio_set_ilevel(int bit, unsigned gpio) |
227 | { | 219 | { |
228 | u32 mask = 1 << offset; | 220 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOILEVEL); |
229 | struct rb532_gpio_chip *gpch; | ||
230 | |||
231 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
232 | return readl(gpch->regbase + GPIOILEVEL) & mask; | ||
233 | } | 221 | } |
222 | EXPORT_SYMBOL(rb532_gpio_set_ilevel); | ||
234 | 223 | ||
235 | /* | 224 | /* |
236 | * Set the GPIO interrupt status | 225 | * Set GPIO interrupt status |
237 | */ | 226 | */ |
238 | static void rb532_gpio_set_int_status(struct gpio_chip *chip, | 227 | void rb532_gpio_set_istat(int bit, unsigned gpio) |
239 | unsigned offset, int value) | ||
240 | { | 228 | { |
241 | unsigned long flags; | 229 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOISTAT); |
242 | u32 mask = 1 << offset; | ||
243 | u32 tmp; | ||
244 | struct rb532_gpio_chip *gpch; | ||
245 | void __iomem *gpis; | ||
246 | |||
247 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
248 | gpis = gpch->regbase + GPIOISTAT; | ||
249 | |||
250 | local_irq_save(flags); | ||
251 | tmp = readl(gpis); | ||
252 | if (value) | ||
253 | tmp |= mask; | ||
254 | else | ||
255 | tmp &= ~mask; | ||
256 | writel(tmp, gpis); | ||
257 | local_irq_restore(flags); | ||
258 | } | 230 | } |
231 | EXPORT_SYMBOL(rb532_gpio_set_istat); | ||
259 | 232 | ||
260 | /* | 233 | /* |
261 | * Get the GPIO interrupt status | 234 | * Configure GPIO alternate function |
262 | */ | 235 | */ |
263 | static int rb532_gpio_get_int_status(struct gpio_chip *chip, unsigned offset) | 236 | static void rb532_gpio_set_func(int bit, unsigned gpio) |
264 | { | 237 | { |
265 | u32 mask = 1 << offset; | 238 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOFUNC); |
266 | struct rb532_gpio_chip *gpch; | ||
267 | |||
268 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
269 | return readl(gpch->regbase + GPIOISTAT) & mask; | ||
270 | } | 239 | } |
271 | 240 | ||
272 | static struct rb532_gpio_chip rb532_gpio_chip[] = { | ||
273 | [0] = { | ||
274 | .chip = { | ||
275 | .label = "gpio0", | ||
276 | .direction_input = rb532_gpio_direction_input, | ||
277 | .direction_output = rb532_gpio_direction_output, | ||
278 | .get = rb532_gpio_get, | ||
279 | .set = rb532_gpio_set, | ||
280 | .base = 0, | ||
281 | .ngpio = 32, | ||
282 | }, | ||
283 | .get_int_level = rb532_gpio_get_int_level, | ||
284 | .set_int_level = rb532_gpio_set_int_level, | ||
285 | .get_int_status = rb532_gpio_get_int_status, | ||
286 | .set_int_status = rb532_gpio_set_int_status, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | int __init rb532_gpio_init(void) | 241 | int __init rb532_gpio_init(void) |
291 | { | 242 | { |
292 | struct resource *r; | 243 | struct resource *r; |
@@ -310,9 +261,11 @@ int __init rb532_gpio_init(void) | |||
310 | return -ENXIO; | 261 | return -ENXIO; |
311 | } | 262 | } |
312 | 263 | ||
313 | /* Set the interrupt status and level for the CF pin */ | 264 | /* configure CF_GPIO_NUM as CFRDY IRQ source */ |
314 | rb532_gpio_set_int_level(&rb532_gpio_chip->chip, CF_GPIO_NUM, 1); | 265 | rb532_gpio_set_func(0, CF_GPIO_NUM); |
315 | rb532_gpio_set_int_status(&rb532_gpio_chip->chip, CF_GPIO_NUM, 0); | 266 | rb532_gpio_direction_input(&rb532_gpio_chip->chip, CF_GPIO_NUM); |
267 | rb532_gpio_set_ilevel(1, CF_GPIO_NUM); | ||
268 | rb532_gpio_set_istat(0, CF_GPIO_NUM); | ||
316 | 269 | ||
317 | return 0; | 270 | return 0; |
318 | } | 271 | } |
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 90904f9dfc50..927db3668b6f 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
@@ -183,10 +183,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
183 | * being 64 bit in both cases. | 183 | * being 64 bit in both cases. |
184 | */ | 184 | */ |
185 | 185 | ||
186 | static long translate_usr_offset(long offset) | 186 | static compat_ulong_t translate_usr_offset(compat_ulong_t offset) |
187 | { | 187 | { |
188 | if (offset < 0) | 188 | if (offset < 0) |
189 | return -1; | 189 | return sizeof(struct pt_regs); |
190 | else if (offset <= 32*4) /* gr[0..31] */ | 190 | else if (offset <= 32*4) /* gr[0..31] */ |
191 | return offset * 2 + 4; | 191 | return offset * 2 + 4; |
192 | else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */ | 192 | else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */ |
@@ -194,7 +194,7 @@ static long translate_usr_offset(long offset) | |||
194 | else if (offset < sizeof(struct pt_regs)/2 + 32*4) | 194 | else if (offset < sizeof(struct pt_regs)/2 + 32*4) |
195 | return offset * 2 + 4 - 32*8; | 195 | return offset * 2 + 4 - 32*8; |
196 | else | 196 | else |
197 | return -1; | 197 | return sizeof(struct pt_regs); |
198 | } | 198 | } |
199 | 199 | ||
200 | long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | 200 | long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
@@ -209,7 +209,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
209 | if (addr & (sizeof(compat_uint_t)-1)) | 209 | if (addr & (sizeof(compat_uint_t)-1)) |
210 | break; | 210 | break; |
211 | addr = translate_usr_offset(addr); | 211 | addr = translate_usr_offset(addr); |
212 | if (addr < 0) | 212 | if (addr >= sizeof(struct pt_regs)) |
213 | break; | 213 | break; |
214 | 214 | ||
215 | tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr); | 215 | tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr); |
@@ -236,7 +236,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
236 | if (addr & (sizeof(compat_uint_t)-1)) | 236 | if (addr & (sizeof(compat_uint_t)-1)) |
237 | break; | 237 | break; |
238 | addr = translate_usr_offset(addr); | 238 | addr = translate_usr_offset(addr); |
239 | if (addr < 0) | 239 | if (addr >= sizeof(struct pt_regs)) |
240 | break; | 240 | break; |
241 | if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { | 241 | if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { |
242 | /* Special case, fp regs are 64 bits anyway */ | 242 | /* Special case, fp regs are 64 bits anyway */ |
diff --git a/arch/sparc/include/asm/unistd_32.h b/arch/sparc/include/asm/unistd_32.h index 648643a9f139..0d13d2a4c76f 100644 --- a/arch/sparc/include/asm/unistd_32.h +++ b/arch/sparc/include/asm/unistd_32.h | |||
@@ -338,8 +338,9 @@ | |||
338 | #define __NR_dup3 320 | 338 | #define __NR_dup3 320 |
339 | #define __NR_pipe2 321 | 339 | #define __NR_pipe2 321 |
340 | #define __NR_inotify_init1 322 | 340 | #define __NR_inotify_init1 322 |
341 | #define __NR_accept4 323 | ||
341 | 342 | ||
342 | #define NR_SYSCALLS 323 | 343 | #define NR_SYSCALLS 324 |
343 | 344 | ||
344 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, | 345 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, |
345 | * it never had the plain ones and there is no value to adding those | 346 | * it never had the plain ones and there is no value to adding those |
diff --git a/arch/sparc/include/asm/unistd_64.h b/arch/sparc/include/asm/unistd_64.h index c5cc0e052321..fa5d3c0343c7 100644 --- a/arch/sparc/include/asm/unistd_64.h +++ b/arch/sparc/include/asm/unistd_64.h | |||
@@ -340,8 +340,9 @@ | |||
340 | #define __NR_dup3 320 | 340 | #define __NR_dup3 320 |
341 | #define __NR_pipe2 321 | 341 | #define __NR_pipe2 321 |
342 | #define __NR_inotify_init1 322 | 342 | #define __NR_inotify_init1 322 |
343 | #define __NR_accept4 323 | ||
343 | 344 | ||
344 | #define NR_SYSCALLS 323 | 345 | #define NR_SYSCALLS 324 |
345 | 346 | ||
346 | #ifdef __KERNEL__ | 347 | #ifdef __KERNEL__ |
347 | #define __ARCH_WANT_IPC_PARSE_VERSION | 348 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index e1b9233b90ab..7d0807586442 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S | |||
@@ -81,4 +81,4 @@ sys_call_table: | |||
81 | /*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait | 81 | /*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait |
82 | /*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate | 82 | /*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate |
83 | /*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 83 | /*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
84 | /*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1 | 84 | /*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4 |
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index ade18ba0c686..f061c4dda9ef 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S | |||
@@ -150,7 +150,7 @@ sys32_mmap2: | |||
150 | sys32_socketcall: /* %o0=call, %o1=args */ | 150 | sys32_socketcall: /* %o0=call, %o1=args */ |
151 | cmp %o0, 1 | 151 | cmp %o0, 1 |
152 | bl,pn %xcc, do_einval | 152 | bl,pn %xcc, do_einval |
153 | cmp %o0, 17 | 153 | cmp %o0, 18 |
154 | bg,pn %xcc, do_einval | 154 | bg,pn %xcc, do_einval |
155 | sub %o0, 1, %o0 | 155 | sub %o0, 1, %o0 |
156 | sllx %o0, 5, %o0 | 156 | sllx %o0, 5, %o0 |
@@ -319,6 +319,15 @@ do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) | |||
319 | nop | 319 | nop |
320 | nop | 320 | nop |
321 | nop | 321 | nop |
322 | do_sys_accept4: /* sys_accept4(int, struct sockaddr *, int *, int) */ | ||
323 | 63: ldswa [%o1 + 0x0] %asi, %o0 | ||
324 | sethi %hi(sys_accept4), %g1 | ||
325 | 64: lduwa [%o1 + 0x8] %asi, %o2 | ||
326 | 65: ldswa [%o1 + 0xc] %asi, %o3 | ||
327 | jmpl %g1 + %lo(sys_accept4), %g0 | ||
328 | 66: lduwa [%o1 + 0x4] %asi, %o1 | ||
329 | nop | ||
330 | nop | ||
322 | 331 | ||
323 | .section __ex_table,"a" | 332 | .section __ex_table,"a" |
324 | .align 4 | 333 | .align 4 |
@@ -353,4 +362,6 @@ do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) | |||
353 | .word 57b, __retl_efault, 58b, __retl_efault | 362 | .word 57b, __retl_efault, 58b, __retl_efault |
354 | .word 59b, __retl_efault, 60b, __retl_efault | 363 | .word 59b, __retl_efault, 60b, __retl_efault |
355 | .word 61b, __retl_efault, 62b, __retl_efault | 364 | .word 61b, __retl_efault, 62b, __retl_efault |
365 | .word 63b, __retl_efault, 64b, __retl_efault | ||
366 | .word 65b, __retl_efault, 66b, __retl_efault | ||
356 | .previous | 367 | .previous |
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index b2fa4c163638..9fc78cf354bd 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S | |||
@@ -82,7 +82,7 @@ sys_call_table32: | |||
82 | .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait | 82 | .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait |
83 | /*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate | 83 | /*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate |
84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1 | 85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4 |
86 | 86 | ||
87 | #endif /* CONFIG_COMPAT */ | 87 | #endif /* CONFIG_COMPAT */ |
88 | 88 | ||
@@ -156,4 +156,4 @@ sys_call_table: | |||
156 | .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait | 156 | .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait |
157 | /*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate | 157 | /*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate |
158 | .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 158 | .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
159 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1 | 159 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4 |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 669c6d588bde..2187c6086889 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -167,9 +167,12 @@ config GENERIC_PENDING_IRQ | |||
167 | config X86_SMP | 167 | config X86_SMP |
168 | bool | 168 | bool |
169 | depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64) | 169 | depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64) |
170 | select USE_GENERIC_SMP_HELPERS | ||
171 | default y | 170 | default y |
172 | 171 | ||
172 | config USE_GENERIC_SMP_HELPERS | ||
173 | def_bool y | ||
174 | depends on SMP | ||
175 | |||
173 | config X86_32_SMP | 176 | config X86_32_SMP |
174 | def_bool y | 177 | def_bool y |
175 | depends on X86_32 && SMP | 178 | depends on X86_32 && SMP |
@@ -957,7 +960,7 @@ config ARCH_PHYS_ADDR_T_64BIT | |||
957 | config NUMA | 960 | config NUMA |
958 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" | 961 | bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" |
959 | depends on SMP | 962 | depends on SMP |
960 | depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && BROKEN) | 963 | depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL) |
961 | default n if X86_PC | 964 | default n if X86_PC |
962 | default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) | 965 | default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) |
963 | help | 966 | help |
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c index 0be77b39328a..7e8e8b25f5f6 100644 --- a/arch/x86/boot/tty.c +++ b/arch/x86/boot/tty.c | |||
@@ -74,7 +74,7 @@ static int kbd_pending(void) | |||
74 | { | 74 | { |
75 | u8 pending; | 75 | u8 pending; |
76 | asm volatile("int $0x16; setnz %0" | 76 | asm volatile("int $0x16; setnz %0" |
77 | : "=rm" (pending) | 77 | : "=qm" (pending) |
78 | : "a" (0x0100)); | 78 | : "a" (0x0100)); |
79 | return pending; | 79 | return pending; |
80 | } | 80 | } |
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 7f225a4b2a26..097794ff6b79 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -71,15 +71,13 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) | |||
71 | /* Make sure we keep the same behaviour */ | 71 | /* Make sure we keep the same behaviour */ |
72 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 72 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
73 | { | 73 | { |
74 | #ifdef CONFIG_X86_32 | 74 | #ifdef CONFIG_X86_64 |
75 | return 0; | ||
76 | #else | ||
77 | struct dma_mapping_ops *ops = get_dma_ops(dev); | 75 | struct dma_mapping_ops *ops = get_dma_ops(dev); |
78 | if (ops->mapping_error) | 76 | if (ops->mapping_error) |
79 | return ops->mapping_error(dev, dma_addr); | 77 | return ops->mapping_error(dev, dma_addr); |
80 | 78 | ||
81 | return (dma_addr == bad_dma_address); | ||
82 | #endif | 79 | #endif |
80 | return (dma_addr == bad_dma_address); | ||
83 | } | 81 | } |
84 | 82 | ||
85 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 83 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
diff --git a/arch/x86/include/asm/ds.h b/arch/x86/include/asm/ds.h index 72c5a190bf48..a95008457ea4 100644 --- a/arch/x86/include/asm/ds.h +++ b/arch/x86/include/asm/ds.h | |||
@@ -23,12 +23,13 @@ | |||
23 | #ifndef _ASM_X86_DS_H | 23 | #ifndef _ASM_X86_DS_H |
24 | #define _ASM_X86_DS_H | 24 | #define _ASM_X86_DS_H |
25 | 25 | ||
26 | #ifdef CONFIG_X86_DS | ||
27 | 26 | ||
28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
30 | 29 | ||
31 | 30 | ||
31 | #ifdef CONFIG_X86_DS | ||
32 | |||
32 | struct task_struct; | 33 | struct task_struct; |
33 | 34 | ||
34 | /* | 35 | /* |
@@ -232,7 +233,8 @@ extern void ds_free(struct ds_context *context); | |||
232 | 233 | ||
233 | #else /* CONFIG_X86_DS */ | 234 | #else /* CONFIG_X86_DS */ |
234 | 235 | ||
235 | #define ds_init_intel(config) do {} while (0) | 236 | struct cpuinfo_x86; |
237 | static inline void __cpuinit ds_init_intel(struct cpuinfo_x86 *ignored) {} | ||
236 | 238 | ||
237 | #endif /* CONFIG_X86_DS */ | 239 | #endif /* CONFIG_X86_DS */ |
238 | #endif /* _ASM_X86_DS_H */ | 240 | #endif /* _ASM_X86_DS_H */ |
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h new file mode 100644 index 000000000000..c1f06289b14b --- /dev/null +++ b/arch/x86/include/asm/iomap.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Ingo Molnar | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/fs.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <linux/uaccess.h> | ||
22 | #include <asm/cacheflush.h> | ||
23 | #include <asm/pgtable.h> | ||
24 | #include <asm/tlbflush.h> | ||
25 | |||
26 | void * | ||
27 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | ||
28 | |||
29 | void | ||
30 | iounmap_atomic(void *kvaddr, enum km_type type); | ||
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 485bdf059ffb..07f1af494ca5 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -34,10 +34,14 @@ static inline void get_memcfg_numa(void) | |||
34 | 34 | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | 35 | extern int early_pfn_to_nid(unsigned long pfn); |
36 | 36 | ||
37 | extern void resume_map_numa_kva(pgd_t *pgd); | ||
38 | |||
37 | #else /* !CONFIG_NUMA */ | 39 | #else /* !CONFIG_NUMA */ |
38 | 40 | ||
39 | #define get_memcfg_numa get_memcfg_numa_flat | 41 | #define get_memcfg_numa get_memcfg_numa_flat |
40 | 42 | ||
43 | static inline void resume_map_numa_kva(pgd_t *pgd) {} | ||
44 | |||
41 | #endif /* CONFIG_NUMA */ | 45 | #endif /* CONFIG_NUMA */ |
42 | 46 | ||
43 | #ifdef CONFIG_DISCONTIGMEM | 47 | #ifdef CONFIG_DISCONTIGMEM |
diff --git a/arch/x86/include/asm/pci_64.h b/arch/x86/include/asm/pci_64.h index 5b28995d664e..d02d936840a3 100644 --- a/arch/x86/include/asm/pci_64.h +++ b/arch/x86/include/asm/pci_64.h | |||
@@ -34,8 +34,6 @@ extern void pci_iommu_alloc(void); | |||
34 | */ | 34 | */ |
35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | 35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
36 | 36 | ||
37 | #if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU) | ||
38 | |||
39 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | 37 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
40 | dma_addr_t ADDR_NAME; | 38 | dma_addr_t ADDR_NAME; |
41 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | 39 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ |
@@ -49,18 +47,6 @@ extern void pci_iommu_alloc(void); | |||
49 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | 47 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ |
50 | (((PTR)->LEN_NAME) = (VAL)) | 48 | (((PTR)->LEN_NAME) = (VAL)) |
51 | 49 | ||
52 | #else | ||
53 | /* No IOMMU */ | ||
54 | |||
55 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
56 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
57 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
58 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
59 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
60 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
61 | |||
62 | #endif | ||
63 | |||
64 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
65 | 51 | ||
66 | #endif /* _ASM_X86_PCI_64_H */ | 52 | #endif /* _ASM_X86_PCI_64_H */ |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 664f15280f14..f8cfd00db450 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h | |||
@@ -46,7 +46,7 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size) | |||
46 | return ret; | 46 | return ret; |
47 | case 10: | 47 | case 10: |
48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, | 48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, |
49 | ret, "q", "", "=r", 16); | 49 | ret, "q", "", "=r", 10); |
50 | if (unlikely(ret)) | 50 | if (unlikely(ret)) |
51 | return ret; | 51 | return ret; |
52 | __get_user_asm(*(u16 *)(8 + (char *)dst), | 52 | __get_user_asm(*(u16 *)(8 + (char *)dst), |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 834b2c1d89fb..d2e415e6666f 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -639,8 +639,8 @@ __SYSCALL(__NR_fallocate, sys_fallocate) | |||
639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | 639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) |
640 | #define __NR_timerfd_gettime 287 | 640 | #define __NR_timerfd_gettime 287 |
641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | 641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) |
642 | #define __NR_paccept 288 | 642 | #define __NR_accept4 288 |
643 | __SYSCALL(__NR_paccept, sys_paccept) | 643 | __SYSCALL(__NR_accept4, sys_accept4) |
644 | #define __NR_signalfd4 289 | 644 | #define __NR_signalfd4 289 |
645 | __SYSCALL(__NR_signalfd4, sys_signalfd4) | 645 | __SYSCALL(__NR_signalfd4, sys_signalfd4) |
646 | #define __NR_eventfd2 290 | 646 | #define __NR_eventfd2 290 |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index e489ff9cb3e2..b62a7667828e 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -41,7 +41,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o | |||
41 | obj-y += process.o | 41 | obj-y += process.o |
42 | obj-y += i387.o xsave.o | 42 | obj-y += i387.o xsave.o |
43 | obj-y += ptrace.o | 43 | obj-y += ptrace.o |
44 | obj-y += ds.o | 44 | obj-$(CONFIG_X86_DS) += ds.o |
45 | obj-$(CONFIG_X86_32) += tls.o | 45 | obj-$(CONFIG_X86_32) += tls.o |
46 | obj-$(CONFIG_IA32_EMULATION) += tls.o | 46 | obj-$(CONFIG_IA32_EMULATION) += tls.o |
47 | obj-y += step.o | 47 | obj-y += step.o |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 172e0dc4641e..d434a97a4c7f 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -538,7 +538,7 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom, | |||
538 | address >>= PAGE_SHIFT; | 538 | address >>= PAGE_SHIFT; |
539 | iommu_area_free(dom->bitmap, address, pages); | 539 | iommu_area_free(dom->bitmap, address, pages); |
540 | 540 | ||
541 | if (address + pages >= dom->next_bit) | 541 | if (address >= dom->next_bit) |
542 | dom->need_flush = true; | 542 | dom->need_flush = true; |
543 | } | 543 | } |
544 | 544 | ||
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 7685f0774a8f..1188b98e27ea 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -122,7 +122,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have | |||
122 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings | 122 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings |
123 | we find in ACPI */ | 123 | we find in ACPI */ |
124 | unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */ | 124 | unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */ |
125 | int amd_iommu_isolate; /* if 1, device isolation is enabled */ | 125 | int amd_iommu_isolate = 1; /* if 1, device isolation is enabled */ |
126 | bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ | 126 | bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ |
127 | 127 | ||
128 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the | 128 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the |
@@ -1214,7 +1214,9 @@ static int __init parse_amd_iommu_options(char *str) | |||
1214 | for (; *str; ++str) { | 1214 | for (; *str; ++str) { |
1215 | if (strncmp(str, "isolate", 7) == 0) | 1215 | if (strncmp(str, "isolate", 7) == 0) |
1216 | amd_iommu_isolate = 1; | 1216 | amd_iommu_isolate = 1; |
1217 | if (strncmp(str, "fullflush", 11) == 0) | 1217 | if (strncmp(str, "share", 5) == 0) |
1218 | amd_iommu_isolate = 0; | ||
1219 | if (strncmp(str, "fullflush", 9) == 0) | ||
1218 | amd_iommu_unmap_flush = true; | 1220 | amd_iommu_unmap_flush = true; |
1219 | } | 1221 | } |
1220 | 1222 | ||
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index 2b69994fd3a8..a2d1176c38ee 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
@@ -21,8 +21,6 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | 23 | ||
24 | #ifdef CONFIG_X86_DS | ||
25 | |||
26 | #include <asm/ds.h> | 24 | #include <asm/ds.h> |
27 | 25 | ||
28 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
@@ -211,14 +209,15 @@ static DEFINE_PER_CPU(struct ds_context *, system_context); | |||
211 | static inline struct ds_context *ds_get_context(struct task_struct *task) | 209 | static inline struct ds_context *ds_get_context(struct task_struct *task) |
212 | { | 210 | { |
213 | struct ds_context *context; | 211 | struct ds_context *context; |
212 | unsigned long irq; | ||
214 | 213 | ||
215 | spin_lock(&ds_lock); | 214 | spin_lock_irqsave(&ds_lock, irq); |
216 | 215 | ||
217 | context = (task ? task->thread.ds_ctx : this_system_context); | 216 | context = (task ? task->thread.ds_ctx : this_system_context); |
218 | if (context) | 217 | if (context) |
219 | context->count++; | 218 | context->count++; |
220 | 219 | ||
221 | spin_unlock(&ds_lock); | 220 | spin_unlock_irqrestore(&ds_lock, irq); |
222 | 221 | ||
223 | return context; | 222 | return context; |
224 | } | 223 | } |
@@ -226,18 +225,16 @@ static inline struct ds_context *ds_get_context(struct task_struct *task) | |||
226 | /* | 225 | /* |
227 | * Same as ds_get_context, but allocates the context and it's DS | 226 | * Same as ds_get_context, but allocates the context and it's DS |
228 | * structure, if necessary; returns NULL; if out of memory. | 227 | * structure, if necessary; returns NULL; if out of memory. |
229 | * | ||
230 | * pre: requires ds_lock to be held | ||
231 | */ | 228 | */ |
232 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) | 229 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) |
233 | { | 230 | { |
234 | struct ds_context **p_context = | 231 | struct ds_context **p_context = |
235 | (task ? &task->thread.ds_ctx : &this_system_context); | 232 | (task ? &task->thread.ds_ctx : &this_system_context); |
236 | struct ds_context *context = *p_context; | 233 | struct ds_context *context = *p_context; |
234 | unsigned long irq; | ||
237 | 235 | ||
238 | if (!context) { | 236 | if (!context) { |
239 | context = kzalloc(sizeof(*context), GFP_KERNEL); | 237 | context = kzalloc(sizeof(*context), GFP_KERNEL); |
240 | |||
241 | if (!context) | 238 | if (!context) |
242 | return NULL; | 239 | return NULL; |
243 | 240 | ||
@@ -247,18 +244,27 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task) | |||
247 | return NULL; | 244 | return NULL; |
248 | } | 245 | } |
249 | 246 | ||
250 | *p_context = context; | 247 | spin_lock_irqsave(&ds_lock, irq); |
251 | 248 | ||
252 | context->this = p_context; | 249 | if (*p_context) { |
253 | context->task = task; | 250 | kfree(context->ds); |
251 | kfree(context); | ||
252 | |||
253 | context = *p_context; | ||
254 | } else { | ||
255 | *p_context = context; | ||
254 | 256 | ||
255 | if (task) | 257 | context->this = p_context; |
256 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); | 258 | context->task = task; |
257 | 259 | ||
258 | if (!task || (task == current)) | 260 | if (task) |
259 | wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0); | 261 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); |
260 | 262 | ||
261 | get_tracer(task); | 263 | if (!task || (task == current)) |
264 | wrmsrl(MSR_IA32_DS_AREA, | ||
265 | (unsigned long)context->ds); | ||
266 | } | ||
267 | spin_unlock_irqrestore(&ds_lock, irq); | ||
262 | } | 268 | } |
263 | 269 | ||
264 | context->count++; | 270 | context->count++; |
@@ -272,10 +278,12 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task) | |||
272 | */ | 278 | */ |
273 | static inline void ds_put_context(struct ds_context *context) | 279 | static inline void ds_put_context(struct ds_context *context) |
274 | { | 280 | { |
281 | unsigned long irq; | ||
282 | |||
275 | if (!context) | 283 | if (!context) |
276 | return; | 284 | return; |
277 | 285 | ||
278 | spin_lock(&ds_lock); | 286 | spin_lock_irqsave(&ds_lock, irq); |
279 | 287 | ||
280 | if (--context->count) | 288 | if (--context->count) |
281 | goto out; | 289 | goto out; |
@@ -297,7 +305,7 @@ static inline void ds_put_context(struct ds_context *context) | |||
297 | kfree(context->ds); | 305 | kfree(context->ds); |
298 | kfree(context); | 306 | kfree(context); |
299 | out: | 307 | out: |
300 | spin_unlock(&ds_lock); | 308 | spin_unlock_irqrestore(&ds_lock, irq); |
301 | } | 309 | } |
302 | 310 | ||
303 | 311 | ||
@@ -368,6 +376,7 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
368 | struct ds_context *context; | 376 | struct ds_context *context; |
369 | unsigned long buffer, adj; | 377 | unsigned long buffer, adj; |
370 | const unsigned long alignment = (1 << 3); | 378 | const unsigned long alignment = (1 << 3); |
379 | unsigned long irq; | ||
371 | int error = 0; | 380 | int error = 0; |
372 | 381 | ||
373 | if (!ds_cfg.sizeof_ds) | 382 | if (!ds_cfg.sizeof_ds) |
@@ -382,25 +391,27 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
382 | return -EOPNOTSUPP; | 391 | return -EOPNOTSUPP; |
383 | 392 | ||
384 | 393 | ||
385 | spin_lock(&ds_lock); | ||
386 | |||
387 | if (!check_tracer(task)) | ||
388 | return -EPERM; | ||
389 | |||
390 | error = -ENOMEM; | ||
391 | context = ds_alloc_context(task); | 394 | context = ds_alloc_context(task); |
392 | if (!context) | 395 | if (!context) |
396 | return -ENOMEM; | ||
397 | |||
398 | spin_lock_irqsave(&ds_lock, irq); | ||
399 | |||
400 | error = -EPERM; | ||
401 | if (!check_tracer(task)) | ||
393 | goto out_unlock; | 402 | goto out_unlock; |
394 | 403 | ||
404 | get_tracer(task); | ||
405 | |||
395 | error = -EALREADY; | 406 | error = -EALREADY; |
396 | if (context->owner[qual] == current) | 407 | if (context->owner[qual] == current) |
397 | goto out_unlock; | 408 | goto out_put_tracer; |
398 | error = -EPERM; | 409 | error = -EPERM; |
399 | if (context->owner[qual] != NULL) | 410 | if (context->owner[qual] != NULL) |
400 | goto out_unlock; | 411 | goto out_put_tracer; |
401 | context->owner[qual] = current; | 412 | context->owner[qual] = current; |
402 | 413 | ||
403 | spin_unlock(&ds_lock); | 414 | spin_unlock_irqrestore(&ds_lock, irq); |
404 | 415 | ||
405 | 416 | ||
406 | error = -ENOMEM; | 417 | error = -ENOMEM; |
@@ -448,10 +459,17 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
448 | out_release: | 459 | out_release: |
449 | context->owner[qual] = NULL; | 460 | context->owner[qual] = NULL; |
450 | ds_put_context(context); | 461 | ds_put_context(context); |
462 | put_tracer(task); | ||
463 | return error; | ||
464 | |||
465 | out_put_tracer: | ||
466 | spin_unlock_irqrestore(&ds_lock, irq); | ||
467 | ds_put_context(context); | ||
468 | put_tracer(task); | ||
451 | return error; | 469 | return error; |
452 | 470 | ||
453 | out_unlock: | 471 | out_unlock: |
454 | spin_unlock(&ds_lock); | 472 | spin_unlock_irqrestore(&ds_lock, irq); |
455 | ds_put_context(context); | 473 | ds_put_context(context); |
456 | return error; | 474 | return error; |
457 | } | 475 | } |
@@ -801,13 +819,21 @@ static const struct ds_configuration ds_cfg_var = { | |||
801 | .sizeof_ds = sizeof(long) * 12, | 819 | .sizeof_ds = sizeof(long) * 12, |
802 | .sizeof_field = sizeof(long), | 820 | .sizeof_field = sizeof(long), |
803 | .sizeof_rec[ds_bts] = sizeof(long) * 3, | 821 | .sizeof_rec[ds_bts] = sizeof(long) * 3, |
822 | #ifdef __i386__ | ||
804 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 | 823 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 |
824 | #else | ||
825 | .sizeof_rec[ds_pebs] = sizeof(long) * 18 | ||
826 | #endif | ||
805 | }; | 827 | }; |
806 | static const struct ds_configuration ds_cfg_64 = { | 828 | static const struct ds_configuration ds_cfg_64 = { |
807 | .sizeof_ds = 8 * 12, | 829 | .sizeof_ds = 8 * 12, |
808 | .sizeof_field = 8, | 830 | .sizeof_field = 8, |
809 | .sizeof_rec[ds_bts] = 8 * 3, | 831 | .sizeof_rec[ds_bts] = 8 * 3, |
832 | #ifdef __i386__ | ||
810 | .sizeof_rec[ds_pebs] = 8 * 10 | 833 | .sizeof_rec[ds_pebs] = 8 * 10 |
834 | #else | ||
835 | .sizeof_rec[ds_pebs] = 8 * 18 | ||
836 | #endif | ||
811 | }; | 837 | }; |
812 | 838 | ||
813 | static inline void | 839 | static inline void |
@@ -861,4 +887,3 @@ void ds_free(struct ds_context *context) | |||
861 | while (leftovers--) | 887 | while (leftovers--) |
862 | ds_put_context(context); | 888 | ds_put_context(context); |
863 | } | 889 | } |
864 | #endif /* CONFIG_X86_DS */ | ||
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c index f454c78fcef6..0aa2c443d600 100644 --- a/arch/x86/kernel/es7000_32.c +++ b/arch/x86/kernel/es7000_32.c | |||
@@ -250,31 +250,24 @@ int __init find_unisys_acpi_oem_table(unsigned long *oem_addr) | |||
250 | { | 250 | { |
251 | struct acpi_table_header *header = NULL; | 251 | struct acpi_table_header *header = NULL; |
252 | int i = 0; | 252 | int i = 0; |
253 | acpi_size tbl_size; | ||
254 | 253 | ||
255 | while (ACPI_SUCCESS(acpi_get_table_with_size("OEM1", i++, &header, &tbl_size))) { | 254 | while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) { |
256 | if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) { | 255 | if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) { |
257 | struct oem_table *t = (struct oem_table *)header; | 256 | struct oem_table *t = (struct oem_table *)header; |
258 | 257 | ||
259 | oem_addrX = t->OEMTableAddr; | 258 | oem_addrX = t->OEMTableAddr; |
260 | oem_size = t->OEMTableSize; | 259 | oem_size = t->OEMTableSize; |
261 | early_acpi_os_unmap_memory(header, tbl_size); | ||
262 | 260 | ||
263 | *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, | 261 | *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, |
264 | oem_size); | 262 | oem_size); |
265 | return 0; | 263 | return 0; |
266 | } | 264 | } |
267 | early_acpi_os_unmap_memory(header, tbl_size); | ||
268 | } | 265 | } |
269 | return -1; | 266 | return -1; |
270 | } | 267 | } |
271 | 268 | ||
272 | void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr) | 269 | void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr) |
273 | { | 270 | { |
274 | if (!oem_addr) | ||
275 | return; | ||
276 | |||
277 | __acpi_unmap_table((char *)oem_addr, oem_size); | ||
278 | } | 271 | } |
279 | #endif | 272 | #endif |
280 | 273 | ||
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 1f20608d4ca8..b0f61f0dcd0a 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
@@ -58,7 +58,7 @@ void __cpuinit mxcsr_feature_mask_init(void) | |||
58 | stts(); | 58 | stts(); |
59 | } | 59 | } |
60 | 60 | ||
61 | void __init init_thread_xstate(void) | 61 | void __cpuinit init_thread_xstate(void) |
62 | { | 62 | { |
63 | if (!HAVE_HWFP) { | 63 | if (!HAVE_HWFP) { |
64 | xstate_size = sizeof(struct i387_soft_struct); | 64 | xstate_size = sizeof(struct i387_soft_struct); |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 7a3f2028e2eb..1fec0f9b1508 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -1140,6 +1140,20 @@ static void __clear_irq_vector(int irq) | |||
1140 | 1140 | ||
1141 | cfg->vector = 0; | 1141 | cfg->vector = 0; |
1142 | cpus_clear(cfg->domain); | 1142 | cpus_clear(cfg->domain); |
1143 | |||
1144 | if (likely(!cfg->move_in_progress)) | ||
1145 | return; | ||
1146 | cpus_and(mask, cfg->old_domain, cpu_online_map); | ||
1147 | for_each_cpu_mask_nr(cpu, mask) { | ||
1148 | for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; | ||
1149 | vector++) { | ||
1150 | if (per_cpu(vector_irq, cpu)[vector] != irq) | ||
1151 | continue; | ||
1152 | per_cpu(vector_irq, cpu)[vector] = -1; | ||
1153 | break; | ||
1154 | } | ||
1155 | } | ||
1156 | cfg->move_in_progress = 0; | ||
1143 | } | 1157 | } |
1144 | 1158 | ||
1145 | void __setup_vector_irq(int cpu) | 1159 | void __setup_vector_irq(int cpu) |
@@ -3594,27 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
3594 | 3608 | ||
3595 | int __init probe_nr_irqs(void) | 3609 | int __init probe_nr_irqs(void) |
3596 | { | 3610 | { |
3597 | int idx; | 3611 | return NR_IRQS; |
3598 | int nr = 0; | ||
3599 | #ifndef CONFIG_XEN | ||
3600 | int nr_min = 32; | ||
3601 | #else | ||
3602 | int nr_min = NR_IRQS; | ||
3603 | #endif | ||
3604 | |||
3605 | for (idx = 0; idx < nr_ioapics; idx++) | ||
3606 | nr += io_apic_get_redir_entries(idx) + 1; | ||
3607 | |||
3608 | /* double it for hotplug and msi and nmi */ | ||
3609 | nr <<= 1; | ||
3610 | |||
3611 | /* something wrong ? */ | ||
3612 | if (nr < nr_min) | ||
3613 | nr = nr_min; | ||
3614 | if (WARN_ON(nr > NR_IRQS)) | ||
3615 | nr = NR_IRQS; | ||
3616 | |||
3617 | return nr; | ||
3618 | } | 3612 | } |
3619 | 3613 | ||
3620 | /* -------------------------------------------------------------------------- | 3614 | /* -------------------------------------------------------------------------- |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index e1e731d78f38..d28bbdc35e4e 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1567,7 +1567,7 @@ static int __init calgary_parse_options(char *p) | |||
1567 | ++p; | 1567 | ++p; |
1568 | if (*p == '\0') | 1568 | if (*p == '\0') |
1569 | break; | 1569 | break; |
1570 | bridge = simple_strtol(p, &endp, 0); | 1570 | bridge = simple_strtoul(p, &endp, 0); |
1571 | if (p == endp) | 1571 | if (p == endp) |
1572 | break; | 1572 | break; |
1573 | 1573 | ||
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 724adfc63cb9..cc5a2545dd41 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -169,6 +169,15 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
169 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), | 169 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), |
170 | }, | 170 | }, |
171 | }, | 171 | }, |
172 | { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ | ||
173 | .callback = set_bios_reboot, | ||
174 | .ident = "Dell OptiPlex 330", | ||
175 | .matches = { | ||
176 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
177 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), | ||
178 | DMI_MATCH(DMI_BOARD_NAME, "0KP561"), | ||
179 | }, | ||
180 | }, | ||
172 | { /* Handle problems with rebooting on Dell 2400's */ | 181 | { /* Handle problems with rebooting on Dell 2400's */ |
173 | .callback = set_bios_reboot, | 182 | .callback = set_bios_reboot, |
174 | .ident = "Dell PowerEdge 2400", | 183 | .ident = "Dell PowerEdge 2400", |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 67d5979e654e..decb492134c3 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -765,7 +765,7 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = { | |||
765 | .callback = dmi_low_memory_corruption, | 765 | .callback = dmi_low_memory_corruption, |
766 | .ident = "Phoenix BIOS", | 766 | .ident = "Phoenix BIOS", |
767 | .matches = { | 767 | .matches = { |
768 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), | 768 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), |
769 | }, | 769 | }, |
770 | }, | 770 | }, |
771 | #endif | 771 | #endif |
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 9ffb01c31c40..1c0dfbca87c1 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c | |||
@@ -46,7 +46,9 @@ static __cpuinit void check_tsc_warp(void) | |||
46 | cycles_t start, now, prev, end; | 46 | cycles_t start, now, prev, end; |
47 | int i; | 47 | int i; |
48 | 48 | ||
49 | rdtsc_barrier(); | ||
49 | start = get_cycles(); | 50 | start = get_cycles(); |
51 | rdtsc_barrier(); | ||
50 | /* | 52 | /* |
51 | * The measurement runs for 20 msecs: | 53 | * The measurement runs for 20 msecs: |
52 | */ | 54 | */ |
@@ -61,7 +63,9 @@ static __cpuinit void check_tsc_warp(void) | |||
61 | */ | 63 | */ |
62 | __raw_spin_lock(&sync_lock); | 64 | __raw_spin_lock(&sync_lock); |
63 | prev = last_tsc; | 65 | prev = last_tsc; |
66 | rdtsc_barrier(); | ||
64 | now = get_cycles(); | 67 | now = get_cycles(); |
68 | rdtsc_barrier(); | ||
65 | last_tsc = now; | 69 | last_tsc = now; |
66 | __raw_spin_unlock(&sync_lock); | 70 | __raw_spin_unlock(&sync_lock); |
67 | 71 | ||
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index b13acb75e822..15c3e6999182 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c | |||
@@ -310,7 +310,7 @@ static void __init setup_xstate_init(void) | |||
310 | /* | 310 | /* |
311 | * Enable and initialize the xsave feature. | 311 | * Enable and initialize the xsave feature. |
312 | */ | 312 | */ |
313 | void __init xsave_cntxt_init(void) | 313 | void __ref xsave_cntxt_init(void) |
314 | { | 314 | { |
315 | unsigned int eax, ebx, ecx, edx; | 315 | unsigned int eax, ebx, ecx, edx; |
316 | 316 | ||
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 0e331652681e..52145007bd7e 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * This file provides all the same external entries as smp.c but uses | 7 | * This file provides all the same external entries as smp.c but uses |
8 | * the voyager hal to provide the functionality | 8 | * the voyager hal to provide the functionality |
9 | */ | 9 | */ |
10 | #include <linux/cpu.h> | ||
10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | #include <linux/kernel_stat.h> | 13 | #include <linux/kernel_stat.h> |
@@ -1790,6 +1791,17 @@ void __init smp_setup_processor_id(void) | |||
1790 | x86_write_percpu(cpu_number, hard_smp_processor_id()); | 1791 | x86_write_percpu(cpu_number, hard_smp_processor_id()); |
1791 | } | 1792 | } |
1792 | 1793 | ||
1794 | static void voyager_send_call_func(cpumask_t callmask) | ||
1795 | { | ||
1796 | __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id()); | ||
1797 | send_CPI(mask, VIC_CALL_FUNCTION_CPI); | ||
1798 | } | ||
1799 | |||
1800 | static void voyager_send_call_func_single(int cpu) | ||
1801 | { | ||
1802 | send_CPI(1 << cpu, VIC_CALL_FUNCTION_SINGLE_CPI); | ||
1803 | } | ||
1804 | |||
1793 | struct smp_ops smp_ops = { | 1805 | struct smp_ops smp_ops = { |
1794 | .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu, | 1806 | .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu, |
1795 | .smp_prepare_cpus = voyager_smp_prepare_cpus, | 1807 | .smp_prepare_cpus = voyager_smp_prepare_cpus, |
@@ -1799,6 +1811,6 @@ struct smp_ops smp_ops = { | |||
1799 | .smp_send_stop = voyager_smp_send_stop, | 1811 | .smp_send_stop = voyager_smp_send_stop, |
1800 | .smp_send_reschedule = voyager_smp_send_reschedule, | 1812 | .smp_send_reschedule = voyager_smp_send_reschedule, |
1801 | 1813 | ||
1802 | .send_call_func_ipi = native_send_call_func_ipi, | 1814 | .send_call_func_ipi = voyager_send_call_func, |
1803 | .send_call_func_single_ipi = native_send_call_func_single_ipi, | 1815 | .send_call_func_single_ipi = voyager_send_call_func_single, |
1804 | }; | 1816 | }; |
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c index 847c164725f4..8518c678d83f 100644 --- a/arch/x86/mm/numa_32.c +++ b/arch/x86/mm/numa_32.c | |||
@@ -222,6 +222,41 @@ static void __init remap_numa_kva(void) | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | #ifdef CONFIG_HIBERNATION | ||
226 | /** | ||
227 | * resume_map_numa_kva - add KVA mapping to the temporary page tables created | ||
228 | * during resume from hibernation | ||
229 | * @pgd_base - temporary resume page directory | ||
230 | */ | ||
231 | void resume_map_numa_kva(pgd_t *pgd_base) | ||
232 | { | ||
233 | int node; | ||
234 | |||
235 | for_each_online_node(node) { | ||
236 | unsigned long start_va, start_pfn, size, pfn; | ||
237 | |||
238 | start_va = (unsigned long)node_remap_start_vaddr[node]; | ||
239 | start_pfn = node_remap_start_pfn[node]; | ||
240 | size = node_remap_size[node]; | ||
241 | |||
242 | printk(KERN_DEBUG "%s: node %d\n", __FUNCTION__, node); | ||
243 | |||
244 | for (pfn = 0; pfn < size; pfn += PTRS_PER_PTE) { | ||
245 | unsigned long vaddr = start_va + (pfn << PAGE_SHIFT); | ||
246 | pgd_t *pgd = pgd_base + pgd_index(vaddr); | ||
247 | pud_t *pud = pud_offset(pgd, vaddr); | ||
248 | pmd_t *pmd = pmd_offset(pud, vaddr); | ||
249 | |||
250 | set_pmd(pmd, pfn_pmd(start_pfn + pfn, | ||
251 | PAGE_KERNEL_LARGE_EXEC)); | ||
252 | |||
253 | printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n", | ||
254 | __FUNCTION__, vaddr, start_pfn + pfn); | ||
255 | } | ||
256 | } | ||
257 | } | ||
258 | #endif | ||
259 | |||
225 | static unsigned long calculate_numa_remap_pages(void) | 260 | static unsigned long calculate_numa_remap_pages(void) |
226 | { | 261 | { |
227 | int nid; | 262 | int nid; |
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 3f1b81a83e2e..716d26f0e5d4 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -69,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
69 | int i; | 69 | int i; |
70 | 70 | ||
71 | if (!reset_value) { | 71 | if (!reset_value) { |
72 | reset_value = kmalloc(sizeof(unsigned) * num_counters, | 72 | reset_value = kmalloc(sizeof(reset_value[0]) * num_counters, |
73 | GFP_ATOMIC); | 73 | GFP_ATOMIC); |
74 | if (!reset_value) | 74 | if (!reset_value) |
75 | return; | 75 | return; |
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 3c27a809393b..2051dc96b8e9 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -496,21 +496,24 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015, | |||
496 | pci_siemens_interrupt_controller); | 496 | pci_siemens_interrupt_controller); |
497 | 497 | ||
498 | /* | 498 | /* |
499 | * Regular PCI devices have 256 bytes, but AMD Family 10h Opteron ext config | 499 | * Regular PCI devices have 256 bytes, but AMD Family 10h/11h CPUs have |
500 | * have 4096 bytes. Even if the device is capable, that doesn't mean we can | 500 | * 4096 bytes configuration space for each function of their processor |
501 | * access it. Maybe we don't have a way to generate extended config space | 501 | * configuration space. |
502 | * accesses. So check it | ||
503 | */ | 502 | */ |
504 | static void fam10h_pci_cfg_space_size(struct pci_dev *dev) | 503 | static void amd_cpu_pci_cfg_space_size(struct pci_dev *dev) |
505 | { | 504 | { |
506 | dev->cfg_size = pci_cfg_space_size_ext(dev); | 505 | dev->cfg_size = pci_cfg_space_size_ext(dev); |
507 | } | 506 | } |
508 | 507 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, amd_cpu_pci_cfg_space_size); | |
509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, fam10h_pci_cfg_space_size); | 508 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, amd_cpu_pci_cfg_space_size); |
510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size); | 509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, amd_cpu_pci_cfg_space_size); |
511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size); | 510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, amd_cpu_pci_cfg_space_size); |
512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size); | 511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, amd_cpu_pci_cfg_space_size); |
513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size); | 512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1300, amd_cpu_pci_cfg_space_size); |
513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1301, amd_cpu_pci_cfg_space_size); | ||
514 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1302, amd_cpu_pci_cfg_space_size); | ||
515 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1303, amd_cpu_pci_cfg_space_size); | ||
516 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1304, amd_cpu_pci_cfg_space_size); | ||
514 | 517 | ||
515 | /* | 518 | /* |
516 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from | 519 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from |
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c index f2b6e3f11bfc..81197c62d5b3 100644 --- a/arch/x86/power/hibernate_32.c +++ b/arch/x86/power/hibernate_32.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | #include <asm/pgtable.h> | 14 | #include <asm/pgtable.h> |
15 | #include <asm/mmzone.h> | ||
15 | 16 | ||
16 | /* Defined in hibernate_asm_32.S */ | 17 | /* Defined in hibernate_asm_32.S */ |
17 | extern int restore_image(void); | 18 | extern int restore_image(void); |
@@ -127,6 +128,9 @@ static int resume_physical_mapping_init(pgd_t *pgd_base) | |||
127 | } | 128 | } |
128 | } | 129 | } |
129 | } | 130 | } |
131 | |||
132 | resume_map_numa_kva(pgd_base); | ||
133 | |||
130 | return 0; | 134 | return 0; |
131 | } | 135 | } |
132 | 136 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 688936044dc9..636ef4caa52d 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -661,12 +661,11 @@ void xen_set_pgd(pgd_t *ptr, pgd_t val) | |||
661 | * For 64-bit, we must skip the Xen hole in the middle of the address | 661 | * For 64-bit, we must skip the Xen hole in the middle of the address |
662 | * space, just after the big x86-64 virtual hole. | 662 | * space, just after the big x86-64 virtual hole. |
663 | */ | 663 | */ |
664 | static int xen_pgd_walk(struct mm_struct *mm, | 664 | static int __xen_pgd_walk(struct mm_struct *mm, pgd_t *pgd, |
665 | int (*func)(struct mm_struct *mm, struct page *, | 665 | int (*func)(struct mm_struct *mm, struct page *, |
666 | enum pt_level), | 666 | enum pt_level), |
667 | unsigned long limit) | 667 | unsigned long limit) |
668 | { | 668 | { |
669 | pgd_t *pgd = mm->pgd; | ||
670 | int flush = 0; | 669 | int flush = 0; |
671 | unsigned hole_low, hole_high; | 670 | unsigned hole_low, hole_high; |
672 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; | 671 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; |
@@ -753,6 +752,14 @@ out: | |||
753 | return flush; | 752 | return flush; |
754 | } | 753 | } |
755 | 754 | ||
755 | static int xen_pgd_walk(struct mm_struct *mm, | ||
756 | int (*func)(struct mm_struct *mm, struct page *, | ||
757 | enum pt_level), | ||
758 | unsigned long limit) | ||
759 | { | ||
760 | return __xen_pgd_walk(mm, mm->pgd, func, limit); | ||
761 | } | ||
762 | |||
756 | /* If we're using split pte locks, then take the page's lock and | 763 | /* If we're using split pte locks, then take the page's lock and |
757 | return a pointer to it. Otherwise return NULL. */ | 764 | return a pointer to it. Otherwise return NULL. */ |
758 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) | 765 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) |
@@ -854,7 +861,7 @@ static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | |||
854 | 861 | ||
855 | xen_mc_batch(); | 862 | xen_mc_batch(); |
856 | 863 | ||
857 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { | 864 | if (__xen_pgd_walk(mm, pgd, xen_pin_page, USER_LIMIT)) { |
858 | /* re-enable interrupts for flushing */ | 865 | /* re-enable interrupts for flushing */ |
859 | xen_mc_issue(0); | 866 | xen_mc_issue(0); |
860 | 867 | ||
@@ -998,7 +1005,7 @@ static void __xen_pgd_unpin(struct mm_struct *mm, pgd_t *pgd) | |||
998 | PT_PMD); | 1005 | PT_PMD); |
999 | #endif | 1006 | #endif |
1000 | 1007 | ||
1001 | xen_pgd_walk(mm, xen_unpin_page, USER_LIMIT); | 1008 | __xen_pgd_walk(mm, pgd, xen_unpin_page, USER_LIMIT); |
1002 | 1009 | ||
1003 | xen_mc_issue(0); | 1010 | xen_mc_issue(0); |
1004 | } | 1011 | } |