History

Merge branch 'parisc-4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller: "We have one important patch from Dave Anglin and myself which fixes PTE/TLB race conditions which caused random segmentation faults on our debian buildd servers, and one patch from Alex Ivanov which speeds up the graphical text console on the STI framebuffer driver" * 'parisc-4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix some PTE/TLB race conditions and optimize __flush_tlb_range based on timing results stifb: Implement hardware accelerated copyarea

Linus Torvalds committed 11 years ago

Commit b9243b52 parents 1604f87 01ab6056 files · +250 −170Browse files

Unified · Split

6 files
  1. arch/parisc/include/asm/pgtable.h +37 −18
  2. arch/parisc/include/asm/tlbflush.h +29 −24
  3. arch/parisc/kernel/cache.c +67 −38
  4. arch/parisc/kernel/entry.S +79 −84
  5. arch/parisc/kernel/traps.c +0 −4
  6. drivers/video/fbdev/stifb.c +38 −2
arch/parisc/include/asm/pgtable.h+37−18
@@ -16,7 +16,7 @@ · 15 unmodified lines
16#include <asm/processor.h>16#include <asm/processor.h>
17#include <asm/cache.h>17#include <asm/cache.h>
18 18
19extern spinlock_t pa_dbit_lock;19extern spinlock_t pa_tlb_lock;
20 20
21/*21/*
22 * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel22 * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
@@ -33,6 +33,19 @@ extern spinlock_t pa_dbit_lock; · 10 unmodified lines
33 */33 */
34#define kern_addr_valid(addr) (1)34#define kern_addr_valid(addr) (1)
35 35
36/* Purge data and instruction TLB entries. Must be called holding
37 * the pa_tlb_lock. The TLB purge instructions are slow on SMP
38 * machines since the purge must be broadcast to all CPUs.
39 */
40
41static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
42{
43 mtsp(mm->context, 1);
44 pdtlb(addr);
45 if (unlikely(split_tlb))
46 pitlb(addr);
47}
48
36/* Certain architectures need to do special things when PTEs49/* Certain architectures need to do special things when PTEs
37 * within a page table are directly modified. Thus, the following50 * within a page table are directly modified. Thus, the following
38 * hook is made available.51 * hook is made available.
@@ -42,15 +55,20 @@ extern spinlock_t pa_dbit_lock; · 3 unmodified lines
42 *(pteptr) = (pteval); \55 *(pteptr) = (pteval); \
43 } while(0)56 } while(0)
44 57
45extern void purge_tlb_entries(struct mm_struct *, unsigned long);58#define pte_inserted(x) \
59 ((pte_val(x) & (_PAGE_PRESENT|_PAGE_ACCESSED)) \
60 == (_PAGE_PRESENT|_PAGE_ACCESSED))
46 61
47#define set_pte_at(mm, addr, ptep, pteval) \62#define set_pte_at(mm, addr, ptep, pteval) \
48 do { \63 do { \
64 pte_t old_pte; \
49 unsigned long flags; \65 unsigned long flags; \
50 spin_lock_irqsave(&pa_dbit_lock, flags); \66 spin_lock_irqsave(&pa_tlb_lock, flags); \
51 set_pte(ptep, pteval); \67 old_pte = *ptep; \
52 purge_tlb_entries(mm, addr); \68 set_pte(ptep, pteval); \
53 spin_unlock_irqrestore(&pa_dbit_lock, flags); \69 if (pte_inserted(old_pte)) \
70 purge_tlb_entries(mm, addr); \
71 spin_unlock_irqrestore(&pa_tlb_lock, flags); \
54 } while (0)72 } while (0)
55 73
56#endif /* !__ASSEMBLY__ */74#endif /* !__ASSEMBLY__ */
@@ -268,7 +286,7 @@ extern unsigned long *empty_zero_page; · 211 unmodified lines
268 286
269#define pte_none(x) (pte_val(x) == 0)287#define pte_none(x) (pte_val(x) == 0)
270#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)288#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
271#define pte_clear(mm,addr,xp) do { pte_val(*(xp)) = 0; } while (0)289#define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))
272 290
273#define pmd_flag(x) (pmd_val(x) & PxD_FLAG_MASK)291#define pmd_flag(x) (pmd_val(x) & PxD_FLAG_MASK)
274#define pmd_address(x) ((unsigned long)(pmd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)292#define pmd_address(x) ((unsigned long)(pmd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
@@ -435,15 +453,15 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned · 160 unmodified lines
435 if (!pte_young(*ptep))453 if (!pte_young(*ptep))
436 return 0;454 return 0;
437 455
438 spin_lock_irqsave(&pa_dbit_lock, flags);456 spin_lock_irqsave(&pa_tlb_lock, flags);
439 pte = *ptep;457 pte = *ptep;
440 if (!pte_young(pte)) {458 if (!pte_young(pte)) {
441 spin_unlock_irqrestore(&pa_dbit_lock, flags);459 spin_unlock_irqrestore(&pa_tlb_lock, flags);
442 return 0;460 return 0;
443 }461 }
444 set_pte(ptep, pte_mkold(pte));462 set_pte(ptep, pte_mkold(pte));
445 purge_tlb_entries(vma->vm_mm, addr);463 purge_tlb_entries(vma->vm_mm, addr);
446 spin_unlock_irqrestore(&pa_dbit_lock, flags);464 spin_unlock_irqrestore(&pa_tlb_lock, flags);
447 return 1;465 return 1;
448}466}
449 467
@@ -453,11 +471,12 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, · 3 unmodified lines
453 pte_t old_pte;471 pte_t old_pte;
454 unsigned long flags;472 unsigned long flags;
455 473
456 spin_lock_irqsave(&pa_dbit_lock, flags);474 spin_lock_irqsave(&pa_tlb_lock, flags);
457 old_pte = *ptep;475 old_pte = *ptep;
458 pte_clear(mm,addr,ptep);476 set_pte(ptep, __pte(0));
459 purge_tlb_entries(mm, addr);477 if (pte_inserted(old_pte))
460 spin_unlock_irqrestore(&pa_dbit_lock, flags);478 purge_tlb_entries(mm, addr);
479 spin_unlock_irqrestore(&pa_tlb_lock, flags);
461 480
462 return old_pte;481 return old_pte;
463}482}
@@ -465,10 +484,10 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, · 1 unmodified line
465static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)484static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
466{485{
467 unsigned long flags;486 unsigned long flags;
468 spin_lock_irqsave(&pa_dbit_lock, flags);487 spin_lock_irqsave(&pa_tlb_lock, flags);
469 set_pte(ptep, pte_wrprotect(*ptep));488 set_pte(ptep, pte_wrprotect(*ptep));
470 purge_tlb_entries(mm, addr);489 purge_tlb_entries(mm, addr);
471 spin_unlock_irqrestore(&pa_dbit_lock, flags);490 spin_unlock_irqrestore(&pa_tlb_lock, flags);
472}491}
473 492
474#define pte_same(A,B) (pte_val(A) == pte_val(B))493#define pte_same(A,B) (pte_val(A) == pte_val(B))
arch/parisc/include/asm/tlbflush.h+29−24
@@ -13,6 +13,9 @@ · 12 unmodified lines
13 * active at any one time on the Merced bus. This tlb purge13 * active at any one time on the Merced bus. This tlb purge
14 * synchronisation is fairly lightweight and harmless so we activate14 * synchronisation is fairly lightweight and harmless so we activate
15 * it on all systems not just the N class.15 * it on all systems not just the N class.
16
17 * It is also used to ensure PTE updates are atomic and consistent
18 * with the TLB.
16 */19 */
17extern spinlock_t pa_tlb_lock;20extern spinlock_t pa_tlb_lock;
18 21
@@ -24,20 +27,24 @@ extern void flush_tlb_all_local(void *); · 5 unmodified lines
24 27
25#define smp_flush_tlb_all() flush_tlb_all()28#define smp_flush_tlb_all() flush_tlb_all()
26 29
30int __flush_tlb_range(unsigned long sid,
31 unsigned long start, unsigned long end);
32
33#define flush_tlb_range(vma, start, end) \
34 __flush_tlb_range((vma)->vm_mm->context, start, end)
35
36#define flush_tlb_kernel_range(start, end) \
37 __flush_tlb_range(0, start, end)
38
27/*39/*
28 * flush_tlb_mm()40 * flush_tlb_mm()
29 *41 *
30 * XXX This code is NOT valid for HP-UX compatibility processes,42 * The code to switch to a new context is NOT valid for processes
31 * (although it will probably work 99% of the time). HP-UX43 * which play with the space id's. Thus, we have to preserve the
32 * processes are free to play with the space id's and save them44 * space and just flush the entire tlb. However, the compilers,
33 * over long periods of time, etc. so we have to preserve the45 * dynamic linker, etc, do not manipulate space id's, so there
34 * space and just flush the entire tlb. We need to check the46 * could be a significant performance benefit in switching contexts
35 * personality in order to do that, but the personality is not47 * and not flushing the whole tlb.
36 * currently being set correctly.
37 *
38 * Of course, Linux processes could do the same thing, but
39 * we don't support that (and the compilers, dynamic linker,
40 * etc. do not do that).
41 */48 */
42 49
43static inline void flush_tlb_mm(struct mm_struct *mm)50static inline void flush_tlb_mm(struct mm_struct *mm)
@@ -45,10 +52,18 @@ static inline void flush_tlb_mm(struct mm_struct *mm) · 1 unmodified line
45 BUG_ON(mm == &init_mm); /* Should never happen */52 BUG_ON(mm == &init_mm); /* Should never happen */
46 53
47#if 1 || defined(CONFIG_SMP)54#if 1 || defined(CONFIG_SMP)
55 /* Except for very small threads, flushing the whole TLB is
56 * faster than using __flush_tlb_range. The pdtlb and pitlb
57 * instructions are very slow because of the TLB broadcast.
58 * It might be faster to do local range flushes on all CPUs
59 * on PA 2.0 systems.
60 */
48 flush_tlb_all();61 flush_tlb_all();
49#else62#else
50 /* FIXME: currently broken, causing space id and protection ids63 /* FIXME: currently broken, causing space id and protection ids
51 * to go out of sync, resulting in faults on userspace accesses.64 * to go out of sync, resulting in faults on userspace accesses.
65 * This approach needs further investigation since running many
66 * small applications (e.g., GCC testsuite) is faster on HP-UX.
52 */67 */
53 if (mm) {68 if (mm) {
54 if (mm->context != 0)69 if (mm->context != 0)
@@ -65,22 +80,12 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, · 10 unmodified lines
65{80{
66 unsigned long flags, sid;81 unsigned long flags, sid;
67 82
68 /* For one page, it's not worth testing the split_tlb variable */
69
70 mb();
71 sid = vma->vm_mm->context;83 sid = vma->vm_mm->context;
72 purge_tlb_start(flags);84 purge_tlb_start(flags);
73 mtsp(sid, 1);85 mtsp(sid, 1);
74 pdtlb(addr);86 pdtlb(addr);
75 pitlb(addr);87 if (unlikely(split_tlb))
88 pitlb(addr);
76 purge_tlb_end(flags);89 purge_tlb_end(flags);
77}90}
78
79void __flush_tlb_range(unsigned long sid,
80 unsigned long start, unsigned long end);
81
82#define flush_tlb_range(vma,start,end) __flush_tlb_range((vma)->vm_mm->context,start,end)
83
84#define flush_tlb_kernel_range(start, end) __flush_tlb_range(0,start,end)
85
86#endif91#endif
arch/parisc/kernel/cache.c+67−38
@@ -342,12 +342,15 @@ EXPORT_SYMBOL(flush_data_cache_local); · 341 unmodified lines
342EXPORT_SYMBOL(flush_kernel_icache_range_asm);342EXPORT_SYMBOL(flush_kernel_icache_range_asm);
343 343
344#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */344#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
345int parisc_cache_flush_threshold __read_mostly = FLUSH_THRESHOLD;345static unsigned long parisc_cache_flush_threshold __read_mostly = FLUSH_THRESHOLD;
346
347#define FLUSH_TLB_THRESHOLD (2*1024*1024) /* 2MB initial TLB threshold */
348static unsigned long parisc_tlb_flush_threshold __read_mostly = FLUSH_TLB_THRESHOLD;
346 349
347void __init parisc_setup_cache_timing(void)350void __init parisc_setup_cache_timing(void)
348{351{
349 unsigned long rangetime, alltime;352 unsigned long rangetime, alltime;
350 unsigned long size;353 unsigned long size, start;
351 354
352 alltime = mfctl(16);355 alltime = mfctl(16);
353 flush_data_cache();356 flush_data_cache();
@@ -364,14 +367,43 @@ void __init parisc_setup_cache_timing(void) · 10 unmodified lines
364 /* Racy, but if we see an intermediate value, it's ok too... */367 /* Racy, but if we see an intermediate value, it's ok too... */
365 parisc_cache_flush_threshold = size * alltime / rangetime;368 parisc_cache_flush_threshold = size * alltime / rangetime;
366 369
367 parisc_cache_flush_threshold = (parisc_cache_flush_threshold + L1_CACHE_BYTES - 1) &~ (L1_CACHE_BYTES - 1); 370 parisc_cache_flush_threshold = L1_CACHE_ALIGN(parisc_cache_flush_threshold);
368 if (!parisc_cache_flush_threshold)371 if (!parisc_cache_flush_threshold)
369 parisc_cache_flush_threshold = FLUSH_THRESHOLD;372 parisc_cache_flush_threshold = FLUSH_THRESHOLD;
370 373
371 if (parisc_cache_flush_threshold > cache_info.dc_size)374 if (parisc_cache_flush_threshold > cache_info.dc_size)
372 parisc_cache_flush_threshold = cache_info.dc_size;375 parisc_cache_flush_threshold = cache_info.dc_size;
373 376
374 printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());377 printk(KERN_INFO "Setting cache flush threshold to %lu kB\n",
378 parisc_cache_flush_threshold/1024);
379
380 /* calculate TLB flush threshold */
381
382 alltime = mfctl(16);
383 flush_tlb_all();
384 alltime = mfctl(16) - alltime;
385
386 size = PAGE_SIZE;
387 start = (unsigned long) _text;
388 rangetime = mfctl(16);
389 while (start < (unsigned long) _end) {
390 flush_tlb_kernel_range(start, start + PAGE_SIZE);
391 start += PAGE_SIZE;
392 size += PAGE_SIZE;
393 }
394 rangetime = mfctl(16) - rangetime;
395
396 printk(KERN_DEBUG "Whole TLB flush %lu cycles, flushing %lu bytes %lu cycles\n",
397 alltime, size, rangetime);
398
399 parisc_tlb_flush_threshold = size * alltime / rangetime;
400 parisc_tlb_flush_threshold *= num_online_cpus();
401 parisc_tlb_flush_threshold = PAGE_ALIGN(parisc_tlb_flush_threshold);
402 if (!parisc_tlb_flush_threshold)
403 parisc_tlb_flush_threshold = FLUSH_TLB_THRESHOLD;
404
405 printk(KERN_INFO "Setting TLB flush threshold to %lu kB\n",
406 parisc_tlb_flush_threshold/1024);
375}407}
376 408
377extern void purge_kernel_dcache_page_asm(unsigned long);409extern void purge_kernel_dcache_page_asm(unsigned long);
@@ -403,48 +435,45 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, · 25 unmodified lines
403}435}
404EXPORT_SYMBOL(copy_user_page);436EXPORT_SYMBOL(copy_user_page);
405 437
406void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)438/* __flush_tlb_range()
407{439 *
408 unsigned long flags;440 * returns 1 if all TLBs were flushed.
409 441 */
410 /* Note: purge_tlb_entries can be called at startup with442int __flush_tlb_range(unsigned long sid, unsigned long start,
411 no context. */443 unsigned long end)
412
413 purge_tlb_start(flags);
414 mtsp(mm->context, 1);
415 pdtlb(addr);
416 pitlb(addr);
417 purge_tlb_end(flags);
418}
419EXPORT_SYMBOL(purge_tlb_entries);
420
421void __flush_tlb_range(unsigned long sid, unsigned long start,
422 unsigned long end)
423{444{
424 unsigned long npages;445 unsigned long flags, size;
425 446
426 npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;447 size = (end - start);
427 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */448 if (size >= parisc_tlb_flush_threshold) {
428 flush_tlb_all();449 flush_tlb_all();
429 else {450 return 1;
430 unsigned long flags;451 }
431 452
453 /* Purge TLB entries for small ranges using the pdtlb and
454 pitlb instructions. These instructions execute locally
455 but cause a purge request to be broadcast to other TLBs. */
456 if (likely(!split_tlb)) {
457 while (start < end) {
458 purge_tlb_start(flags);
459 mtsp(sid, 1);
460 pdtlb(start);
461 purge_tlb_end(flags);
462 start += PAGE_SIZE;
463 }
464 return 0;
465 }
466
467 /* split TLB case */
468 while (start < end) {
432 purge_tlb_start(flags);469 purge_tlb_start(flags);
433 mtsp(sid, 1);470 mtsp(sid, 1);
434 if (split_tlb) {471 pdtlb(start);
435 while (npages--) {472 pitlb(start);
436 pdtlb(start);
437 pitlb(start);
438 start += PAGE_SIZE;
439 }
440 } else {
441 while (npages--) {
442 pdtlb(start);
443 start += PAGE_SIZE;
444 }
445 }
446 purge_tlb_end(flags);473 purge_tlb_end(flags);
474 start += PAGE_SIZE;
447 }475 }
476 return 0;
448}477}
449 478
450static void cacheflush_h_tmp_function(void *dummy)479static void cacheflush_h_tmp_function(void *dummy)
arch/parisc/kernel/entry.S+79−84
@@ -45,7 +45,7 @@ · 44 unmodified lines
45 .level 2.045 .level 2.0
46#endif46#endif
47 47
48 .import pa_dbit_lock,data48 .import pa_tlb_lock,data
49 49
50 /* space_to_prot macro creates a prot id from a space id */50 /* space_to_prot macro creates a prot id from a space id */
51 51
@@ -420,8 +420,8 @@ · 368 unmodified lines
420 SHLREG %r9,PxD_VALUE_SHIFT,\pmd420 SHLREG %r9,PxD_VALUE_SHIFT,\pmd
421 extru \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index421 extru \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
422 dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */422 dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */
423 shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd423 shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd /* pmd is now pte */
424 LDREG %r0(\pmd),\pte /* pmd is now pte */424 LDREG %r0(\pmd),\pte
425 bb,>=,n \pte,_PAGE_PRESENT_BIT,\fault425 bb,>=,n \pte,_PAGE_PRESENT_BIT,\fault
426 .endm426 .endm
427 427
@@ -453,57 +453,53 @@ · 25 unmodified lines
453 L2_ptep \pgd,\pte,\index,\va,\fault453 L2_ptep \pgd,\pte,\index,\va,\fault
454 .endm454 .endm
455 455
456 /* Acquire pa_dbit_lock lock. */456 /* Acquire pa_tlb_lock lock and recheck page is still present. */
457 .macro dbit_lock spc,tmp,tmp1457 .macro tlb_lock spc,ptp,pte,tmp,tmp1,fault
458#ifdef CONFIG_SMP458#ifdef CONFIG_SMP
459 cmpib,COND(=),n 0,\spc,2f459 cmpib,COND(=),n 0,\spc,2f
460 load32 PA(pa_dbit_lock),\tmp460 load32 PA(pa_tlb_lock),\tmp
4611: LDCW 0(\tmp),\tmp14611: LDCW 0(\tmp),\tmp1
462 cmpib,COND(=) 0,\tmp1,1b462 cmpib,COND(=) 0,\tmp1,1b
463 nop463 nop
464 LDREG 0(\ptp),\pte
465 bb,<,n \pte,_PAGE_PRESENT_BIT,2f
466 b \fault
467 stw \spc,0(\tmp)
4642:4682:
465#endif469#endif
466 .endm470 .endm
467 471
468 /* Release pa_dbit_lock lock without reloading lock address. */472 /* Release pa_tlb_lock lock without reloading lock address. */
469 .macro dbit_unlock0 spc,tmp473 .macro tlb_unlock0 spc,tmp
470#ifdef CONFIG_SMP474#ifdef CONFIG_SMP
471 or,COND(=) %r0,\spc,%r0475 or,COND(=) %r0,\spc,%r0
472 stw \spc,0(\tmp)476 stw \spc,0(\tmp)
473#endif477#endif
474 .endm478 .endm
475 479
476 /* Release pa_dbit_lock lock. */480 /* Release pa_tlb_lock lock. */
477 .macro dbit_unlock1 spc,tmp481 .macro tlb_unlock1 spc,tmp
478#ifdef CONFIG_SMP482#ifdef CONFIG_SMP
479 load32 PA(pa_dbit_lock),\tmp483 load32 PA(pa_tlb_lock),\tmp
480 dbit_unlock0 \spc,\tmp484 tlb_unlock0 \spc,\tmp
481#endif485#endif
482 .endm486 .endm
483 487
484 /* Set the _PAGE_ACCESSED bit of the PTE. Be clever and488 /* Set the _PAGE_ACCESSED bit of the PTE. Be clever and
485 * don't needlessly dirty the cache line if it was already set */489 * don't needlessly dirty the cache line if it was already set */
486 .macro update_ptep spc,ptep,pte,tmp,tmp1490 .macro update_accessed ptp,pte,tmp,tmp1
487#ifdef CONFIG_SMP
488 or,COND(=) %r0,\spc,%r0
489 LDREG 0(\ptep),\pte
490#endif
491 ldi _PAGE_ACCESSED,\tmp1491 ldi _PAGE_ACCESSED,\tmp1
492 or \tmp1,\pte,\tmp492 or \tmp1,\pte,\tmp
493 and,COND(<>) \tmp1,\pte,%r0493 and,COND(<>) \tmp1,\pte,%r0
494 STREG \tmp,0(\ptep)494 STREG \tmp,0(\ptp)
495 .endm495 .endm
496 496
497 /* Set the dirty bit (and accessed bit). No need to be497 /* Set the dirty bit (and accessed bit). No need to be
498 * clever, this is only used from the dirty fault */498 * clever, this is only used from the dirty fault */
499 .macro update_dirty spc,ptep,pte,tmp499 .macro update_dirty ptp,pte,tmp
500#ifdef CONFIG_SMP
501 or,COND(=) %r0,\spc,%r0
502 LDREG 0(\ptep),\pte
503#endif
504 ldi _PAGE_ACCESSED|_PAGE_DIRTY,\tmp500 ldi _PAGE_ACCESSED|_PAGE_DIRTY,\tmp
505 or \tmp,\pte,\pte501 or \tmp,\pte,\pte
506 STREG \pte,0(\ptep)502 STREG \pte,0(\ptp)
507 .endm503 .endm
508 504
509 /* bitshift difference between a PFN (based on kernel's PAGE_SIZE)505 /* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
@@ -1148,14 +1144,14 @@ dtlb_miss_20w: · 638 unmodified lines
1148 1144
1149 L3_ptep ptp,pte,t0,va,dtlb_check_alias_20w1145 L3_ptep ptp,pte,t0,va,dtlb_check_alias_20w
1150 1146
1151 dbit_lock spc,t0,t11147 tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_20w
1152 update_ptep spc,ptp,pte,t0,t11148 update_accessed ptp,pte,t0,t1
1153 1149
1154 make_insert_tlb spc,pte,prot1150 make_insert_tlb spc,pte,prot
1155 1151
1156 idtlbt pte,prot1152 idtlbt pte,prot
1157 dbit_unlock1 spc,t0
1158 1153
1154 tlb_unlock1 spc,t0
1159 rfir1155 rfir
1160 nop1156 nop
1161 1157
@@ -1174,14 +1170,14 @@ nadtlb_miss_20w: · 12 unmodified lines
1174 1170
1175 L3_ptep ptp,pte,t0,va,nadtlb_check_alias_20w1171 L3_ptep ptp,pte,t0,va,nadtlb_check_alias_20w
1176 1172
1177 dbit_lock spc,t0,t11173 tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_20w
1178 update_ptep spc,ptp,pte,t0,t11174 update_accessed ptp,pte,t0,t1
1179 1175
1180 make_insert_tlb spc,pte,prot1176 make_insert_tlb spc,pte,prot
1181 1177
1182 idtlbt pte,prot1178 idtlbt pte,prot
1183 dbit_unlock1 spc,t0
1184 1179
1180 tlb_unlock1 spc,t0
1185 rfir1181 rfir
1186 nop1182 nop
1187 1183
@@ -1202,20 +1198,20 @@ dtlb_miss_11: · 14 unmodified lines
1202 1198
1203 L2_ptep ptp,pte,t0,va,dtlb_check_alias_111199 L2_ptep ptp,pte,t0,va,dtlb_check_alias_11
1204 1200
1205 dbit_lock spc,t0,t11201 tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_11
1206 update_ptep spc,ptp,pte,t0,t11202 update_accessed ptp,pte,t0,t1
1207 1203
1208 make_insert_tlb_11 spc,pte,prot1204 make_insert_tlb_11 spc,pte,prot
1209 1205
1210 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */1206 mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */
1211 mtsp spc,%sr11207 mtsp spc,%sr1
1212 1208
1213 idtlba pte,(%sr1,va)1209 idtlba pte,(%sr1,va)
1214 idtlbp prot,(%sr1,va)1210 idtlbp prot,(%sr1,va)
1215 1211
1216 mtsp t0, %sr1 /* Restore sr1 */1212 mtsp t1, %sr1 /* Restore sr1 */
1217 dbit_unlock1 spc,t0
1218 1213
1214 tlb_unlock1 spc,t0
1219 rfir1215 rfir
1220 nop1216 nop
1221 1217
@@ -1235,21 +1231,20 @@ nadtlb_miss_11: · 13 unmodified lines
1235 1231
1236 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_111232 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_11
1237 1233
1238 dbit_lock spc,t0,t11234 tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_11
1239 update_ptep spc,ptp,pte,t0,t11235 update_accessed ptp,pte,t0,t1
1240 1236
1241 make_insert_tlb_11 spc,pte,prot1237 make_insert_tlb_11 spc,pte,prot
1242 1238
1243 1239 mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */
1244 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */
1245 mtsp spc,%sr11240 mtsp spc,%sr1
1246 1241
1247 idtlba pte,(%sr1,va)1242 idtlba pte,(%sr1,va)
1248 idtlbp prot,(%sr1,va)1243 idtlbp prot,(%sr1,va)
1249 1244
1250 mtsp t0, %sr1 /* Restore sr1 */1245 mtsp t1, %sr1 /* Restore sr1 */
1251 dbit_unlock1 spc,t0
1252 1246
1247 tlb_unlock1 spc,t0
1253 rfir1248 rfir
1254 nop1249 nop
1255 1250
@@ -1269,16 +1264,16 @@ dtlb_miss_20: · 13 unmodified lines
1269 1264
1270 L2_ptep ptp,pte,t0,va,dtlb_check_alias_201265 L2_ptep ptp,pte,t0,va,dtlb_check_alias_20
1271 1266
1272 dbit_lock spc,t0,t11267 tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_20
1273 update_ptep spc,ptp,pte,t0,t11268 update_accessed ptp,pte,t0,t1
1274 1269
1275 make_insert_tlb spc,pte,prot1270 make_insert_tlb spc,pte,prot
1276 1271
1277 f_extend pte,t01272 f_extend pte,t1
1278 1273
1279 idtlbt pte,prot1274 idtlbt pte,prot
1280 dbit_unlock1 spc,t0
1281 1275
1276 tlb_unlock1 spc,t0
1282 rfir1277 rfir
1283 nop1278 nop
1284 1279
@@ -1297,16 +1292,16 @@ nadtlb_miss_20: · 12 unmodified lines
1297 1292
1298 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_201293 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_20
1299 1294
1300 dbit_lock spc,t0,t11295 tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_20
1301 update_ptep spc,ptp,pte,t0,t11296 update_accessed ptp,pte,t0,t1
1302 1297
1303 make_insert_tlb spc,pte,prot1298 make_insert_tlb spc,pte,prot
1304 1299
1305 f_extend pte,t01300 f_extend pte,t1
1306 1301
1307 idtlbt pte,prot1302 idtlbt pte,prot
1308 dbit_unlock1 spc,t0
1309 1303
1304 tlb_unlock1 spc,t0
1310 rfir1305 rfir
1311 nop1306 nop
1312 1307
@@ -1406,14 +1401,14 @@ itlb_miss_20w: · 93 unmodified lines
1406 1401
1407 L3_ptep ptp,pte,t0,va,itlb_fault1402 L3_ptep ptp,pte,t0,va,itlb_fault
1408 1403
1409 dbit_lock spc,t0,t11404 tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1410 update_ptep spc,ptp,pte,t0,t11405 update_accessed ptp,pte,t0,t1
1411 1406
1412 make_insert_tlb spc,pte,prot1407 make_insert_tlb spc,pte,prot
1413 1408
1414 iitlbt pte,prot1409 iitlbt pte,prot
1415 dbit_unlock1 spc,t0
1416 1410
1411 tlb_unlock1 spc,t0
1417 rfir1412 rfir
1418 nop1413 nop
1419 1414
@@ -1430,14 +1425,14 @@ naitlb_miss_20w: · 10 unmodified lines
1430 1425
1431 L3_ptep ptp,pte,t0,va,naitlb_check_alias_20w1426 L3_ptep ptp,pte,t0,va,naitlb_check_alias_20w
1432 1427
1433 dbit_lock spc,t0,t11428 tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_20w
1434 update_ptep spc,ptp,pte,t0,t11429 update_accessed ptp,pte,t0,t1
1435 1430
1436 make_insert_tlb spc,pte,prot1431 make_insert_tlb spc,pte,prot
1437 1432
1438 iitlbt pte,prot1433 iitlbt pte,prot
1439 dbit_unlock1 spc,t0
1440 1434
1435 tlb_unlock1 spc,t0
1441 rfir1436 rfir
1442 nop1437 nop
1443 1438
@@ -1458,20 +1453,20 @@ itlb_miss_11: · 14 unmodified lines
1458 1453
1459 L2_ptep ptp,pte,t0,va,itlb_fault1454 L2_ptep ptp,pte,t0,va,itlb_fault
1460 1455
1461 dbit_lock spc,t0,t11456 tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1462 update_ptep spc,ptp,pte,t0,t11457 update_accessed ptp,pte,t0,t1
1463 1458
1464 make_insert_tlb_11 spc,pte,prot1459 make_insert_tlb_11 spc,pte,prot
1465 1460
1466 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */1461 mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */
1467 mtsp spc,%sr11462 mtsp spc,%sr1
1468 1463
1469 iitlba pte,(%sr1,va)1464 iitlba pte,(%sr1,va)
1470 iitlbp prot,(%sr1,va)1465 iitlbp prot,(%sr1,va)
1471 1466
1472 mtsp t0, %sr1 /* Restore sr1 */1467 mtsp t1, %sr1 /* Restore sr1 */
1473 dbit_unlock1 spc,t0
1474 1468
1469 tlb_unlock1 spc,t0
1475 rfir1470 rfir
1476 nop1471 nop
1477 1472
@@ -1482,20 +1477,20 @@ naitlb_miss_11: · 4 unmodified lines
1482 1477
1483 L2_ptep ptp,pte,t0,va,naitlb_check_alias_111478 L2_ptep ptp,pte,t0,va,naitlb_check_alias_11
1484 1479
1485 dbit_lock spc,t0,t11480 tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_11
1486 update_ptep spc,ptp,pte,t0,t11481 update_accessed ptp,pte,t0,t1
1487 1482
1488 make_insert_tlb_11 spc,pte,prot1483 make_insert_tlb_11 spc,pte,prot
1489 1484
1490 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */1485 mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */
1491 mtsp spc,%sr11486 mtsp spc,%sr1
1492 1487
1493 iitlba pte,(%sr1,va)1488 iitlba pte,(%sr1,va)
1494 iitlbp prot,(%sr1,va)1489 iitlbp prot,(%sr1,va)
1495 1490
1496 mtsp t0, %sr1 /* Restore sr1 */1491 mtsp t1, %sr1 /* Restore sr1 */
1497 dbit_unlock1 spc,t0
1498 1492
1493 tlb_unlock1 spc,t0
1499 rfir1494 rfir
1500 nop1495 nop
1501 1496
@@ -1516,16 +1511,16 @@ itlb_miss_20: · 14 unmodified lines
1516 1511
1517 L2_ptep ptp,pte,t0,va,itlb_fault1512 L2_ptep ptp,pte,t0,va,itlb_fault
1518 1513
1519 dbit_lock spc,t0,t11514 tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1520 update_ptep spc,ptp,pte,t0,t11515 update_accessed ptp,pte,t0,t1
1521 1516
1522 make_insert_tlb spc,pte,prot1517 make_insert_tlb spc,pte,prot
1523 1518
1524 f_extend pte,t0 1519 f_extend pte,t1
1525 1520
1526 iitlbt pte,prot1521 iitlbt pte,prot
1527 dbit_unlock1 spc,t0
1528 1522
1523 tlb_unlock1 spc,t0
1529 rfir1524 rfir
1530 nop1525 nop
1531 1526
@@ -1536,16 +1531,16 @@ naitlb_miss_20: · 4 unmodified lines
1536 1531
1537 L2_ptep ptp,pte,t0,va,naitlb_check_alias_201532 L2_ptep ptp,pte,t0,va,naitlb_check_alias_20
1538 1533
1539 dbit_lock spc,t0,t11534 tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_20
1540 update_ptep spc,ptp,pte,t0,t11535 update_accessed ptp,pte,t0,t1
1541 1536
1542 make_insert_tlb spc,pte,prot1537 make_insert_tlb spc,pte,prot
1543 1538
1544 f_extend pte,t01539 f_extend pte,t1
1545 1540
1546 iitlbt pte,prot1541 iitlbt pte,prot
1547 dbit_unlock1 spc,t0
1548 1542
1543 tlb_unlock1 spc,t0
1549 rfir1544 rfir
1550 nop1545 nop
1551 1546
@@ -1568,14 +1563,14 @@ dbit_trap_20w: · 16 unmodified lines
1568 1563
1569 L3_ptep ptp,pte,t0,va,dbit_fault1564 L3_ptep ptp,pte,t0,va,dbit_fault
1570 1565
1571 dbit_lock spc,t0,t11566 tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1572 update_dirty spc,ptp,pte,t11567 update_dirty ptp,pte,t1
1573 1568
1574 make_insert_tlb spc,pte,prot1569 make_insert_tlb spc,pte,prot
1575 1570
1576 idtlbt pte,prot1571 idtlbt pte,prot
1577 dbit_unlock0 spc,t0
1578 1572
1573 tlb_unlock0 spc,t0
1579 rfir1574 rfir
1580 nop1575 nop
1581#else1576#else
@@ -1588,8 +1583,8 @@ dbit_trap_11: · 6 unmodified lines
1588 1583
1589 L2_ptep ptp,pte,t0,va,dbit_fault1584 L2_ptep ptp,pte,t0,va,dbit_fault
1590 1585
1591 dbit_lock spc,t0,t11586 tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1592 update_dirty spc,ptp,pte,t11587 update_dirty ptp,pte,t1
1593 1588
1594 make_insert_tlb_11 spc,pte,prot1589 make_insert_tlb_11 spc,pte,prot
1595 1590
@@ -1600,8 +1595,8 @@ dbit_trap_11: · 4 unmodified lines
1600 idtlbp prot,(%sr1,va)1595 idtlbp prot,(%sr1,va)
1601 1596
1602 mtsp t1, %sr1 /* Restore sr1 */1597 mtsp t1, %sr1 /* Restore sr1 */
1603 dbit_unlock0 spc,t0
1604 1598
1599 tlb_unlock0 spc,t0
1605 rfir1600 rfir
1606 nop1601 nop
1607 1602
@@ -1612,16 +1607,16 @@ dbit_trap_20: · 4 unmodified lines
1612 1607
1613 L2_ptep ptp,pte,t0,va,dbit_fault1608 L2_ptep ptp,pte,t0,va,dbit_fault
1614 1609
1615 dbit_lock spc,t0,t11610 tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1616 update_dirty spc,ptp,pte,t11611 update_dirty ptp,pte,t1
1617 1612
1618 make_insert_tlb spc,pte,prot1613 make_insert_tlb spc,pte,prot
1619 1614
1620 f_extend pte,t11615 f_extend pte,t1
1621 1616
1622 idtlbt pte,prot1617 idtlbt pte,prot
1623 dbit_unlock0 spc,t0
1624 1618
1619 tlb_unlock0 spc,t0
1625 rfir1620 rfir
1626 nop1621 nop
1627#endif1622#endif
arch/parisc/kernel/traps.c+0−4
@@ -43,10 +43,6 @@ · 42 unmodified lines
43 43
44#include "../math-emu/math-emu.h" /* for handle_fpe() */44#include "../math-emu/math-emu.h" /* for handle_fpe() */
45 45
46#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
47DEFINE_SPINLOCK(pa_dbit_lock);
48#endif
49
50static void parisc_show_stack(struct task_struct *task, unsigned long *sp,46static void parisc_show_stack(struct task_struct *task, unsigned long *sp,
51 struct pt_regs *regs);47 struct pt_regs *regs);
52 48
drivers/video/fbdev/stifb.c+38−2
@@ -121,6 +121,7 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; · 120 unmodified lines
121#define REG_3 0x0004a0121#define REG_3 0x0004a0
122#define REG_4 0x000600122#define REG_4 0x000600
123#define REG_6 0x000800123#define REG_6 0x000800
124#define REG_7 0x000804
124#define REG_8 0x000820125#define REG_8 0x000820
125#define REG_9 0x000a04126#define REG_9 0x000a04
126#define REG_10 0x018000127#define REG_10 0x018000
@@ -135,6 +136,8 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; · 8 unmodified lines
135#define REG_21 0x200218136#define REG_21 0x200218
136#define REG_22 0x0005a0137#define REG_22 0x0005a0
137#define REG_23 0x0005c0138#define REG_23 0x0005c0
139#define REG_24 0x000808
140#define REG_25 0x000b00
138#define REG_26 0x200118141#define REG_26 0x200118
139#define REG_27 0x200308142#define REG_27 0x200308
140#define REG_32 0x21003c143#define REG_32 0x21003c
@@ -429,6 +432,9 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) · 288 unmodified lines
429#define SET_LENXY_START_RECFILL(fb, lenxy) \432#define SET_LENXY_START_RECFILL(fb, lenxy) \
430 WRITE_WORD(lenxy, fb, REG_9)433 WRITE_WORD(lenxy, fb, REG_9)
431 434
435#define SETUP_COPYAREA(fb) \
436 WRITE_BYTE(0, fb, REG_16b1)
437
432static void438static void
433HYPER_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)439HYPER_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
434{440{
@@ -1004,6 +1010,36 @@ stifb_blank(int blank_mode, struct fb_info *info) · 569 unmodified lines
1004 return 0;1010 return 0;
1005}1011}
1006 1012
1013static void
1014stifb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
1015{
1016 struct stifb_info *fb = container_of(info, struct stifb_info, info);
1017
1018 SETUP_COPYAREA(fb);
1019
1020 SETUP_HW(fb);
1021 if (fb->info.var.bits_per_pixel == 32) {
1022 WRITE_WORD(0xBBA0A000, fb, REG_10);
1023
1024 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xffffffff);
1025 } else {
1026 WRITE_WORD(fb->id == S9000_ID_HCRX ? 0x13a02000 : 0x13a01000, fb, REG_10);
1027
1028 NGLE_REALLY_SET_IMAGE_PLANEMASK(fb, 0xff);
1029 }
1030
1031 NGLE_QUICK_SET_IMAGE_BITMAP_OP(fb,
1032 IBOvals(RopSrc, MaskAddrOffset(0),
1033 BitmapExtent08, StaticReg(1),
1034 DataDynamic, MaskOtc, BGx(0), FGx(0)));
1035
1036 WRITE_WORD(((area->sx << 16) | area->sy), fb, REG_24);
1037 WRITE_WORD(((area->width << 16) | area->height), fb, REG_7);
1038 WRITE_WORD(((area->dx << 16) | area->dy), fb, REG_25);
1039
1040 SETUP_FB(fb);
1041}
1042
1007static void __init1043static void __init
1008stifb_init_display(struct stifb_info *fb)1044stifb_init_display(struct stifb_info *fb)
1009{1045{
@@ -1069,7 +1105,7 @@ static struct fb_ops stifb_ops = { · 59 unmodified lines
1069 .fb_setcolreg = stifb_setcolreg,1105 .fb_setcolreg = stifb_setcolreg,
1070 .fb_blank = stifb_blank,1106 .fb_blank = stifb_blank,
1071 .fb_fillrect = cfb_fillrect,1107 .fb_fillrect = cfb_fillrect,
1072 .fb_copyarea = cfb_copyarea,1108 .fb_copyarea = stifb_copyarea,
1073 .fb_imageblit = cfb_imageblit,1109 .fb_imageblit = cfb_imageblit,
1074};1110};
1075 1111
@@ -1258,7 +1294,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 182 unmodified lines
1258 info->fbops = &stifb_ops;1294 info->fbops = &stifb_ops;
1259 info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);1295 info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
1260 info->screen_size = fix->smem_len;1296 info->screen_size = fix->smem_len;
1261 info->flags = FBINFO_DEFAULT;1297 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA;
1262 info->pseudo_palette = &fb->pseudo_palette;1298 info->pseudo_palette = &fb->pseudo_palette;
1263 1299
1264 /* This has to be done !!! */1300 /* This has to be done !!! */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t