On 04/05/2015 15:58, Laszlo Ersek wrote:
> I audited all PCDs used by PiSmmCpuDxeSmm carefully. Most of them are
> fixed or feature PCDs, fine. However, there are two dynamic PCDs that
> carry important information (and we can't just go with a default):
> - PcdCpuConfigContextBuffer
> - PcdCpuS3DataAddress
> 
> PiSmmCpuDxeSmm *consumes* these PCDs, and the driver that produces them
> -- brace for impact -- is
> 
>   Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe/
> 
> This means that PiSmmCpuDxeSmm will never work unless we throw out our
> current MpService implementation, located in edk2's
> 
>   UefiCpuPkg/CpuDxe/
> 
> (contributed by Chen Fan of Fujitsu), and replace it with the one from
> the Quark distribution.
> 
> Which means that I'd have to import *another* 300+ KB driver from the
> Quark package, get it to build, and pray that it doesn't have even
> *further* dependencies.

Ok, I think I figured it out.

The problem is basically that there is no CpuMpPei module; for the S3
resume path, stuff like MTRR setup need to be done in PiSmmCpuDxeSmm.

Thus, CpuMpDxe bundles the data it retrieved from the APs and passes it
to PiSmmCpuDxeSmm.  This is PcdCpuS3DataAddress.

Now, the CpuMpDxe implementation we have seems to be incomplete.  It
doesn't set an IDT, for example.  So maybe we do have to use Quark's in
the end.  However, for now I would focus on uniprocessor guests and "#if
0" the heck out of AP support in PiSmmCpuDxeSmm.  Of MtrrTable,
PreSmmInitRegisterTable and RegisterTable, I suspect we'll only need
MtrrTable.  I would also start with an empty MtrrTable because KVM uses
MTRRs only sparingly.  We can later provide a hand-off mechanism via
MtrrLib, but anyway it looks like PcdCpuS3DataAddress is easy-ish to stub.


PcdCpuConfigContextBuffer points to a CPU_CONFIG_CONTEXT_BUFFER.  I
don't see any user.  In fact, of the entire CpuConfigLib only
CPU_REGISTER_TABLE{,_ENTRY} and REGISTER_TYPE are needed.  And as
mentioned above, we might not even need those in the end.  So I would
remove CpuConfigLib and kill pieces of PiSmmCpuDxeSmm until it compiles.
:)  Then you can see what works and what doesn't.


Of course you can start from OVMFIA32.dsc in order to avoid the world
switch complications.

Paolo

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to