aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2007-12-02 15:26:30 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2007-12-02 15:26:30 +0000
commit18836eac489a689fc7da694e5ee5e1fc5f112003 (patch)
treea3105e2ced523e3c56b39c2072381fca1a9bceac /sys/arm
parent35af41b0a61637a9ad0612b773c27d13ae5f424e (diff)
downloadsrc-18836eac489a689fc7da694e5ee5e1fc5f112003.tar.gz
src-18836eac489a689fc7da694e5ee5e1fc5f112003.zip
Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15 for the kernel. Now supersections requires the use of domain 0, so we switched the kernel domain to 0, and use 1-15 for userland. How it's done currently, the kernel domain could be allocated for a userland process. So switch back to the previous way we did things, set the first available domain to 0, and just add 1 to get the real domain number in the struct pmap. Reported by: Mark Tinguely <tinguely AT casselton DOT net> MFC After: 3 days
Notes
Notes: svn path=/head/; revision=174181
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/pmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 71d74291ad6e..27ff426a48ff 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -430,10 +430,10 @@ pmap_init_l1(struct l1_ttable *l1, pd_entry_t *l1pt)
l1->l1_kva = l1pt;
l1->l1_domain_use_count = 0;
- l1->l1_domain_first = 1;
+ l1->l1_domain_first = 0;
for (i = 0; i < PMAP_DOMAINS; i++)
- l1->l1_domain_free[i] = i + 2;
+ l1->l1_domain_free[i] = i + 1;
/*
* Copy the kernel's L1 entries to each new L1.
@@ -787,7 +787,7 @@ pmap_alloc_l1(pmap_t pm)
* Fix up the relevant bits in the pmap structure
*/
pm->pm_l1 = l1;
- pm->pm_domain = domain;
+ pm->pm_domain = domain + 1;
}
/*
@@ -810,8 +810,8 @@ pmap_free_l1(pmap_t pm)
/*
* Free up the domain number which was allocated to the pmap
*/
- l1->l1_domain_free[pm->pm_domain] = l1->l1_domain_first;
- l1->l1_domain_first = pm->pm_domain;
+ l1->l1_domain_free[pm->pm_domain - 1] = l1->l1_domain_first;
+ l1->l1_domain_first = pm->pm_domain - 1;
l1->l1_domain_use_count--;
/*