On Feb 7, 2013, at 9:56 AM, Laszlo Ersek <[email protected]> wrote:

> I *guess* this is something we could do in
> EFI_MP_SERVICES_PROTOCOL.StartupAllAPs(), by calling
> MtrrSetMemoryAttribute() from the callback function that we pass as
> EFI_AP_PROCEDURE to StartupAllAPs().
> 
> EFI_MP_SERVICES_PROTOCOL.StartupAllAPs()
>  our callback function
>    MtrrSetMemoryAttribute()
> 
> The memory map might have to be passed in via "This"
> (EFI_MP_SERVICES_PROTOCOL embedded in our own struct type as usual), or
> maybe we could get it from gBS->GetMemoryMap().

I'm just guessing here but the CpuDxe driver is likely the last module mucking 
with the MTRRs. If you look at RefreshGcdMemoryAttributes() you will see the 
CpuDxe driver syncs the BSP MTRRs wit the  DXE/EFI memory map. There is also a 
function called CpuSetMemoryAttributes() that is published into the CPU AP that 
mucks with MTRRs. These two areas need to update to sync the APs MTRR values. 
This driver would also need to publish the EFI_MP_SERVICES_PROTOCOL. As I 
mentioned in my other mail there is an example of this in the emulator, but 
that is more of a template to get started as the real code will need to send 
SIPIs and deal with real mode startup on the AP, use real locks, etc. But other 
than all the plumbing  the C code that runs on the AP should be mostly the same 
between the Unix Emulator and real hardware. 

https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/UefiCpuPkg/CpuDxe/CpuDxe.c

Thanks,

Andrew Fish

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to