public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] x86_64: fix early_gdt_descr_base mangling
@ 2009-02-07 17:40 Jiri Slaby
  2009-02-07 20:43 ` Brian Gerst
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2009-02-07 17:40 UTC (permalink / raw)
  To: mingo
  Cc: tglx, hpa, pavel, rjw, linux-kernel, Jiri Slaby, Brian Gerst,
	Tejun Heo

Commit 8c7e58e690ae60ab4215b025f433ed4af261e103
(x86: rework __per_cpu_load adjustments)
has broken resume on my machine. On every secondary_startup_64 invocation,
it adds initial_gs to early_gdt_descr_base.

Fix it by initializing it to per_cpu__gdt_page and adding to it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
---
 arch/x86/kernel/head_64.S |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index a0a2b5c..dadca8d 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -215,7 +215,8 @@ ENTRY(secondary_startup_64)
 	movq	initial_gs(%rip), %rax
 	cmpl	$0, per_cpu__cpu_number(%rax)
 	jne	1f
-	addq	%rax, early_gdt_descr_base(%rip)
+	addq	$per_cpu__gdt_page, %rax
+	movq	%rax, early_gdt_descr_base(%rip)
 1:
 #endif
 	/*
@@ -425,7 +426,7 @@ NEXT_PAGE(level2_spare_pgt)
 early_gdt_descr:
 	.word	GDT_ENTRIES*8-1
 early_gdt_descr_base:
-	.quad	per_cpu__gdt_page
+	.quad	0
 
 ENTRY(phys_base)
 	/* This must match the first entry in level2_kernel_pgt */
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] x86_64: fix early_gdt_descr_base mangling
  2009-02-07 17:40 [PATCH 1/1] x86_64: fix early_gdt_descr_base mangling Jiri Slaby
@ 2009-02-07 20:43 ` Brian Gerst
  2009-02-07 20:48   ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Gerst @ 2009-02-07 20:43 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: mingo, tglx, hpa, pavel, rjw, linux-kernel, Tejun Heo

On Sat, Feb 7, 2009 at 12:40 PM, Jiri Slaby <jirislaby@gmail.com> wrote:
> Commit 8c7e58e690ae60ab4215b025f433ed4af261e103
> (x86: rework __per_cpu_load adjustments)
> has broken resume on my machine. On every secondary_startup_64 invocation,
> it adds initial_gs to early_gdt_descr_base.
>
> Fix it by initializing it to per_cpu__gdt_page and adding to it.
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Tejun Heo <tj@kernel.org>
> ---
>  arch/x86/kernel/head_64.S |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
> index a0a2b5c..dadca8d 100644
> --- a/arch/x86/kernel/head_64.S
> +++ b/arch/x86/kernel/head_64.S
> @@ -215,7 +215,8 @@ ENTRY(secondary_startup_64)
>        movq    initial_gs(%rip), %rax
>        cmpl    $0, per_cpu__cpu_number(%rax)
>        jne     1f
> -       addq    %rax, early_gdt_descr_base(%rip)
> +       addq    $per_cpu__gdt_page, %rax
> +       movq    %rax, early_gdt_descr_base(%rip)
>  1:
>  #endif
>        /*
> @@ -425,7 +426,7 @@ NEXT_PAGE(level2_spare_pgt)
>  early_gdt_descr:
>        .word   GDT_ENTRIES*8-1
>  early_gdt_descr_base:
> -       .quad   per_cpu__gdt_page
> +       .quad   0

The add of the load address isn't done on UP, so this breaks it.

Actually, hold off on this patch.  I see a better way of handling this.

--
Brian Gerst

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] x86_64: fix early_gdt_descr_base mangling
  2009-02-07 20:43 ` Brian Gerst
@ 2009-02-07 20:48   ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-02-07 20:48 UTC (permalink / raw)
  To: Brian Gerst; +Cc: mingo, tglx, hpa, pavel, rjw, linux-kernel, Tejun Heo

Brian Gerst wrote:
>> @@ -425,7 +426,7 @@ NEXT_PAGE(level2_spare_pgt)
>>  early_gdt_descr:
>>        .word   GDT_ENTRIES*8-1
>>  early_gdt_descr_base:
>> -       .quad   per_cpu__gdt_page
>> +       .quad   0
> 
> The add of the load address isn't done on UP, so this breaks it.

Ah, I see.

> Actually, hold off on this patch.

Ok, thanks, holding on...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-07 20:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-07 17:40 [PATCH 1/1] x86_64: fix early_gdt_descr_base mangling Jiri Slaby
2009-02-07 20:43 ` Brian Gerst
2009-02-07 20:48   ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox