Skip to content

Commit e8d8fc2

Browse files
danglin44hdeller
authored andcommitted
parisc: Ensure volatile space register %sr1 is not clobbered
I still see the occasional random segv on rp3440. Looking at one of these (a code 15), it appeared the problem must be with the cache handling of anonymous pages. Reviewing this, I noticed that the space register %sr1 might be being clobbered when we flush an anonymous page. Register %sr1 is used for TLB purges in a couple of places. These purges are needed on PA8800 and PA8900 processors to ensure cache consistency of flushed cache lines. The solution here is simply to move the %sr1 load into the TLB lock region needed to ensure that one purge executes at a time on SMP systems. This was already the case for one use. After a few days of operation, I haven't had a random segv on my rp3440. Signed-off-by: John David Anglin <[email protected]> Cc: <[email protected]> # 3.10 Signed-off-by: Helge Deller <[email protected]>
1 parent 92b5992 commit e8d8fc2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/parisc/include/asm/tlbflush.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
6363
static inline void flush_tlb_page(struct vm_area_struct *vma,
6464
unsigned long addr)
6565
{
66-
unsigned long flags;
66+
unsigned long flags, sid;
6767

6868
/* For one page, it's not worth testing the split_tlb variable */
6969

7070
mb();
71-
mtsp(vma->vm_mm->context,1);
71+
sid = vma->vm_mm->context;
7272
purge_tlb_start(flags);
73+
mtsp(sid, 1);
7374
pdtlb(addr);
7475
pitlb(addr);
7576
purge_tlb_end(flags);

arch/parisc/kernel/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
440440
else {
441441
unsigned long flags;
442442

443-
mtsp(sid, 1);
444443
purge_tlb_start(flags);
444+
mtsp(sid, 1);
445445
if (split_tlb) {
446446
while (npages--) {
447447
pdtlb(start);

0 commit comments

Comments
 (0)