mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edgar Hucek <hostmaster@ed-soft.at>
To: Edgar Hucek <hostmaster@ed-soft.at>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] EFI: Fix gdt load
Date: Fri, 03 Mar 2006 11:32:18 +0100	[thread overview]
Message-ID: <44081B32.5000408@ed-soft.at> (raw)
In-Reply-To: <4406F0C2.7090002@ed-soft.at>

Edgar Hucek wrote:
> This patch makes the kernel bootable again on ia32 EFI systems.
> 
> Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
> 
> 
> ------------------------------------------------------------------------
> 
> diff -uNr linux-2.6.16-rc5/arch/i386/kernel/efi.c linux-2.6.16-rc5.efi/arch/i386/kernel/efi.c
> --- linux-2.6.16-rc5/arch/i386/kernel/efi.c	2006-03-02 14:08:06.000000000 +0100
> +++ linux-2.6.16-rc5.efi/arch/i386/kernel/efi.c	2006-03-02 14:04:44.000000000 +0100
> @@ -70,7 +70,8 @@
>  {
>  	unsigned long cr4;
>  	unsigned long temp;
> -
> +	struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
> +	
>  	spin_lock(&efi_rt_lock);
>  	local_irq_save(efi_rt_eflags);
>  
> @@ -103,18 +104,17 @@
>  	 */
>  	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();
>  

I don't know if it is a race condition. At least it makes the kernel bootable agin on my box.
Any idea what i could try to make a better patch ?

cu

Edgar (gimli) Hucek

  parent reply	other threads:[~2006-03-03 10:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 13:18 Edgar Hucek
2006-03-02 16:12 ` Zwane Mwaikambo
2006-03-05  2:45   ` Andrew Morton
2006-03-03 10:32 ` Edgar Hucek [this message]
2006-03-05  2:43 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44081B32.5000408@ed-soft.at \
    --to=hostmaster@ed-soft.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome