Page MenuHomeFreeBSD

x86: fix MTRR initialization if EARLY_AP_STARTUP is used
ClosedPublic

Authored by royger on Feb 16 2017, 12:06 PM.
Tags
None
Referenced Files
F167912367: D9630.id25310.diff
Tue, Aug 25, 9:50 AM
Unknown Object (File)
Fri, Aug 21, 2:40 PM
Unknown Object (File)
Thu, Aug 20, 9:07 PM
Unknown Object (File)
Thu, Aug 20, 2:55 PM
Unknown Object (File)
Wed, Aug 19, 4:26 AM
Unknown Object (File)
Tue, Aug 18, 8:10 PM
Unknown Object (File)
Tue, Aug 18, 4:37 PM
Unknown Object (File)
Tue, Aug 18, 9:48 AM
Subscribers

Details

Summary

MTRR handlers are set in {amd64/i686}_mem_drvinit, which is called at
SI_SUB_DRIVERS, and that's too late when EARLY_AP_STARTUP is set because APs
have already started at this point. {amd64/i686}_mrinit is also called too late
for the BSP, since that happens when the memory device is attached, also after
APs have already started.

Move the position to SI_SUB_CPU, and also initialize the state for the BSP, so
that the APs can correctly get to the same state as the BSP.

Sponsored by: Citrix Systems R&D

Test Plan

Not tested on i386, only amd64.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

royger retitled this revision from to x86: fix MTRR initialization if EARLY_AP_STARTUP is used.
royger updated this object.
royger edited the test plan for this revision. (Show Details)
royger added reviewers: jhb, kib.
royger set the repository for this revision to rS FreeBSD src repository - subversion.
jhb edited edge metadata.

This seems sensible. I suspect it was at SI_SUB_DRIVERS due to being tied to the cdev.

It might be slightly cleaner to turn the init method stored in the 'ops' into a stub instead of adding the 'already initialized' check.

This revision is now accepted and ready to land.Feb 16 2017, 5:55 PM
kib edited edge metadata.

The code should be merged into x86/x86_mem.c

This revision was automatically updated to reflect the committed changes.