On 05/27/14 11:58, Thomas Letan wrote:
> Hello everyone
> 
> I also want to add smm support to OVMF. Starting with the previous set
> of commits (very clear, btw, thank you very much!), I made some
> progress. However, I get the following error during boot process:
> 
> 
> `SMM IPL could not find a large enough SMRAM region to load SMM Core`
> 
> My understanding of the QEMU virtualized architecture is the following:
> the SMRAM starts at 0xa0000 and has a size of 128Ko. Can you confirm me
> I'm right? Or, if not, can you tell me where I am wrong?

Yes, that seems correct. See

    memory_region_init_alias(&f->smram_region, OBJECT(d), "smram-region",
                             f->pci_address_space, 0xa0000, 0x20000);

in i440fx_init() [hw/pci-host/piix.c].

The size and base appear to be the same for q35 too (mch_init() in
"hw/pci-host/q35.c").

> So it makes sense, because when you search in EDKII SmmIpl code, you can
> see that SmmCore needs 256 - 4 Ko.

Yes, SmmIplEntry() [MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c] searches for
>= MaxSize == SIZE_256KB - EFI_PAGE_SIZE.

This size (252KB) is actually an already reduced one, it used to be 1MB
(see SVN r10158 / git commit 06b07ce3).

I don't know what a "hard" lower limit would be; perhaps Yao Jiewen can
suggest one.

> Here is my code for GetCapabilities function:

You forgot to paste the code.

> I studied a little the q35 machine of qemu and it appears if the
> implementation of smm is complete,

I believe so, yes.

> it should be perfect because of the
> TSEG memory used by SMM that is big enough for SMM Core.

TSEG? I grepped the qemu source for it, nothing looks very useful.

> But q35 machine
> is not supported by OVMF... What do you think about adding the support
> of q35 machine to OVMF?

It would be nice.

> Is it painful,

Yes. Poking at i440fx registers is scattered about many places.

One way to find them and to understand them (which includes why they
happen *where* they happen):

1. run "git grep -n PCI_LIB_ADDRESS -- OvmfPkg/"
2. cross-reference the hits with "git blame" on the respective files
3. for each found commit, run "git show", and read the commit message
   and/or the series that includes the patch.

> is it doable?

Likely. If you intend to work on that, please coordinate with Gabriel.

Thanks!
Laszlo

> 
> Thank you by advance!
> Thomas
> 
> 
> On 28/04/2014 18:33, Laszlo Ersek wrote:
>> On 04/27/14 17:38, Jordan Justen wrote:
>>> On Sat, Apr 26, 2014 at 11:41 PM, WANG Siyuan <[email protected]> 
>>> wrote:
>>>> Hi,
>>>> I want to add smm support to OVMF to see how DXE_SMM_DRIVER works.
>>>> I add MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf and
>>>> MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf to Ovmf's .dsc and .fdf files. 
>>>> But
>>>> 2 protocols are needed: EFI_SMM_ACCESS2_PROTOCOL and
>>>> EFI_SMM_CONTROL2_PROTOCOL.
>>>>
>>>> I am not sure how to add these two protocols. Does anybody ever added smm
>>>> support to OVMF?
>>>
>>> Apparently, the non-VM accelerated QEMU supports SMM, but we have not
>>> added support for this in OVMF.
>>>
>>> The VM accelerated QEMU+KVM doesn't support SMM. Usually you want to
>>> use KVM for the performance advantage, so most of the time SMM support
>>> would not be usable with OVMF.
>>>
>>> I think Laszlo's s3_v2 (not v3) branch at:
>>> https://github.com/lersek/edk2.git
>>> may have set up an environment that pretended to support those SMM
>>> protocols.
>>
>> Huh, what a surprise; I had pushed that there?... :)
>>
>> So, the following three commits are theoretically relevant:
>> 1. https://github.com/lersek/edk2/commit/59fc7eb2
>>    adds the two protocols
>>
>> 2. https://github.com/lersek/edk2/commit/5188c6cf
>>    pulls in PiSmmIpl and PiSmmCore, and resolves some library
>>    dependencies for them
>>
>> 3. https://github.com/lersek/edk2/commit/0fb124ea
>>    pulls in an SMM DXE driver, resolving some library deps for it
>>
>>> But, I don't think that would get you very far in working
>>> on a real SMM driver.
>>
>> Agreed! :)
>> Laszlo


------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to