This is a couple of patches, one to fix a broken build with HPUX compatibility
 and the other to solve a coherency problem we've been seeing in our TLB where
 setting a page read only occasionally fails to trigger a COW because of a
 stale writeable TLB entry.
 
 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQEcBAABAgAGBQJRGx0pAAoJEDeqqVYsXL0MIZMIAMX9RTW766Umn17MG7pBv+sc
 opve+z5bBv/6Ky+o+UhnwGSHv1xPX27Nli4x65J4PhqiBB+gR+DnFtYQCSpz7cTT
 XeIObaL2FsRfOHxbVOpZhfcOdOw1JaDytUbtyQUrrTQO7RebZG1TZ4XERyCMPzVi
 UzxdX4Xk5aCwByOk158Dx+MYuwXfHY5mLWWPqQ90L+ruOKayg/QSEX1P6BXd8j4V
 18BBAwLgcGSkSyto/wvDFDCu5jra49Cfm1lE3OXmRktA2vS/W13lgVaglufmlHHk
 PeJzArClIYHZFTmeNkamNQEN0NHh/fBXQP22sPnrHjWDcp9QM3lnVidsMjZcGCc=
 =xkkh
 -----END PGP SIGNATURE-----

Merge tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6 into stable-3.8

PARISC fixes on 20130213

This is a couple of patches, one to fix a broken build with HPUX compatibility
and the other to solve a coherency problem we've been seeing in our TLB where
setting a page read only occasionally fails to trigger a COW because of a
stale writeable TLB entry.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Helge Deller 2013-02-20 22:35:36 +01:00
Родитель 19f949f525 6c700d71f7
Коммит 26ad19d8eb
3 изменённых файлов: 29 добавлений и 5 удалений

Просмотреть файл

@ -43,8 +43,7 @@ int hpux_execve(struct pt_regs *regs)
error = do_execve(filename->name, error = do_execve(filename->name,
(const char __user *const __user *) regs->gr[25], (const char __user *const __user *) regs->gr[25],
(const char __user *const __user *) regs->gr[24], (const char __user *const __user *) regs->gr[24]);
regs);
putname(filename); putname(filename);

Просмотреть файл

@ -12,11 +12,10 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/mm_types.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/cache.h> #include <asm/cache.h>
struct vm_area_struct;
/* /*
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
* memory. For the return value to be meaningful, ADDR must be >= * memory. For the return value to be meaningful, ADDR must be >=
@ -40,7 +39,14 @@ struct vm_area_struct;
do{ \ do{ \
*(pteptr) = (pteval); \ *(pteptr) = (pteval); \
} while(0) } while(0)
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
extern void purge_tlb_entries(struct mm_struct *, unsigned long);
#define set_pte_at(mm, addr, ptep, pteval) \
do { \
set_pte(ptep, pteval); \
purge_tlb_entries(mm, addr); \
} while (0)
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
old = pte_val(*ptep); old = pte_val(*ptep);
new = pte_val(pte_wrprotect(__pte (old))); new = pte_val(pte_wrprotect(__pte (old)));
} while (cmpxchg((unsigned long *) ptep, old, new) != old); } while (cmpxchg((unsigned long *) ptep, old, new) != old);
purge_tlb_entries(mm, addr);
#else #else
pte_t old_pte = *ptep; pte_t old_pte = *ptep;
set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));

Просмотреть файл

@ -419,6 +419,24 @@ void kunmap_parisc(void *addr)
EXPORT_SYMBOL(kunmap_parisc); EXPORT_SYMBOL(kunmap_parisc);
#endif #endif
void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
{
unsigned long flags;
/* Note: purge_tlb_entries can be called at startup with
no context. */
/* Disable preemption while we play with %sr1. */
preempt_disable();
mtsp(mm->context, 1);
purge_tlb_start(flags);
pdtlb(addr);
pitlb(addr);
purge_tlb_end(flags);
preempt_enable();
}
EXPORT_SYMBOL(purge_tlb_entries);
void __flush_tlb_range(unsigned long sid, unsigned long start, void __flush_tlb_range(unsigned long sid, unsigned long start,
unsigned long end) unsigned long end)
{ {