[U-Boot] [PATCH v3 2/3] x86: fsp: Load GDT before calling FspInitEntry

Simon Glass sjg at chromium.org
Sun Jun 7 16:48:40 CEST 2015


On 7 June 2015 at 08:06, Simon Glass <sjg at chromium.org> wrote:
> On 6 June 2015 at 21:33, Bin Meng <bmeng.cn at gmail.com> wrote:
>> Currently the FSP execution environment GDT is setup by U-Boot in
>> arch/x86/cpu/start16.S, which works pretty well. But if we try to
>> move the FspInitEntry call a little bit later to better fit into
>> U-Boot's initialization sequence, FSP will fail to bring up the AP
>> due to #GP fault as AP's GDT is duplicated from BSP whose GDT is
>> now moved into CAR, and unfortunately FSP calls AP initialization
>> after it disables the CAR. So basically the BSP's GDT still refers
>> to the one in the CAR, whose content is no longer available, so
>> when AP starts up and loads its segment register, it blows up.
>>
>> To resolve this, we load GDT before calling into FspInitEntry.
>> The GDT is the same one used in arch/x86/cpu/start16.S, which is
>> in the ROM and exists forever.
>>
>> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>> Tested-by: Andrew Bradford <andrew.bradford at kodakalaris.com>
>> Tested-by: Simon Glass <sjg at chromium.org>
>>
>> ---
>>
>> Changes in v3:
>> - Rename gdt in arch/x86/cpu/start16.S to gdt_rom
>> - Change 'extern u32 gdt' to 'extern char gdt_rom[]'
>> - Add comments to setup_fsp_gdt()
>
> Acked-by: Simon Glass <sjg at chromium.org>

Applied to u-boot-x86, thanks!


More information about the U-Boot mailing list