qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 5/6] [wip] tseg, part1, not (yet) tested


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH 5/6] [wip] tseg, part1, not (yet) tested
Date: Thu, 23 Apr 2015 09:41:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/23/15 09:02, Gerd Hoffmann wrote:
>   Hi,
> 
>>> The third one is messy. It relies on SMI_EN, which is an ioport at
>>> PMBA+0x30. It requires a configured PMBA.
> 
> Isn't that initialized early anyway, because the pm timer lives there?

TimerLib (which is based in OVMF's case on the PM timer) is not needed /
used before PEI in the default case. It is used in SEC only when -D
SOURCE_DEBUG_ENABLE is passed for the build (which is "never" in practice).

> It's not a regular pci bar exactly to allow early init, so the full pci
> bus scan + bar allocation done later will not mess up things.
> 
> [ just a question, could very well be that even when initialized early
>   it isn't early enough because you need to know the memory layout
>   before uncompressing the firmware modules ]

I'm trying to avoid that; the decompression happens to a low fixed range.

>> There's another problem with basing this decision in OVMF on
>> SMI_EN.APMC_EN: it is not an idempotent check. At some point the
>> firmware itself has to set SMI_EN.APMC_EN.
> 
> Yep, you'll need some variable saying whenever smm is there or not and
> check that.  Because of this.  Or (in case we are going for the fw_cfg
> file) because you don't want dig into fw_cfg each time you need to know
> this.

The annoying limitation with SEC is that it cannot use normal C static
variables, nor PCDs. It is okay if SEC is a bit wasteful on fw_cfg (and
even in SEC I might be able to cache the result in a local variable and
pass it around). In PEI I can already use static variables (because OVMF
is unorthodox and runs PEI modules from RAM, not flash), plus I can set
PCDs (because in PEI the PCDs live in a dedicated HOB, and that HOB is
allocated from RAM (independently of OVMF)).

I'll ask Jordan too about the dynamic feature detection, because there's
another big hurdle with it (selecting a LockBox library instance at
runtime, dependent on the presence of SMM). Deciding about SMM support
at build time would make things hugely easier (because that's how
firmware for physical platforms is built as well).

Thanks
Laszlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]