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
1616 #include <asm/processor.h>
1717 #include <asm/cache.h>
1818
19−extern spinlock_t pa_dbit_lock;
19+extern spinlock_t pa_tlb_lock;
2020
2121 /*
2222 * 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
3333 */
3434 #define kern_addr_valid(addr) (1)
3535
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+
41+static 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+
3649 /* Certain architectures need to do special things when PTEs
3750 * within a page table are directly modified. Thus, the following
3851 * hook is made available.
@@ -42,15 +55,20 @@ extern spinlock_t pa_dbit_lock; · 3 unmodified lines
4255 *(pteptr) = (pteval); \
4356 } while(0)
4457
45−extern 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))
4661
47−#define set_pte_at(mm, addr, ptep, pteval) \
48− do { \
62+#define set_pte_at(mm, addr, ptep, pteval) \
63+ do { \
64+ pte_t old_pte; \
4965 unsigned long flags; \
50− spin_lock_irqsave(&pa_dbit_lock, flags); \
51− set_pte(ptep, pteval); \
52− purge_tlb_entries(mm, addr); \
53− spin_unlock_irqrestore(&pa_dbit_lock, flags); \
66+ spin_lock_irqsave(&pa_tlb_lock, flags); \
67+ old_pte = *ptep; \
68+ set_pte(ptep, pteval); \
69+ if (pte_inserted(old_pte)) \
70+ purge_tlb_entries(mm, addr); \
71+ spin_unlock_irqrestore(&pa_tlb_lock, flags); \
5472 } while (0)
5573
5674 #endif /* !__ASSEMBLY__ */
@@ -268,7 +286,7 @@ extern unsigned long *empty_zero_page; · 211 unmodified lines
268286
269287 #define pte_none(x) (pte_val(x) == 0)
270288 #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))
272290
273291 #define pmd_flag(x) (pmd_val(x) & PxD_FLAG_MASK)
274292 #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
435453 if (!pte_young(*ptep))
436454 return 0;
437455
438− spin_lock_irqsave(&pa_dbit_lock, flags);
456+ spin_lock_irqsave(&pa_tlb_lock, flags);
439457 pte = *ptep;
440458 if (!pte_young(pte)) {
441− spin_unlock_irqrestore(&pa_dbit_lock, flags);
459+ spin_unlock_irqrestore(&pa_tlb_lock, flags);
442460 return 0;
443461 }
444462 set_pte(ptep, pte_mkold(pte));
445463 purge_tlb_entries(vma->vm_mm, addr);
446− spin_unlock_irqrestore(&pa_dbit_lock, flags);
464+ spin_unlock_irqrestore(&pa_tlb_lock, flags);
447465 return 1;
448466 }
449467
@@ -453,11 +471,12 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, · 3 unmodified lines
453471 pte_t old_pte;
454472 unsigned long flags;
455473
456− spin_lock_irqsave(&pa_dbit_lock, flags);
474+ spin_lock_irqsave(&pa_tlb_lock, flags);
457475 old_pte = *ptep;
458− pte_clear(mm,addr,ptep);
459− purge_tlb_entries(mm, addr);
460− spin_unlock_irqrestore(&pa_dbit_lock, flags);
476+ set_pte(ptep, __pte(0));
477+ if (pte_inserted(old_pte))
478+ purge_tlb_entries(mm, addr);
479+ spin_unlock_irqrestore(&pa_tlb_lock, flags);
461480
462481 return old_pte;
463482 }
@@ -465,10 +484,10 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, · 1 unmodified line
465484 static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
466485 {
467486 unsigned long flags;
468− spin_lock_irqsave(&pa_dbit_lock, flags);
487+ spin_lock_irqsave(&pa_tlb_lock, flags);
469488 set_pte(ptep, pte_wrprotect(*ptep));
470489 purge_tlb_entries(mm, addr);
471− spin_unlock_irqrestore(&pa_dbit_lock, flags);
490+ spin_unlock_irqrestore(&pa_tlb_lock, flags);
472491 }
473492
474493 #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
1313 * active at any one time on the Merced bus. This tlb purge
1414 * synchronisation is fairly lightweight and harmless so we activate
1515 * 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.
1619 */
1720 extern spinlock_t pa_tlb_lock;
1821
@@ -24,20 +27,24 @@ extern void flush_tlb_all_local(void *); · 5 unmodified lines
2427
2528 #define smp_flush_tlb_all() flush_tlb_all()
2629
30+int __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+
2739 /*
2840 * flush_tlb_mm()
2941 *
30− * XXX This code is NOT valid for HP-UX compatibility processes,
31− * (although it will probably work 99% of the time). HP-UX
32− * processes are free to play with the space id's and save them
33− * over long periods of time, etc. so we have to preserve the
34− * space and just flush the entire tlb. We need to check the
35− * personality in order to do that, but the personality is not
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).
42+ * The code to switch to a new context is NOT valid for processes
43+ * which play with the space id's. Thus, we have to preserve the
44+ * space and just flush the entire tlb. However, the compilers,
45+ * dynamic linker, etc, do not manipulate space id's, so there
46+ * could be a significant performance benefit in switching contexts
47+ * and not flushing the whole tlb.
4148 */
4249
4350 static 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
4552 BUG_ON(mm == &init_mm); /* Should never happen */
4653
4754 #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+ */
4861 flush_tlb_all();
4962 #else
5063 /* 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.
5267 */
5368 if (mm) {
5469 if (mm->context != 0)
@@ -65,22 +80,12 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, · 10 unmodified lines
6580 {
6681 unsigned long flags, sid;
6782
68− /* For one page, it's not worth testing the split_tlb variable */
69−
70− mb();
7183 sid = vma->vm_mm->context;
7284 purge_tlb_start(flags);
7385 mtsp(sid, 1);
7486 pdtlb(addr);
75− pitlb(addr);
87+ if (unlikely(split_tlb))
88+ pitlb(addr);
7689 purge_tlb_end(flags);
7790 }
78−
79−void __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−
8691 #endif
arch/parisc/kernel/cache.c+67−38
@@ -342,12 +342,15 @@ EXPORT_SYMBOL(flush_data_cache_local); · 341 unmodified lines
342342 EXPORT_SYMBOL(flush_kernel_icache_range_asm);
343343
344344 #define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
345−int parisc_cache_flush_threshold __read_mostly = FLUSH_THRESHOLD;
345+static unsigned long parisc_cache_flush_threshold __read_mostly = FLUSH_THRESHOLD;
346+
347+#define FLUSH_TLB_THRESHOLD (2*1024*1024) /* 2MB initial TLB threshold */
348+static unsigned long parisc_tlb_flush_threshold __read_mostly = FLUSH_TLB_THRESHOLD;
346349
347350 void __init parisc_setup_cache_timing(void)
348351 {
349352 unsigned long rangetime, alltime;
350− unsigned long size;
353+ unsigned long size, start;
351354
352355 alltime = mfctl(16);
353356 flush_data_cache();
@@ -364,14 +367,43 @@ void __init parisc_setup_cache_timing(void) · 10 unmodified lines
364367 /* Racy, but if we see an intermediate value, it's ok too... */
365368 parisc_cache_flush_threshold = size * alltime / rangetime;
366369
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);
368371 if (!parisc_cache_flush_threshold)
369372 parisc_cache_flush_threshold = FLUSH_THRESHOLD;
370373
371374 if (parisc_cache_flush_threshold > cache_info.dc_size)
372375 parisc_cache_flush_threshold = cache_info.dc_size;
373376
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);
375407 }
376408
377409 extern 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
403435 }
404436 EXPORT_SYMBOL(copy_user_page);
405437
406−void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
407−{
408− unsigned long flags;
409−
410− /* Note: purge_tlb_entries can be called at startup with
411− no context. */
412−
413− purge_tlb_start(flags);
414− mtsp(mm->context, 1);
415− pdtlb(addr);
416− pitlb(addr);
417− purge_tlb_end(flags);
418−}
419−EXPORT_SYMBOL(purge_tlb_entries);
420−
421−void __flush_tlb_range(unsigned long sid, unsigned long start,
422− unsigned long end)
438+/* __flush_tlb_range()
439+ *
440+ * returns 1 if all TLBs were flushed.
441+ */
442+int __flush_tlb_range(unsigned long sid, unsigned long start,
443+ unsigned long end)
423444 {
424− unsigned long npages;
445+ unsigned long flags, size;
425446
426− npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
427− if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
447+ size = (end - start);
448+ if (size >= parisc_tlb_flush_threshold) {
428449 flush_tlb_all();
429− else {
430− unsigned long flags;
450+ return 1;
451+ }
431452
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) {
432469 purge_tlb_start(flags);
433470 mtsp(sid, 1);
434− if (split_tlb) {
435− while (npages--) {
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− }
471+ pdtlb(start);
472+ pitlb(start);
446473 purge_tlb_end(flags);
474+ start += PAGE_SIZE;
447475 }
476+ return 0;
448477 }
449478
450479 static void cacheflush_h_tmp_function(void *dummy)
arch/parisc/kernel/entry.S+79−84
@@ -45,7 +45,7 @@ · 44 unmodified lines
4545 .level 2.0
4646 #endif
4747
48− .import pa_dbit_lock,data
48+ .import pa_tlb_lock,data
4949
5050 /* space_to_prot macro creates a prot id from a space id */
5151
@@ -420,8 +420,8 @@ · 368 unmodified lines
420420 SHLREG %r9,PxD_VALUE_SHIFT,\pmd
421421 extru \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
422422 dep %r0,31,PAGE_SHIFT,\pmd /* clear offset */
423− shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd
424− LDREG %r0(\pmd),\pte /* pmd is now pte */
423+ shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd /* pmd is now pte */
424+ LDREG %r0(\pmd),\pte
425425 bb,>=,n \pte,_PAGE_PRESENT_BIT,\fault
426426 .endm
427427
@@ -453,57 +453,53 @@ · 25 unmodified lines
453453 L2_ptep \pgd,\pte,\index,\va,\fault
454454 .endm
455455
456− /* Acquire pa_dbit_lock lock. */
457− .macro dbit_lock spc,tmp,tmp1
456+ /* Acquire pa_tlb_lock lock and recheck page is still present. */
457+ .macro tlb_lock spc,ptp,pte,tmp,tmp1,fault
458458 #ifdef CONFIG_SMP
459459 cmpib,COND(=),n 0,\spc,2f
460− load32 PA(pa_dbit_lock),\tmp
460+ load32 PA(pa_tlb_lock),\tmp
461461 1: LDCW 0(\tmp),\tmp1
462462 cmpib,COND(=) 0,\tmp1,1b
463463 nop
464+ LDREG 0(\ptp),\pte
465+ bb,<,n \pte,_PAGE_PRESENT_BIT,2f
466+ b \fault
467+ stw \spc,0(\tmp)
464468 2:
465469 #endif
466470 .endm
467471
468− /* Release pa_dbit_lock lock without reloading lock address. */
469− .macro dbit_unlock0 spc,tmp
472+ /* Release pa_tlb_lock lock without reloading lock address. */
473+ .macro tlb_unlock0 spc,tmp
470474 #ifdef CONFIG_SMP
471475 or,COND(=) %r0,\spc,%r0
472476 stw \spc,0(\tmp)
473477 #endif
474478 .endm
475479
476− /* Release pa_dbit_lock lock. */
477− .macro dbit_unlock1 spc,tmp
480+ /* Release pa_tlb_lock lock. */
481+ .macro tlb_unlock1 spc,tmp
478482 #ifdef CONFIG_SMP
479− load32 PA(pa_dbit_lock),\tmp
480− dbit_unlock0 \spc,\tmp
483+ load32 PA(pa_tlb_lock),\tmp
484+ tlb_unlock0 \spc,\tmp
481485 #endif
482486 .endm
483487
484488 /* Set the _PAGE_ACCESSED bit of the PTE. Be clever and
485489 * don't needlessly dirty the cache line if it was already set */
486− .macro update_ptep spc,ptep,pte,tmp,tmp1
487−#ifdef CONFIG_SMP
488− or,COND(=) %r0,\spc,%r0
489− LDREG 0(\ptep),\pte
490−#endif
490+ .macro update_accessed ptp,pte,tmp,tmp1
491491 ldi _PAGE_ACCESSED,\tmp1
492492 or \tmp1,\pte,\tmp
493493 and,COND(<>) \tmp1,\pte,%r0
494− STREG \tmp,0(\ptep)
494+ STREG \tmp,0(\ptp)
495495 .endm
496496
497497 /* Set the dirty bit (and accessed bit). No need to be
498498 * clever, this is only used from the dirty fault */
499− .macro update_dirty spc,ptep,pte,tmp
500−#ifdef CONFIG_SMP
501− or,COND(=) %r0,\spc,%r0
502− LDREG 0(\ptep),\pte
503−#endif
499+ .macro update_dirty ptp,pte,tmp
504500 ldi _PAGE_ACCESSED|_PAGE_DIRTY,\tmp
505501 or \tmp,\pte,\pte
506− STREG \pte,0(\ptep)
502+ STREG \pte,0(\ptp)
507503 .endm
508504
509505 /* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
@@ -1148,14 +1144,14 @@ dtlb_miss_20w: · 638 unmodified lines
11481144
11491145 L3_ptep ptp,pte,t0,va,dtlb_check_alias_20w
11501146
1151− dbit_lock spc,t0,t1
1152− update_ptep spc,ptp,pte,t0,t1
1147+ tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_20w
1148+ update_accessed ptp,pte,t0,t1
11531149
11541150 make_insert_tlb spc,pte,prot
11551151
11561152 idtlbt pte,prot
1157− dbit_unlock1 spc,t0
11581153
1154+ tlb_unlock1 spc,t0
11591155 rfir
11601156 nop
11611157
@@ -1174,14 +1170,14 @@ nadtlb_miss_20w: · 12 unmodified lines
11741170
11751171 L3_ptep ptp,pte,t0,va,nadtlb_check_alias_20w
11761172
1177− dbit_lock spc,t0,t1
1178− update_ptep spc,ptp,pte,t0,t1
1173+ tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_20w
1174+ update_accessed ptp,pte,t0,t1
11791175
11801176 make_insert_tlb spc,pte,prot
11811177
11821178 idtlbt pte,prot
1183− dbit_unlock1 spc,t0
11841179
1180+ tlb_unlock1 spc,t0
11851181 rfir
11861182 nop
11871183
@@ -1202,20 +1198,20 @@ dtlb_miss_11: · 14 unmodified lines
12021198
12031199 L2_ptep ptp,pte,t0,va,dtlb_check_alias_11
12041200
1205− dbit_lock spc,t0,t1
1206− update_ptep spc,ptp,pte,t0,t1
1201+ tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_11
1202+ update_accessed ptp,pte,t0,t1
12071203
12081204 make_insert_tlb_11 spc,pte,prot
12091205
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 */
12111207 mtsp spc,%sr1
12121208
12131209 idtlba pte,(%sr1,va)
12141210 idtlbp prot,(%sr1,va)
12151211
1216− mtsp t0, %sr1 /* Restore sr1 */
1217− dbit_unlock1 spc,t0
1212+ mtsp t1, %sr1 /* Restore sr1 */
12181213
1214+ tlb_unlock1 spc,t0
12191215 rfir
12201216 nop
12211217
@@ -1235,21 +1231,20 @@ nadtlb_miss_11: · 13 unmodified lines
12351231
12361232 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_11
12371233
1238− dbit_lock spc,t0,t1
1239− update_ptep spc,ptp,pte,t0,t1
1234+ tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_11
1235+ update_accessed ptp,pte,t0,t1
12401236
12411237 make_insert_tlb_11 spc,pte,prot
12421238
1243−
1244− mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */
1239+ mfsp %sr1,t1 /* Save sr1 so we can use it in tlb inserts */
12451240 mtsp spc,%sr1
12461241
12471242 idtlba pte,(%sr1,va)
12481243 idtlbp prot,(%sr1,va)
12491244
1250− mtsp t0, %sr1 /* Restore sr1 */
1251− dbit_unlock1 spc,t0
1245+ mtsp t1, %sr1 /* Restore sr1 */
12521246
1247+ tlb_unlock1 spc,t0
12531248 rfir
12541249 nop
12551250
@@ -1269,16 +1264,16 @@ dtlb_miss_20: · 13 unmodified lines
12691264
12701265 L2_ptep ptp,pte,t0,va,dtlb_check_alias_20
12711266
1272− dbit_lock spc,t0,t1
1273− update_ptep spc,ptp,pte,t0,t1
1267+ tlb_lock spc,ptp,pte,t0,t1,dtlb_check_alias_20
1268+ update_accessed ptp,pte,t0,t1
12741269
12751270 make_insert_tlb spc,pte,prot
12761271
1277− f_extend pte,t0
1272+ f_extend pte,t1
12781273
12791274 idtlbt pte,prot
1280− dbit_unlock1 spc,t0
12811275
1276+ tlb_unlock1 spc,t0
12821277 rfir
12831278 nop
12841279
@@ -1297,16 +1292,16 @@ nadtlb_miss_20: · 12 unmodified lines
12971292
12981293 L2_ptep ptp,pte,t0,va,nadtlb_check_alias_20
12991294
1300− dbit_lock spc,t0,t1
1301− update_ptep spc,ptp,pte,t0,t1
1295+ tlb_lock spc,ptp,pte,t0,t1,nadtlb_check_alias_20
1296+ update_accessed ptp,pte,t0,t1
13021297
13031298 make_insert_tlb spc,pte,prot
13041299
1305− f_extend pte,t0
1300+ f_extend pte,t1
13061301
1307− idtlbt pte,prot
1308− dbit_unlock1 spc,t0
1302+ idtlbt pte,prot
13091303
1304+ tlb_unlock1 spc,t0
13101305 rfir
13111306 nop
13121307
@@ -1406,14 +1401,14 @@ itlb_miss_20w: · 93 unmodified lines
14061401
14071402 L3_ptep ptp,pte,t0,va,itlb_fault
14081403
1409− dbit_lock spc,t0,t1
1410− update_ptep spc,ptp,pte,t0,t1
1404+ tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1405+ update_accessed ptp,pte,t0,t1
14111406
14121407 make_insert_tlb spc,pte,prot
14131408
14141409 iitlbt pte,prot
1415− dbit_unlock1 spc,t0
14161410
1411+ tlb_unlock1 spc,t0
14171412 rfir
14181413 nop
14191414
@@ -1430,14 +1425,14 @@ naitlb_miss_20w: · 10 unmodified lines
14301425
14311426 L3_ptep ptp,pte,t0,va,naitlb_check_alias_20w
14321427
1433− dbit_lock spc,t0,t1
1434− update_ptep spc,ptp,pte,t0,t1
1428+ tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_20w
1429+ update_accessed ptp,pte,t0,t1
14351430
14361431 make_insert_tlb spc,pte,prot
14371432
14381433 iitlbt pte,prot
1439− dbit_unlock1 spc,t0
14401434
1435+ tlb_unlock1 spc,t0
14411436 rfir
14421437 nop
14431438
@@ -1458,20 +1453,20 @@ itlb_miss_11: · 14 unmodified lines
14581453
14591454 L2_ptep ptp,pte,t0,va,itlb_fault
14601455
1461− dbit_lock spc,t0,t1
1462− update_ptep spc,ptp,pte,t0,t1
1456+ tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1457+ update_accessed ptp,pte,t0,t1
14631458
14641459 make_insert_tlb_11 spc,pte,prot
14651460
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 */
14671462 mtsp spc,%sr1
14681463
14691464 iitlba pte,(%sr1,va)
14701465 iitlbp prot,(%sr1,va)
14711466
1472− mtsp t0, %sr1 /* Restore sr1 */
1473− dbit_unlock1 spc,t0
1467+ mtsp t1, %sr1 /* Restore sr1 */
14741468
1469+ tlb_unlock1 spc,t0
14751470 rfir
14761471 nop
14771472
@@ -1482,20 +1477,20 @@ naitlb_miss_11: · 4 unmodified lines
14821477
14831478 L2_ptep ptp,pte,t0,va,naitlb_check_alias_11
14841479
1485− dbit_lock spc,t0,t1
1486− update_ptep spc,ptp,pte,t0,t1
1480+ tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_11
1481+ update_accessed ptp,pte,t0,t1
14871482
14881483 make_insert_tlb_11 spc,pte,prot
14891484
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 */
14911486 mtsp spc,%sr1
14921487
14931488 iitlba pte,(%sr1,va)
14941489 iitlbp prot,(%sr1,va)
14951490
1496− mtsp t0, %sr1 /* Restore sr1 */
1497− dbit_unlock1 spc,t0
1491+ mtsp t1, %sr1 /* Restore sr1 */
14981492
1493+ tlb_unlock1 spc,t0
14991494 rfir
15001495 nop
15011496
@@ -1516,16 +1511,16 @@ itlb_miss_20: · 14 unmodified lines
15161511
15171512 L2_ptep ptp,pte,t0,va,itlb_fault
15181513
1519− dbit_lock spc,t0,t1
1520− update_ptep spc,ptp,pte,t0,t1
1514+ tlb_lock spc,ptp,pte,t0,t1,itlb_fault
1515+ update_accessed ptp,pte,t0,t1
15211516
15221517 make_insert_tlb spc,pte,prot
15231518
1524− f_extend pte,t0
1519+ f_extend pte,t1
15251520
15261521 iitlbt pte,prot
1527− dbit_unlock1 spc,t0
15281522
1523+ tlb_unlock1 spc,t0
15291524 rfir
15301525 nop
15311526
@@ -1536,16 +1531,16 @@ naitlb_miss_20: · 4 unmodified lines
15361531
15371532 L2_ptep ptp,pte,t0,va,naitlb_check_alias_20
15381533
1539− dbit_lock spc,t0,t1
1540− update_ptep spc,ptp,pte,t0,t1
1534+ tlb_lock spc,ptp,pte,t0,t1,naitlb_check_alias_20
1535+ update_accessed ptp,pte,t0,t1
15411536
15421537 make_insert_tlb spc,pte,prot
15431538
1544− f_extend pte,t0
1539+ f_extend pte,t1
15451540
15461541 iitlbt pte,prot
1547− dbit_unlock1 spc,t0
15481542
1543+ tlb_unlock1 spc,t0
15491544 rfir
15501545 nop
15511546
@@ -1568,14 +1563,14 @@ dbit_trap_20w: · 16 unmodified lines
15681563
15691564 L3_ptep ptp,pte,t0,va,dbit_fault
15701565
1571− dbit_lock spc,t0,t1
1572− update_dirty spc,ptp,pte,t1
1566+ tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1567+ update_dirty ptp,pte,t1
15731568
15741569 make_insert_tlb spc,pte,prot
15751570
15761571 idtlbt pte,prot
1577− dbit_unlock0 spc,t0
15781572
1573+ tlb_unlock0 spc,t0
15791574 rfir
15801575 nop
15811576 #else
@@ -1588,8 +1583,8 @@ dbit_trap_11: · 6 unmodified lines
15881583
15891584 L2_ptep ptp,pte,t0,va,dbit_fault
15901585
1591− dbit_lock spc,t0,t1
1592− update_dirty spc,ptp,pte,t1
1586+ tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1587+ update_dirty ptp,pte,t1
15931588
15941589 make_insert_tlb_11 spc,pte,prot
15951590
@@ -1600,8 +1595,8 @@ dbit_trap_11: · 4 unmodified lines
16001595 idtlbp prot,(%sr1,va)
16011596
16021597 mtsp t1, %sr1 /* Restore sr1 */
1603− dbit_unlock0 spc,t0
16041598
1599+ tlb_unlock0 spc,t0
16051600 rfir
16061601 nop
16071602
@@ -1612,16 +1607,16 @@ dbit_trap_20: · 4 unmodified lines
16121607
16131608 L2_ptep ptp,pte,t0,va,dbit_fault
16141609
1615− dbit_lock spc,t0,t1
1616− update_dirty spc,ptp,pte,t1
1610+ tlb_lock spc,ptp,pte,t0,t1,dbit_fault
1611+ update_dirty ptp,pte,t1
16171612
16181613 make_insert_tlb spc,pte,prot
16191614
16201615 f_extend pte,t1
16211616
1622− idtlbt pte,prot
1623− dbit_unlock0 spc,t0
1617+ idtlbt pte,prot
16241618
1619+ tlb_unlock0 spc,t0
16251620 rfir
16261621 nop
16271622 #endif
arch/parisc/kernel/traps.c+0−4
@@ -43,10 +43,6 @@ · 42 unmodified lines
4343
4444 #include "../math-emu/math-emu.h" /* for handle_fpe() */
4545
46−#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
47−DEFINE_SPINLOCK(pa_dbit_lock);
48−#endif
49−
5046 static void parisc_show_stack(struct task_struct *task, unsigned long *sp,
5147 struct pt_regs *regs);
5248
drivers/video/fbdev/stifb.c+38−2
@@ -121,6 +121,7 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; · 120 unmodified lines
121121 #define REG_3 0x0004a0
122122 #define REG_4 0x000600
123123 #define REG_6 0x000800
124+#define REG_7 0x000804
124125 #define REG_8 0x000820
125126 #define REG_9 0x000a04
126127 #define REG_10 0x018000
@@ -135,6 +136,8 @@ static int __initdata stifb_bpp_pref[MAX_STI_ROMS]; · 8 unmodified lines
135136 #define REG_21 0x200218
136137 #define REG_22 0x0005a0
137138 #define REG_23 0x0005c0
139+#define REG_24 0x000808
140+#define REG_25 0x000b00
138141 #define REG_26 0x200118
139142 #define REG_27 0x200308
140143 #define REG_32 0x21003c
@@ -429,6 +432,9 @@ ARTIST_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable) · 288 unmodified lines
429432 #define SET_LENXY_START_RECFILL(fb, lenxy) \
430433 WRITE_WORD(lenxy, fb, REG_9)
431434
435+#define SETUP_COPYAREA(fb) \
436+ WRITE_BYTE(0, fb, REG_16b1)
437+
432438 static void
433439 HYPER_ENABLE_DISABLE_DISPLAY(struct stifb_info *fb, int enable)
434440 {
@@ -1004,6 +1010,36 @@ stifb_blank(int blank_mode, struct fb_info *info) · 569 unmodified lines
10041010 return 0;
10051011 }
10061012
1013+static void
1014+stifb_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+
10071043 static void __init
10081044 stifb_init_display(struct stifb_info *fb)
10091045 {
@@ -1069,7 +1105,7 @@ static struct fb_ops stifb_ops = { · 59 unmodified lines
10691105 .fb_setcolreg = stifb_setcolreg,
10701106 .fb_blank = stifb_blank,
10711107 .fb_fillrect = cfb_fillrect,
1072− .fb_copyarea = cfb_copyarea,
1108+ .fb_copyarea = stifb_copyarea,
10731109 .fb_imageblit = cfb_imageblit,
10741110 };
10751111
@@ -1258,7 +1294,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) · 182 unmodified lines
12581294 info->fbops = &stifb_ops;
12591295 info->screen_base = ioremap_nocache(REGION_BASE(fb,1), fix->smem_len);
12601296 info->screen_size = fix->smem_len;
1261− info->flags = FBINFO_DEFAULT;
1297+ info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA;
12621298 info->pseudo_palette = &fb->pseudo_palette;
12631299
12641300 /* 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