On 5 March 2016 at 00:55, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote:
> On 4 March 2016 at 18:40,  <evan.ll...@arm.com> wrote:
>> From: Sami Mujawar <sami.muja...@arm.com>
>>
>> The UEFI specification allows the operating system (OS) to use the
>> Graphics Output Protocol (GOP) in the following scenarios:
>>  a. as part of the startup process and
>>  b. prior to loading of a high performance OS graphics driver
>>
>> If the VRAM is allocated as BootServicesData, then it is unmapped on
>> exit boot services. This prevents GOP usage by the OS post exit boot
>> services (the second scenario); as it results in a crash when the VRAM
>> is accessed.
>>
>> This patch fixes the issue by allocating VRAM as RuntimeServicesData.
>>
>> Code at: 
>> https://github.com/EvanLloyd/tianocore/commit/0b6b792886e5c6fa41f943b3f8775947fd4d3e8b
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Alexei Fedorov <alexei.fedo...@arm.com>
>> Signed-off-by: Girish Pathak <girish.pat...@arm.com>
>> Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
>> Signed-off-by: Evan Lloyd <evan.ll...@arm.com>
>
> Isn't it the job of the loader to reserve this memory if it needs to
> hang on to it after ExitBootServices()?
> By the same logic, configuration tables are often loaded into
> BootServicesData memory, and it is up to the OS to reserve it if it
> needs to use it. Otherwise, OSes that don't care about this
> functionality are stuck with reserved regions that they cannot
> reclaim.
>

After some discussion, I realize that you are probably not in a
position where you can change the OS side to do the right thing here.

However, RuntimeServicesData is not the correct type to use. The
framebuffer region has special semantics throughout its lifetime, and
its lifetime is unbounded (i.e., the OS has no way to tell at which
point the framebuffer is released by the graphics hardware). Also, an
OS may elect not to use runtime services at all, and free all memory
related to it.

So the correct type to use here is EfiReservedMemoryType. But please,
also add a PCD to ArmPlatformPkg to make this behavior opt-in, since
losing 8 MB to a framebuffer that the OS may never use or care about
is a bit excessvie.

Thanks,
Ard.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to