freebsd with flexible iflib nic queues
Go to file
John Baldwin 726f4773ec Enable EFER_NXE properly on APs.
EFER_NXE is set in the EFER MSR by initializecpu() and must be set on all
CPUs in the system.  When PG_NX support was added to PAE on i386, the
block to enable EFER_NXE was placed in a section of initializecpu() that
only runs if 'cpu == CPU_686'.  During early boot, locore does an
initial pass to set cpu that sets it to CPU_686 on all CPUs later than
a Pentium.  Later, printcpuinfo() adjusts the 'cpu' variable on
PII and later CPUs to one of CPU_PII, CPU_PIII, or CPU_P4.  However,
printcpuinfo() is called after initializecpu() on the BSP, so the BSP
would enable EFER_NXE and pg_nx.  The APs execute initializecpu() much
later after printcpuinfo() has run.  The end result on a modern CPU was
that cpu was set to CPU_PIII when the APs invoked initializecpu(), so
they did not enable EFER_NXE.  As a result, the APs would fault when
trying to access any pages marked with PG_NX set.

When booting a 2 CPU PAE kernel in bhyve this manifested as a hang before
single user mode.  The attempt to execute /bin/init tried to copy out
the exec strings (argv, etc.) to a non-executable mapping while running
on the AP.  The instruction kept faulting due to invalid bits in the PTE
in an infinite loop.

Fix this by moving the code to enable EFER_NXE out of the switch statement
on 'cpu' and always doing it if 'amd_feature' supports AMDID_NX.

MFC after:	2 weeks
2016-10-26 18:47:47 +00:00
bin Increase timeouts so tests have more chances to succeed 2016-10-19 12:23:02 +00:00
cddl Fix tst.args1.c on LP64 platforms. 2016-10-16 19:50:10 +00:00
contrib strings: fix exit status if a file before the last one fails 2016-10-26 17:07:53 +00:00
crypto Merge OpenSSL 1.0.2j. 2016-09-26 14:22:17 +00:00
etc Use checkyesno instead of rolling my own.. 2016-10-23 18:00:09 +00:00
gnu Fix a typo from a manual merge. 2016-10-22 19:27:49 +00:00
include Define max_align_t for C11. 2016-10-21 23:50:02 +00:00
kerberos5 DIRDEPS_BUILD: Update dependencies 2016-06-14 16:55:05 +00:00
lib Use uint32_t instead of u_long as a storage for breakpoint instruction 2016-10-26 14:26:45 +00:00
libexec Reference the libc symbols ypresp_{allfn,data} instead of local symbols. 2016-10-16 19:12:22 +00:00
release Belatedly revert r303119, which was determined to not be 2016-10-24 21:16:21 +00:00
rescue DIRDEPS_BUILD: Build crunchide for the host. 2016-09-01 23:52:25 +00:00
sbin swapoff: Remove only late devices with -aL. 2016-10-21 21:55:50 +00:00
secure Merge OpenSSL 1.0.2j. 2016-09-26 14:22:17 +00:00
share Detect clang on macOS. The version string is slightly different. 2016-10-24 17:59:25 +00:00
sys Enable EFER_NXE properly on APs. 2016-10-26 18:47:47 +00:00
targets Update i386 build of loader.efi (but leave it disabled) so that we at 2016-10-14 17:25:29 +00:00
tests Change fs image name so it will not be regenerated (we 2016-10-25 18:43:36 +00:00
tools Fix build of tzsetup when WITHOUT_DIALOG is set 2016-10-22 22:35:39 +00:00
usr.bin MFV r307859: 2016-10-24 14:08:05 +00:00
usr.sbin Allow config to be compiled from another source directory, such as one 2016-10-26 15:58:41 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint
COPYRIGHT Bump copyright year. 2015-12-31 11:21:45 +00:00
LOCKS
MAINTAINERS Remove myself from kern_timeout.c yeah! 2016-07-27 20:37:32 +00:00
Makefile Create a new MACHINE_ARCH for Freescale PowerPC e500v2 2016-10-22 01:57:15 +00:00
Makefile.inc1 Tweak the UPDATING message a bit about the upgrade path. 2016-10-23 18:00:08 +00:00
Makefile.libcompat Fix in-tree GCC builds after r304681. 2016-08-23 19:29:37 +00:00
ObsoleteFiles.inc Fix dates + add an UPDATING entry. 2016-10-17 21:35:13 +00:00
README README: remove nonexistent 'games' directory. 2016-05-18 10:43:13 +00:00
UPDATING Tweak the UPDATING message a bit about the upgrade path. 2016-10-23 18:00:08 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html