1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-05 18:05:16 +00:00

Fix bug introduced by r194784: Under XEN, the page(s) allocated to dpcpu

for CPU #0 weren't being properly reserved.  Under VM pressure this would
cause problems when the dpcpu structures were overwritten by arbitrary
data; the most common symptom was a panic when netisr attempted to lock a
mutex.

For some reason the XEN code keeps track of the start of available memory
in the variables 'first', 'physfree', and 'init_first'; as far as I can
tell, we always have first == physfree == init_first * PAGE_SIZE.  The
earlier commit adjusted 'first' (which, on !XEN, is the only variable
which tracks this value) but not the other two variables.

Exercise for reader: Eliminate two of these three variables.
This commit is contained in:
Colin Percival 2010-11-29 06:50:30 +00:00
parent 13ccc60993
commit d42446149f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216041

View File

@ -2576,6 +2576,8 @@ init386(first)
pmap_kenter(pa + KERNBASE, pa);
dpcpu_init((void *)(first + KERNBASE), 0);
first += DPCPU_SIZE;
physfree += DPCPU_SIZE;
init_first += DPCPU_SIZE / PAGE_SIZE;
PCPU_SET(prvspace, pc);
PCPU_SET(curthread, &thread0);