提交 e8c3b5a6 编写于 作者: E Edgar Hucek 提交者: Linus Torvalds

[PATCH] EFI: Fix gdt load

This patch makes the kernel bootable again on ia32 EFI systems.
Signed-off-by: NEdgar Hucek <hostmaster@ed-soft.at>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Zachary Amsden <zach@vmware.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 397874df
......@@ -70,10 +70,13 @@ static void efi_call_phys_prelog(void)
{
unsigned long cr4;
unsigned long temp;
struct Xgt_desc_struct *cpu_gdt_descr;
spin_lock(&efi_rt_lock);
local_irq_save(efi_rt_eflags);
cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
/*
* If I don't have PSE, I should just duplicate two entries in page
* directory. If I have PSE, I just need to duplicate one entry in
......@@ -103,18 +106,17 @@ static void efi_call_phys_prelog(void)
*/
local_flush_tlb();
per_cpu(cpu_gdt_descr, 0).address =
__pa(per_cpu(cpu_gdt_descr, 0).address);
load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0)));
cpu_gdt_descr->address = __pa(cpu_gdt_descr->address);
load_gdt(cpu_gdt_descr);
}
static void efi_call_phys_epilog(void)
{
unsigned long cr4;
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
per_cpu(cpu_gdt_descr, 0).address =
(unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address);
load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0)));
cpu_gdt_descr->address = __va(cpu_gdt_descr->address);
load_gdt(cpu_gdt_descr);
cr4 = read_cr4();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册