All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Xen i386 xen-head.S fix sections mixup
@ 2007-08-20  3:04 Mathieu Desnoyers
  2007-08-20  6:13 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Desnoyers @ 2007-08-20  3:04 UTC (permalink / raw)
  To: Andrew Morton, jeremy, chrisw; +Cc: virtualization, xen-devel

Xen i386 xen-head.S fix sections mixup

xen-head.S does not come back to the data section, leaving the text section
as current section. It causes problems with a slightly enhanced DEBUG_RODATA
that supports CONFIG_HOTPLUG and bringing a CPU up after the text has been
marked read-only: reference to early_gdt_descr causes a page fault.

It applies on 2.6.22-rc2-mm2.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: jeremy@xensource.com
CC: chrisw@sous-sol.org
CC: virtualization@lists.osdl.org
CC: xen-devel@lists.xensource.com
---
 arch/i386/xen/xen-head.S |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6-lttng/arch/i386/xen/xen-head.S
===================================================================
--- linux-2.6-lttng.orig/arch/i386/xen/xen-head.S	2007-08-19 22:45:58.000000000 -0400
+++ linux-2.6-lttng/arch/i386/xen/xen-head.S	2007-08-19 22:46:19.000000000 -0400
@@ -13,6 +13,7 @@ ENTRY(startup_xen)
 	cld
 	movl $(init_thread_union+THREAD_SIZE),%esp
 	jmp xen_start_kernel
+	.previous
 
 .pushsection ".bss.page_aligned"
 	.align PAGE_SIZE_asm
@@ -34,5 +35,6 @@ ENTRY(hypercall_page)
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "no")
 #endif
 	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
+	.previous
 
 #endif /*CONFIG_XEN */

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: [PATCH] Xen i386 xen-head.S fix sections mixup
  2007-08-20  3:04 [PATCH] Xen i386 xen-head.S fix sections mixup Mathieu Desnoyers
@ 2007-08-20  6:13 ` Jeremy Fitzhardinge
  2007-08-20 17:19   ` [PATCH] Xen i386 xen-head.S fix sections mixup (updated) Mathieu Desnoyers
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2007-08-20  6:13 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: chrisw, virtualization, Andrew Morton, xen-devel, jeremy

Mathieu Desnoyers wrote:
> Xen i386 xen-head.S fix sections mixup
>
> xen-head.S does not come back to the data section, leaving the text section
> as current section. It causes problems with a slightly enhanced DEBUG_RODATA
> that supports CONFIG_HOTPLUG and bringing a CPU up after the text has been
> marked read-only: reference to early_gdt_descr causes a page fault.
>   

Thanks.  It should be using pushsection/popsection.

    J

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

* [PATCH] Xen i386 xen-head.S fix sections mixup (updated)
  2007-08-20  6:13 ` Jeremy Fitzhardinge
@ 2007-08-20 17:19   ` Mathieu Desnoyers
  2007-08-20 17:34     ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Desnoyers @ 2007-08-20 17:19 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: chrisw, virtualization, Andrew Morton, xen-devel, jeremy

Xen i386 xen-head.S fix sections mixup

xen-head.S does not come back to the data section, leaving the text section
as current section. It causes problems with a slightly enhanced DEBUG_RODATA
that supports CONFIG_HOTPLUG and bringing a CPU up after the text has been
marked read-only: reference to early_gdt_descr causes a page fault.

Update:

It should be using pushsection/popsection.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: jeremy@xensource.com
CC: chrisw@sous-sol.org
CC: virtualization@lists.osdl.org
CC: xen-devel@lists.xensource.com
---
 arch/i386/xen/xen-head.S |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-2.6-lttng/arch/i386/xen/xen-head.S
===================================================================
--- linux-2.6-lttng.orig/arch/i386/xen/xen-head.S	2007-08-20 00:22:16.000000000 -0400
+++ linux-2.6-lttng/arch/i386/xen/xen-head.S	2007-08-20 13:02:38.000000000 -0400
@@ -7,20 +7,21 @@
 #include <asm/boot.h>
 #include <xen/interface/elfnote.h>
 
-	.section .init.text
+.pushsection .init.text
 ENTRY(startup_xen)
 	movl %esi,xen_start_info
 	cld
 	movl $(init_thread_union+THREAD_SIZE),%esp
 	jmp xen_start_kernel
+.popsection
 
-.pushsection ".bss.page_aligned"
+.pushsection .bss.page_aligned
 	.align PAGE_SIZE_asm
 ENTRY(hypercall_page)
 	.skip 0x1000
 .popsection
 
-	.section .text
+.pushsection .text
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
 	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
@@ -34,5 +35,6 @@ ENTRY(hypercall_page)
 	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "no")
 #endif
 	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
+.popsection
 
 #endif /*CONFIG_XEN */

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

* Re: [PATCH] Xen i386 xen-head.S fix sections mixup (updated)
  2007-08-20 17:19   ` [PATCH] Xen i386 xen-head.S fix sections mixup (updated) Mathieu Desnoyers
@ 2007-08-20 17:34     ` Jeremy Fitzhardinge
  2007-08-20 19:04       ` [PATCH] Xen i386 xen-head.S fix sections mixup (update 2) Mathieu Desnoyers
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2007-08-20 17:34 UTC (permalink / raw)
  To: Mathieu Desnoyers
  Cc: chrisw, virtualization, Andrew Morton, xen-devel, jeremy

Mathieu Desnoyers wrote:
> Xen i386 xen-head.S fix sections mixup
>
> xen-head.S does not come back to the data section, leaving the text section
> as current section. It causes problems with a slightly enhanced DEBUG_RODATA
> that supports CONFIG_HOTPLUG and bringing a CPU up after the text has been
> marked read-only: reference to early_gdt_descr causes a page fault.
>
> Update:
>
> It should be using pushsection/popsection.
>   

Looks good, with one caveat below.

Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com>

> -	.section .text
> +.pushsection .text
>  	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
>  	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
>  	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
> @@ -34,5 +35,6 @@ ENTRY(hypercall_page)
>  	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "no")
>  #endif
>  	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
> +.popsection
>   

Actually, the push/popsections around the ELFNOTEs are redundant;
ELFNOTE() does its own push/popsection to put things into the
appropriate .note* section anyway.

    J

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

* [PATCH] Xen i386 xen-head.S fix sections mixup (update 2)
  2007-08-20 17:34     ` Jeremy Fitzhardinge
@ 2007-08-20 19:04       ` Mathieu Desnoyers
  0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2007-08-20 19:04 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: chrisw, virtualization, Andrew Morton, xen-devel, jeremy

Xen i386 xen-head.S fix sections mixup

xen-head.S does not come back to the data section, leaving the text section
as current section. It causes problems with a slightly enhanced DEBUG_RODATA
that supports CONFIG_HOTPLUG and bringing a CPU up after the text has been
marked read-only: reference to early_gdt_descr causes a page fault.

Updates:

- It should be using pushsection/popsection.
- Actually, the push/popsections around the ELFNOTEs are redundant; ELFNOTE()
  does its own push/popsection to put things into the appropriate .note* section
  anyway.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com>
CC: chrisw@sous-sol.org
CC: virtualization@lists.osdl.org
CC: xen-devel@lists.xensource.com
---
 arch/i386/xen/xen-head.S |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6-lttng/arch/i386/xen/xen-head.S
===================================================================
--- linux-2.6-lttng.orig/arch/i386/xen/xen-head.S	2007-08-20 00:22:16.000000000 -0400
+++ linux-2.6-lttng/arch/i386/xen/xen-head.S	2007-08-20 15:00:55.000000000 -0400
@@ -7,20 +7,20 @@
 #include <asm/boot.h>
 #include <xen/interface/elfnote.h>
 
-	.section .init.text
+.pushsection .init.text
 ENTRY(startup_xen)
 	movl %esi,xen_start_info
 	cld
 	movl $(init_thread_union+THREAD_SIZE),%esp
 	jmp xen_start_kernel
+.popsection
 
-.pushsection ".bss.page_aligned"
+.pushsection .bss.page_aligned
 	.align PAGE_SIZE_asm
 ENTRY(hypercall_page)
 	.skip 0x1000
 .popsection
 
-	.section .text
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
 	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
 	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

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

end of thread, other threads:[~2007-08-20 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20  3:04 [PATCH] Xen i386 xen-head.S fix sections mixup Mathieu Desnoyers
2007-08-20  6:13 ` Jeremy Fitzhardinge
2007-08-20 17:19   ` [PATCH] Xen i386 xen-head.S fix sections mixup (updated) Mathieu Desnoyers
2007-08-20 17:34     ` Jeremy Fitzhardinge
2007-08-20 19:04       ` [PATCH] Xen i386 xen-head.S fix sections mixup (update 2) Mathieu Desnoyers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.