Support pmap_extract_and_hold on arm64 stage 2 mappings
Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D24469
This commit is contained in:
parent
550d5d64fe
commit
3a6413d81e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362284
@ -1228,8 +1228,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
|||||||
vm_offset_t off;
|
vm_offset_t off;
|
||||||
vm_page_t m;
|
vm_page_t m;
|
||||||
int lvl;
|
int lvl;
|
||||||
|
bool use;
|
||||||
PMAP_ASSERT_STAGE1(pmap);
|
|
||||||
|
|
||||||
m = NULL;
|
m = NULL;
|
||||||
PMAP_LOCK(pmap);
|
PMAP_LOCK(pmap);
|
||||||
@ -1244,8 +1243,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
|
|||||||
(lvl < 3 && (tpte & ATTR_DESCR_MASK) == L1_BLOCK),
|
(lvl < 3 && (tpte & ATTR_DESCR_MASK) == L1_BLOCK),
|
||||||
("pmap_extract_and_hold: Invalid pte at L%d: %lx", lvl,
|
("pmap_extract_and_hold: Invalid pte at L%d: %lx", lvl,
|
||||||
tpte & ATTR_DESCR_MASK));
|
tpte & ATTR_DESCR_MASK));
|
||||||
if (((tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW)) ||
|
|
||||||
((prot & VM_PROT_WRITE) == 0)) {
|
use = false;
|
||||||
|
if ((prot & VM_PROT_WRITE) == 0)
|
||||||
|
use = true;
|
||||||
|
else if (pmap->pm_stage == PM_STAGE1 &&
|
||||||
|
(tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW))
|
||||||
|
use = true;
|
||||||
|
else if (pmap->pm_stage == PM_STAGE2 &&
|
||||||
|
((tpte & ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE)) ==
|
||||||
|
ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE)))
|
||||||
|
use = true;
|
||||||
|
|
||||||
|
if (use) {
|
||||||
switch(lvl) {
|
switch(lvl) {
|
||||||
case 1:
|
case 1:
|
||||||
off = va & L1_OFFSET;
|
off = va & L1_OFFSET;
|
||||||
|
Loading…
Reference in New Issue
Block a user