Skip to content

Commit

Permalink
xtensa: fix fast_store_prohibited _PAGE_WRITABLE_BIT test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Max Filippov authored and Chris Zankel committed May 20, 2013
1 parent 7711ece commit 51fc41a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/xtensa/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 51fc41a

Please sign in to comment.