The NetBSD Project

CVS log for src/sys/arch/i386/i386/locore.S

[BACK] Up to [] / src / sys / arch / i386 / i386

Request diff between arbitrary revisions

Default branch: MAIN
Current tag: nick-nhusb-base-20160529

Revision 1.125 / (download) - annotate - [select for diffs], Thu May 26 07:24:55 2016 UTC (2 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.124: +10 -4 lines
Diff to previous 1.124 (colored)

There is an issue in the way the fillkpt macro sets up pages on both
amd64 and i386.

The fillkpt loop is equivalent to the following:

	do {
		/* fill in the slot */
		/* increment %ebx to the next slot */
		/* increment %eax to the next pa */
	} while (%ecx > 0)

The issue here is that if %ecx = 0 (i.e., the chunk we are trying to
map is zero-sized), there is still one entry created in the page table.
The kernel expects the va<->pa translation to be linear in low memory.
If there is a zero-sized chunk, the dead entry creates a +4096 offset in
the virtual space, with two consecutive entries that point to the same
physical address. In other words, the mappings are not linear anymore,
which causes the kernel to die.

Before my recent changes, there were only two big chunks that were
mapped, and neither of these could be zero-sized. Now, with multiple,
fine-grained chunks, it is possible that the [SYMS]+[PRELOADED_MODULES]
chunk could be zero-sized.

[PRELOADED_MODULES] is almost never here, and [SYMS] is always here on
default kernels. Except for floppies, where the bootloader does not load

Should fix PR 51148.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>