HomeFreeBSD

x86: Add MPTABLE_LINUX_BUG_COMPAT option

Description

x86: Add MPTABLE_LINUX_BUG_COMPAT option

Linux has two bugs in its handling of the x86 MP table:

  1. It assumes that there is always 640 kB of base memory, and looks for

the MP table in the top kB of this even if the memory map indicates
that memory location does not exist.

  1. It ignores that entry_count field and instead iterates through the

MP table by scanning until it runs out of bytes in the table.

The Firecracker VM (and probably other related VMs) relies on both of
these bugs. With the MPTABLE_LINUX_BUG_COMPAT option, we search for
the MP table at address 639k even if that isn't in the memory map; and
replace a zeroed entry_count with a value computed from scanning the
table until we run out of table bytes.

Reviewed by: imp
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D35799

Details

Provenance
cpercivaAuthored on Jul 13 2022, 12:45 AM
Reviewer
imp
Differential Revision
D35799: x86: Add COMPAT_LINUX_MPTABLE_BUGS option
Parents
rG2297a1633d86: Add NO_LEGACY_PCIB kernel option to i386, amd64
Branches
Unknown
Tags
Unknown