1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

Avoid clearing EXEC permission bit when setting the page RW on ARMv6/v7

When emulating modified bit the executable attribute was cleared by
mistake when calling pmap_set_prot(). This was not a problem before
changes to ref/mod emulation since all the pages were created RW basing
on the "prot" argument in pmap_enter(). Now however not all pages are RW
and the RW permission can be cleared in the process.

Added proper KTRs accordingly.

Spotted by:	cognet
Reviewed by:	gber
This commit is contained in:
Zbigniew Bodek 2013-11-19 23:31:39 +00:00
parent 32cea4ca0f
commit 5677154505
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258358

View File

@ -1519,10 +1519,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype, int user)
vm_page_dirty(m);
/* Re-enable write permissions for the page */
pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U);
CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", pte);
*ptep = (pte & ~L2_APX);
PTE_SYNC(ptep);
rv = 1;
CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep);
} else if (!L2_S_REFERENCED(pte)) {
/*
* This looks like a good candidate for "page referenced"
@ -1545,6 +1545,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_t ftype, int user)
*ptep = pte | L2_S_REF;
PTE_SYNC(ptep);
rv = 1;
CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep);
}
/*