linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Oopses in apply_alternatives
@ 2003-04-23 21:30 Petr Vandrovec
  2003-04-24  3:12 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vandrovec @ 2003-04-23 21:30 UTC (permalink / raw)
  To: rusty; +Cc: linux-kernel

Hi Rusty,
  I somehow missed apply_alternatives inclusion into the kernel, so
I have no idea whether you are right person...

  It is not good idea to call apply_alternatives from module_finalize,
as apply_alternatives is __init function... It spectaculary crashed
here while inserting VMware's vmnet module. In standard kernel 
.altinstructions section occurs (from few modules I have) in uhci-hcd 
and usbcore.

  Patch below appears to fix problem.

vana:/tmp/vmware-config0$ objdump -h vmnet.o

vmnet.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00003f3d  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .fixup        00000014  00000000  00000000  00003f71  2**0
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  2 __ksymtab_strings 00000075  00000000  00000000  00003f85  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 __ksymtab     00000040  00000000  00000000  00003ffc  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  4 .rodata.str1.32 00000ae0  00000000  00000000  00004040  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .rodata.str1.1 000001ba  00000000  00000000  00004b20  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 __ex_table    00000010  00000000  00000000  00004cdc  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  7 .altinstructions 0000000a  00000000  00000000  00004cec  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
  8 .data         00000458  00000000  00000000  00004d00  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  9 .gnu.linkonce.this_module 00000280  00000000  00000000  00005180  2**7
                  CONTENTS, ALLOC, LOAD, RELOC, DATA, LINK_ONCE_DISCARD
 10 .bss          00000058  00000000  00000000  00005400  2**5
                  ALLOC
 11 .comment      0000011a  00000000  00000000  00005400  2**0
                  CONTENTS, READONLY

					Best regards,
						Petr Vandrovec
						vandrove@vc.cvut.cz


--- linux-2.5.68-c1179.dist/arch/i386/kernel/setup.c	2003-04-23 14:13:22.000000000 +0200
+++ linux-2.5.68-c1179/arch/i386/kernel/setup.c	2003-04-23 23:18:45.000000000 +0200
@@ -802,7 +802,7 @@
    APs have less capabilities than the boot processor are not handled. 
     
    In this case boot with "noreplacement". */ 
-void __init apply_alternatives(void *start, void *end) 
+void apply_alternatives(void *start, void *end) 
 { 
 	struct alt_instr *a; 
 	int diff, i, k;

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

* Re: [PATCH] Oopses in apply_alternatives
  2003-04-23 21:30 [PATCH] Oopses in apply_alternatives Petr Vandrovec
@ 2003-04-24  3:12 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2003-04-24  3:12 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel, torvalds

In message <20030423213038.GA6389@vana.vc.cvut.cz> you write:
> Hi Rusty,
>   I somehow missed apply_alternatives inclusion into the kernel, so
> I have no idea whether you are right person...
> 
>   It is not good idea to call apply_alternatives from module_finalize,
> as apply_alternatives is __init function... It spectaculary crashed

Smells of Torvaldism.  I missed it too: you're right,
apply_alternatives should be marked

	__init_or_module

instead.

Thanks!
Rusty.

> @@ -802,7 +802,7 @@
>     APs have less capabilities than the boot processor are not handled. 
>      
>     In this case boot with "noreplacement". */ 
> -void __init apply_alternatives(void *start, void *end) 
> +void apply_alternatives(void *start, void *end) 
>  { 
>  	struct alt_instr *a; 
>  	int diff, i, k;

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

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

end of thread, other threads:[~2003-04-24  4:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 21:30 [PATCH] Oopses in apply_alternatives Petr Vandrovec
2003-04-24  3:12 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).