Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1324 - genpatches-2.6/trunk/2.6.25
Date: Wed, 25 Jun 2008 01:32:48
Message-Id: E1KBJsH-0006W3-3j@stork.gentoo.org
1 Author: mpagano
2 Date: 2008-06-25 01:32:40 +0000 (Wed, 25 Jun 2008)
3 New Revision: 1324
4
5 Added:
6 genpatches-2.6/trunk/2.6.25/1008_linux-2.6.25.9.patch
7 Modified:
8 genpatches-2.6/trunk/2.6.25/0000_README
9 Log:
10 Linux 2.6.25.9
11
12 Modified: genpatches-2.6/trunk/2.6.25/0000_README
13 ===================================================================
14 --- genpatches-2.6/trunk/2.6.25/0000_README 2008-06-23 19:48:07 UTC (rev 1323)
15 +++ genpatches-2.6/trunk/2.6.25/0000_README 2008-06-25 01:32:40 UTC (rev 1324)
16 @@ -71,6 +71,10 @@
17 From: http://www.kernel.org
18 Desc: Linux 2.6.25.8
19
20 +Patch: 1008_linux-2.6.25.9.patch
21 +From: http://www.kernel.org
22 +Desc: Linux 2.6.25.9
23 +
24 Patch: 2705_alsa-hda-fujitsu.patch
25 From: Tony Vroon <chainsaw@g.o>
26 Desc: Fix docking station headphone port and PC speaker for Fujitsu ALC262
27
28 Added: genpatches-2.6/trunk/2.6.25/1008_linux-2.6.25.9.patch
29 ===================================================================
30 --- genpatches-2.6/trunk/2.6.25/1008_linux-2.6.25.9.patch (rev 0)
31 +++ genpatches-2.6/trunk/2.6.25/1008_linux-2.6.25.9.patch 2008-06-25 01:32:40 UTC (rev 1324)
32 @@ -0,0 +1,426 @@
33 +diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
34 +index d3437c4..e3b2185 100644
35 +--- a/arch/powerpc/kernel/vdso.c
36 ++++ b/arch/powerpc/kernel/vdso.c
37 +@@ -141,7 +141,7 @@ static void dump_one_vdso_page(struct page *pg, struct page *upg)
38 + printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT),
39 + page_count(pg),
40 + pg->flags);
41 +- if (upg/* && pg != upg*/) {
42 ++ if (upg && !IS_ERR(upg) /* && pg != upg*/) {
43 + printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg)
44 + << PAGE_SHIFT),
45 + page_count(upg),
46 +diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
47 +index 2b3e5d4..9ac056b 100644
48 +--- a/arch/x86/kernel/setup_32.c
49 ++++ b/arch/x86/kernel/setup_32.c
50 +@@ -483,10 +483,16 @@ static void __init reserve_crashkernel(void)
51 + (unsigned long)(crash_size >> 20),
52 + (unsigned long)(crash_base >> 20),
53 + (unsigned long)(total_mem >> 20));
54 ++
55 ++ if (reserve_bootmem(crash_base, crash_size,
56 ++ BOOTMEM_EXCLUSIVE) < 0) {
57 ++ printk(KERN_INFO "crashkernel reservation "
58 ++ "failed - memory is in use\n");
59 ++ return;
60 ++ }
61 ++
62 + crashk_res.start = crash_base;
63 + crashk_res.end = crash_base + crash_size - 1;
64 +- reserve_bootmem(crash_base, crash_size,
65 +- BOOTMEM_DEFAULT);
66 + } else
67 + printk(KERN_INFO "crashkernel reservation failed - "
68 + "you have to specify a base address\n");
69 +diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
70 +index 9587869..8396e0f 100644
71 +--- a/drivers/hwmon/adt7473.c
72 ++++ b/drivers/hwmon/adt7473.c
73 +@@ -309,6 +309,9 @@ no_sensor_update:
74 + ADT7473_REG_PWM_BHVR(i));
75 + }
76 +
77 ++ i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
78 ++ data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT);
79 ++
80 + data->limits_last_updated = local_jiffies;
81 + data->limits_valid = 1;
82 +
83 +diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
84 +index 182fe6a..30bdd50 100644
85 +--- a/drivers/hwmon/lm85.c
86 ++++ b/drivers/hwmon/lm85.c
87 +@@ -192,7 +192,7 @@ static int RANGE_TO_REG( int range )
88 + {
89 + int i;
90 +
91 +- if ( range < lm85_range_map[0] ) {
92 ++ if (range <= lm85_range_map[0]) {
93 + return 0 ;
94 + } else if ( range > lm85_range_map[15] ) {
95 + return 15 ;
96 +diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c
97 +index 9d3bd22..a965f68 100644
98 +--- a/drivers/net/atl1/atl1_hw.c
99 ++++ b/drivers/net/atl1/atl1_hw.c
100 +@@ -250,7 +250,6 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
101 + memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
102 + return 0;
103 + }
104 +- return 1;
105 + }
106 +
107 + /* see if SPI FLAGS exist ? */
108 +diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
109 +index 6483d10..2b756ef 100644
110 +--- a/drivers/watchdog/hpwdt.c
111 ++++ b/drivers/watchdog/hpwdt.c
112 +@@ -140,49 +140,52 @@ static struct pci_device_id hpwdt_devices[] = {
113 + };
114 + MODULE_DEVICE_TABLE(pci, hpwdt_devices);
115 +
116 ++extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs, unsigned long *pRomEntry);
117 ++
118 + #ifndef CONFIG_X86_64
119 + /* --32 Bit Bios------------------------------------------------------------ */
120 +
121 + #define HPWDT_ARCH 32
122 +
123 +-static void asminline_call(struct cmn_registers *pi86Regs,
124 +- unsigned long *pRomEntry)
125 +-{
126 +- asm("pushl %ebp \n\t"
127 +- "movl %esp, %ebp \n\t"
128 +- "pusha \n\t"
129 +- "pushf \n\t"
130 +- "push %es \n\t"
131 +- "push %ds \n\t"
132 +- "pop %es \n\t"
133 +- "movl 8(%ebp),%eax \n\t"
134 +- "movl 4(%eax),%ebx \n\t"
135 +- "movl 8(%eax),%ecx \n\t"
136 +- "movl 12(%eax),%edx \n\t"
137 +- "movl 16(%eax),%esi \n\t"
138 +- "movl 20(%eax),%edi \n\t"
139 +- "movl (%eax),%eax \n\t"
140 +- "push %cs \n\t"
141 +- "call *12(%ebp) \n\t"
142 +- "pushf \n\t"
143 +- "pushl %eax \n\t"
144 +- "movl 8(%ebp),%eax \n\t"
145 +- "movl %ebx,4(%eax) \n\t"
146 +- "movl %ecx,8(%eax) \n\t"
147 +- "movl %edx,12(%eax) \n\t"
148 +- "movl %esi,16(%eax) \n\t"
149 +- "movl %edi,20(%eax) \n\t"
150 +- "movw %ds,24(%eax) \n\t"
151 +- "movw %es,26(%eax) \n\t"
152 +- "popl %ebx \n\t"
153 +- "movl %ebx,(%eax) \n\t"
154 +- "popl %ebx \n\t"
155 +- "movl %ebx,28(%eax) \n\t"
156 +- "pop %es \n\t"
157 +- "popf \n\t"
158 +- "popa \n\t"
159 +- "leave \n\t" "ret");
160 +-}
161 ++asm(".text \n\t"
162 ++ ".align 4 \n"
163 ++ "asminline_call: \n\t"
164 ++ "pushl %ebp \n\t"
165 ++ "movl %esp, %ebp \n\t"
166 ++ "pusha \n\t"
167 ++ "pushf \n\t"
168 ++ "push %es \n\t"
169 ++ "push %ds \n\t"
170 ++ "pop %es \n\t"
171 ++ "movl 8(%ebp),%eax \n\t"
172 ++ "movl 4(%eax),%ebx \n\t"
173 ++ "movl 8(%eax),%ecx \n\t"
174 ++ "movl 12(%eax),%edx \n\t"
175 ++ "movl 16(%eax),%esi \n\t"
176 ++ "movl 20(%eax),%edi \n\t"
177 ++ "movl (%eax),%eax \n\t"
178 ++ "push %cs \n\t"
179 ++ "call *12(%ebp) \n\t"
180 ++ "pushf \n\t"
181 ++ "pushl %eax \n\t"
182 ++ "movl 8(%ebp),%eax \n\t"
183 ++ "movl %ebx,4(%eax) \n\t"
184 ++ "movl %ecx,8(%eax) \n\t"
185 ++ "movl %edx,12(%eax) \n\t"
186 ++ "movl %esi,16(%eax) \n\t"
187 ++ "movl %edi,20(%eax) \n\t"
188 ++ "movw %ds,24(%eax) \n\t"
189 ++ "movw %es,26(%eax) \n\t"
190 ++ "popl %ebx \n\t"
191 ++ "movl %ebx,(%eax) \n\t"
192 ++ "popl %ebx \n\t"
193 ++ "movl %ebx,28(%eax) \n\t"
194 ++ "pop %es \n\t"
195 ++ "popf \n\t"
196 ++ "popa \n\t"
197 ++ "leave \n\t"
198 ++ "ret \n\t"
199 ++ ".previous");
200 +
201 + /*
202 + * cru_detect
203 +@@ -333,43 +336,44 @@ static int __devinit detect_cru_service(void)
204 +
205 + #define HPWDT_ARCH 64
206 +
207 +-static void asminline_call(struct cmn_registers *pi86Regs,
208 +- unsigned long *pRomEntry)
209 +-{
210 +- asm("pushq %rbp \n\t"
211 +- "movq %rsp, %rbp \n\t"
212 +- "pushq %rax \n\t"
213 +- "pushq %rbx \n\t"
214 +- "pushq %rdx \n\t"
215 +- "pushq %r12 \n\t"
216 +- "pushq %r9 \n\t"
217 +- "movq %rsi, %r12 \n\t"
218 +- "movq %rdi, %r9 \n\t"
219 +- "movl 4(%r9),%ebx \n\t"
220 +- "movl 8(%r9),%ecx \n\t"
221 +- "movl 12(%r9),%edx \n\t"
222 +- "movl 16(%r9),%esi \n\t"
223 +- "movl 20(%r9),%edi \n\t"
224 +- "movl (%r9),%eax \n\t"
225 +- "call *%r12 \n\t"
226 +- "pushfq \n\t"
227 +- "popq %r12 \n\t"
228 +- "popfq \n\t"
229 +- "movl %eax, (%r9) \n\t"
230 +- "movl %ebx, 4(%r9) \n\t"
231 +- "movl %ecx, 8(%r9) \n\t"
232 +- "movl %edx, 12(%r9) \n\t"
233 +- "movl %esi, 16(%r9) \n\t"
234 +- "movl %edi, 20(%r9) \n\t"
235 +- "movq %r12, %rax \n\t"
236 +- "movl %eax, 28(%r9) \n\t"
237 +- "popq %r9 \n\t"
238 +- "popq %r12 \n\t"
239 +- "popq %rdx \n\t"
240 +- "popq %rbx \n\t"
241 +- "popq %rax \n\t"
242 +- "leave \n\t" "ret");
243 +-}
244 ++asm(".text \n\t"
245 ++ ".align 4 \n"
246 ++ "asminline_call: \n\t"
247 ++ "pushq %rbp \n\t"
248 ++ "movq %rsp, %rbp \n\t"
249 ++ "pushq %rax \n\t"
250 ++ "pushq %rbx \n\t"
251 ++ "pushq %rdx \n\t"
252 ++ "pushq %r12 \n\t"
253 ++ "pushq %r9 \n\t"
254 ++ "movq %rsi, %r12 \n\t"
255 ++ "movq %rdi, %r9 \n\t"
256 ++ "movl 4(%r9),%ebx \n\t"
257 ++ "movl 8(%r9),%ecx \n\t"
258 ++ "movl 12(%r9),%edx \n\t"
259 ++ "movl 16(%r9),%esi \n\t"
260 ++ "movl 20(%r9),%edi \n\t"
261 ++ "movl (%r9),%eax \n\t"
262 ++ "call *%r12 \n\t"
263 ++ "pushfq \n\t"
264 ++ "popq %r12 \n\t"
265 ++ "popfq \n\t"
266 ++ "movl %eax, (%r9) \n\t"
267 ++ "movl %ebx, 4(%r9) \n\t"
268 ++ "movl %ecx, 8(%r9) \n\t"
269 ++ "movl %edx, 12(%r9) \n\t"
270 ++ "movl %esi, 16(%r9) \n\t"
271 ++ "movl %edi, 20(%r9) \n\t"
272 ++ "movq %r12, %rax \n\t"
273 ++ "movl %eax, 28(%r9) \n\t"
274 ++ "popq %r9 \n\t"
275 ++ "popq %r12 \n\t"
276 ++ "popq %rdx \n\t"
277 ++ "popq %rbx \n\t"
278 ++ "popq %rax \n\t"
279 ++ "leave \n\t"
280 ++ "ret \n\t"
281 ++ ".previous");
282 +
283 + /*
284 + * dmi_find_cru
285 +diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h
286 +index 5f7257f..8f8085b 100644
287 +--- a/include/asm-x86/page_32.h
288 ++++ b/include/asm-x86/page_32.h
289 +@@ -14,7 +14,8 @@
290 + #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
291 +
292 + #ifdef CONFIG_X86_PAE
293 +-#define __PHYSICAL_MASK_SHIFT 36
294 ++/* 44=32+12, the limit we can fit into an unsigned long pfn */
295 ++#define __PHYSICAL_MASK_SHIFT 44
296 + #define __VIRTUAL_MASK_SHIFT 32
297 + #define PAGETABLE_LEVELS 3
298 +
299 +diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
300 +index 4e4e340..db3d837 100644
301 +--- a/include/linux/bootmem.h
302 ++++ b/include/linux/bootmem.h
303 +@@ -94,7 +94,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
304 + unsigned long freepfn,
305 + unsigned long startpfn,
306 + unsigned long endpfn);
307 +-extern void reserve_bootmem_node(pg_data_t *pgdat,
308 ++extern int reserve_bootmem_node(pg_data_t *pgdat,
309 + unsigned long physaddr,
310 + unsigned long size,
311 + int flags);
312 +diff --git a/mm/bootmem.c b/mm/bootmem.c
313 +index 2ccea70..8bb58da 100644
314 +--- a/mm/bootmem.c
315 ++++ b/mm/bootmem.c
316 +@@ -398,10 +398,10 @@ unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
317 + return init_bootmem_core(pgdat, freepfn, startpfn, endpfn);
318 + }
319 +
320 +-void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
321 ++int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
322 + unsigned long size, int flags)
323 + {
324 +- reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
325 ++ return reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
326 + }
327 +
328 + void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
329 +diff --git a/mm/memory.c b/mm/memory.c
330 +index 0d14d1e..df84668 100644
331 +--- a/mm/memory.c
332 ++++ b/mm/memory.c
333 +@@ -943,17 +943,15 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
334 + }
335 +
336 + ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
337 +- if (!ptep)
338 +- goto out;
339 +
340 + pte = *ptep;
341 + if (!pte_present(pte))
342 +- goto unlock;
343 ++ goto no_page;
344 + if ((flags & FOLL_WRITE) && !pte_write(pte))
345 + goto unlock;
346 + page = vm_normal_page(vma, address, pte);
347 + if (unlikely(!page))
348 +- goto unlock;
349 ++ goto bad_page;
350 +
351 + if (flags & FOLL_GET)
352 + get_page(page);
353 +@@ -968,6 +966,15 @@ unlock:
354 + out:
355 + return page;
356 +
357 ++bad_page:
358 ++ pte_unmap_unlock(ptep, ptl);
359 ++ return ERR_PTR(-EFAULT);
360 ++
361 ++no_page:
362 ++ pte_unmap_unlock(ptep, ptl);
363 ++ if (!pte_none(pte))
364 ++ return page;
365 ++ /* Fall through to ZERO_PAGE handling */
366 + no_page_table:
367 + /*
368 + * When core dumping an enormous anonymous area that nobody
369 +@@ -982,6 +989,26 @@ no_page_table:
370 + return page;
371 + }
372 +
373 ++/* Can we do the FOLL_ANON optimization? */
374 ++static inline int use_zero_page(struct vm_area_struct *vma)
375 ++{
376 ++ /*
377 ++ * We don't want to optimize FOLL_ANON for make_pages_present()
378 ++ * when it tries to page in a VM_LOCKED region. As to VM_SHARED,
379 ++ * we want to get the page from the page tables to make sure
380 ++ * that we serialize and update with any other user of that
381 ++ * mapping.
382 ++ */
383 ++ if (vma->vm_flags & (VM_LOCKED | VM_SHARED))
384 ++ return 0;
385 ++ /*
386 ++ * And if we have a fault or a nopfn routine, it's not an
387 ++ * anonymous region.
388 ++ */
389 ++ return !vma->vm_ops ||
390 ++ (!vma->vm_ops->fault && !vma->vm_ops->nopfn);
391 ++}
392 ++
393 + int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
394 + unsigned long start, int len, int write, int force,
395 + struct page **pages, struct vm_area_struct **vmas)
396 +@@ -1056,9 +1083,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
397 + foll_flags = FOLL_TOUCH;
398 + if (pages)
399 + foll_flags |= FOLL_GET;
400 +- if (!write && !(vma->vm_flags & VM_LOCKED) &&
401 +- (!vma->vm_ops || (!vma->vm_ops->nopage &&
402 +- !vma->vm_ops->fault)))
403 ++ if (!write && use_zero_page(vma))
404 + foll_flags |= FOLL_ANON;
405 +
406 + do {
407 +@@ -1104,6 +1129,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
408 +
409 + cond_resched();
410 + }
411 ++ if (IS_ERR(page))
412 ++ return i ? i : PTR_ERR(page);
413 + if (pages) {
414 + pages[i] = page;
415 +
416 +diff --git a/mm/migrate.c b/mm/migrate.c
417 +index 4e0eccc..6acc815 100644
418 +--- a/mm/migrate.c
419 ++++ b/mm/migrate.c
420 +@@ -858,6 +858,11 @@ static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm,
421 + goto set_status;
422 +
423 + page = follow_page(vma, pp->addr, FOLL_GET);
424 ++
425 ++ err = PTR_ERR(page);
426 ++ if (IS_ERR(page))
427 ++ goto set_status;
428 ++
429 + err = -ENOENT;
430 + if (!page)
431 + goto set_status;
432 +@@ -921,6 +926,11 @@ static int do_pages_stat(struct mm_struct *mm, struct page_to_node *pm)
433 + goto set_status;
434 +
435 + page = follow_page(vma, pm->addr, 0);
436 ++
437 ++ err = PTR_ERR(page);
438 ++ if (IS_ERR(page))
439 ++ goto set_status;
440 ++
441 + err = -ENOENT;
442 + /* Use PageReserved to check for zero page */
443 + if (!page || PageReserved(page))
444 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
445 +index 998e63a..2d42260 100644
446 +--- a/net/sctp/socket.c
447 ++++ b/net/sctp/socket.c
448 +@@ -4421,7 +4421,9 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
449 + if (copy_from_user(&getaddrs, optval, len))
450 + return -EFAULT;
451 +
452 +- if (getaddrs.addr_num <= 0) return -EINVAL;
453 ++ if (getaddrs.addr_num <= 0 ||
454 ++ getaddrs.addr_num >= (INT_MAX / sizeof(union sctp_addr)))
455 ++ return -EINVAL;
456 + /*
457 + * For UDP-style sockets, id specifies the association to query.
458 + * If the id field is set to the value '0' then the locally bound
459
460 --
461 gentoo-commits@l.g.o mailing list