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
Unknown Object (File)
Fri, May 31, 2:30 PM
Unknown Object (File)
Dec 20 2023, 1:05 PM
Unknown Object (File)
Dec 20 2023, 12:27 AM
Unknown Object (File)
Aug 29 2023, 3:47 AM
Unknown Object (File)
Aug 29 2023, 2:56 AM
Unknown Object (File)
Aug 28 2023, 1:47 AM
Unknown Object (File)
Aug 4 2023, 6:25 PM
Unknown Object (File)
Jul 9 2023, 12:39 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.