]> git.karo-electronics.de Git - linux-beck.git/commitdiff
xtensa: fix fast_store_prohibited _PAGE_WRITABLE_BIT test
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 18 May 2013 19:34:30 +0000 (23:34 +0400)
committerChris Zankel <chris@zankel.net>
Mon, 20 May 2013 18:48:23 +0000 (11:48 -0700)
Before _PAGE_WRITABLE_BIT test fast_store_prohibited must make sure that
PTE is present. Otherwise 'writable' bit is undefined and may be reused
in the 'file offset' or 'swap type' PTE fields.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/kernel/entry.S

index 5082507d5631b3e6bf865ab82d40bb1975bffc3a..fa94512ff84d44bd2d2f936e29be127d5732ef6c 100644 (file)
@@ -1792,10 +1792,15 @@ ENTRY(fast_store_prohibited)
        l32i    a0, a0, 0
        beqz    a0, 2f
 
-       /* Note that we assume _PAGE_WRITABLE_BIT is only set if pte is valid.*/
+       /*
+        * Note that we test _PAGE_WRITABLE_BIT only if PTE is present
+        * and is not PAGE_NONE. See pgtable.h for possible PTE layouts.
+        */
 
        _PTE_OFFSET(a0, a1, a4)
        l32i    a4, a0, 0               # read pteval
+       movi    a1, _PAGE_CA_INVALID
+       ball    a4, a1, 2f
        bbci.l  a4, _PAGE_WRITABLE_BIT, 2f
 
        movi    a1, _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_HW_WRITE