aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/module_64.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-30powerpc: Move local setup.h declarations to arch includesRobert Jennings1-2/+1
Move the few declarations from arch/powerpc/kernel/setup.h into arch/powerpc/include/asm/setup.h. This resolves a sparse warning for arch/powerpc/mm/numa.c which defines do_init_bootmem() but can't include the setup.h header in the prior path. Resolves: arch/powerpc/mm/numa.c:998:13: warning: symbol 'do_init_bootmem' was not declared. Should it be static? Signed-off-by: Robert C Jennings <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2013-10-11powerpc: Make kernel module helper endian-safe.Eugene Surovegin1-0/+16
Signed-off-by: Eugene Surovegin <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2013-01-10powerpc: Build kernel with -mcmodel=mediumAnton Blanchard1-0/+30
Finally remove the two level TOC and build with -mcmodel=medium. Unfortunately we can't build modules with -mcmodel=medium due to the tricks the kernel module loader plays with percpu data: # -mcmodel=medium breaks modules because it uses 32bit offsets from # the TOC pointer to create pointers where possible. Pointers into the # percpu data area are created by this method. # # The kernel module loader relocates the percpu data section from the # original location (starting with 0xd...) to somewhere in the base # kernel percpu data space (starting with 0xc...). We need a full # 64bit relocation for this to work, hence -mcmodel=large. On older kernels we fall back to the two level TOC (-mminimal-toc) Signed-off-by: Anton Blanchard <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2011-07-24modules: make arch's use default loader hooksJonas Bonn1-10/+0
This patch removes all the module loader hook implementations in the architecture specific code where the functionality is the same as that now provided by the recently added default hooks. Signed-off-by: Jonas Bonn <[email protected]> Acked-by: Mike Frysinger <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Tested-by: Michal Simek <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2009-02-23powerpc: Unify opcode definitions and supportKumar Gala1-1/+1
Create a new header that becomes a single location for defining PowerPC opcodes used by code that is either generationg instructions at runtime (fixups, debug, etc.), emulating instructions, or just compiling instructions old assemblers don't know about. We currently don't handle the floating point emulation or alignment decode as both are better handled by the specific decode support they already have. Added support for the new dcbzl, dcbal, msgsnd, tlbilx, & wait instructions since older assemblers don't know about them. Signed-off-by: Kumar Gala <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2008-11-20powerpc/ppc64: ftrace, handle module trampolines for dyn ftraceSteven Rostedt1-0/+13
Impact: Allow 64 bit PowerPC to trace modules with dynamic ftrace This adds code to handle the PPC64 module trampolines, and allows for PPC64 to use dynamic ftrace. Thanks to Paul Mackerras for these updates: - fix the mod and rec->arch.mod NULL checks. - fix to is_bl_op compare. Thanks to Milton Miller for: - finding the nasty race with using two nops, and recommending instead that I use a branch 8 forward. Signed-off-by: Steven Rostedt <[email protected]>
2008-09-17Fix compile failure with non modular buildsJames Bottomley1-19/+0
Commit deac93df26b20cf8438339b5935b5f5643bc30c9 ("lib: Correct printk %pF to work on all architectures") broke the non modular builds by moving an essential function into modules.c. Fix this by moving it out again and into asm/sections.h as an inline. To do this, the definition of struct ppc64_opd_entry has been lifted out of modules.c and put in asm/elf.h where it belongs. Signed-off-by: James Bottomley <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2008-09-09lib: Correct printk %pF to work on all architecturesJames Bottomley1-1/+12
It was introduced by "vsprintf: add support for '%pS' and '%pF' pointer formats" in commit 0fe1ef24f7bd0020f29ffe287dfdb9ead33ca0b2. However, the current way its coded doesn't work on parisc64. For two reasons: 1) parisc isn't in the #ifdef and 2) parisc has a different format for function descriptors Make dereference_function_descriptor() more accommodating by allowing architecture overrides. I put the three overrides (for parisc64, ppc64 and ia64) in arch/kernel/module.c because that's where the kernel internal linker which knows how to deal with function descriptors sits. Signed-off-by: James Bottomley <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tony Luck <[email protected]> Acked-by: Kyle McMartin <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-01powerpc: Add PPC_NOP_INSTR, a hash define for the preferred nop instructionMichael Ellerman1-1/+2
A bunch of code has hard-coded the value for a "nop" instruction, it would be nice to have a #define for it. Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Kumar Gala <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2008-07-01powerpc: Move common module code into its own fileKumar Gala1-78/+0
Refactor common code between ppc32 and ppc64 module handling into a shared filed. Signed-off-by: Kumar Gala <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2007-12-21[POWERPC] Optimize counting distinct entries in the relocation sectionsEmil Medve1-17/+64
When a module has relocation sections with tens of thousands of entries, counting the distinct/unique entries only (i.e. no duplicates) at load time can take tens of seconds and up to minutes. The sore point is the count_relocs() function which is called as part of the architecture specific module loading processing path: -> load_module() generic -> module_frob_arch_sections() arch specific -> get_plt_size() 32-bit -> get_stubs_size() 64-bit -> count_relocs() Here count_relocs is being called to find out how many distinct targets of R_PPC_REL24 relocations there are, since each distinct target needs a PLT entry or a stub created for it. The previous counting algorithm has O(n^2) complexity. Basically two solutions were proposed on the e-mail list: a hash based approach and a sort based approach. The hash based approach is the fastest (O(n)) but the has it needs additional memory and for certain corner cases it could take lots of memory due to the degeneration of the hash. One such proposal was submitted here: http://ozlabs.org/pipermail/linuxppc-dev/2007-June/037641.html The sort based approach is slower (O(n * log n + n)) but if the sorting is done "in place" it doesn't need additional memory. This has O(n + n * log n) complexity with no additional memory requirements. This commit implements the in-place sort option. Signed-off-by: Emil Medve <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2006-12-11[POWERPC] Generic BUG for powerpcJeremy Fitzhardinge1-17/+6
This makes powerpc use the generic BUG machinery. The biggest reports the function name, since it is redundant with kallsyms, and not needed in general. There is an overall reduction of code, since module_32/64 duplicated several functions. Unfortunately there's no way to tell gcc that BUG won't return, so the BUG macro includes a goto loop. This will generate a real jmp instruction, which is never used. [[email protected]: build fix] [[email protected]: remove infinite loop in BUG_ON] Signed-off-by: Jeremy Fitzhardinge <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Hugh Dickens <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Rusty Russell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2006-10-25[POWERPC] Support feature fixups in modulesBenjamin Herrenschmidt1-9/+40
This patch adds support for feature fixups in modules. This involves adding support for R_PPC64_REL64 relocs to the 64 bits module loader. It also modifies modpost.c to ignore the powerpc fixup sections (or it would warn when used in .init.text). Signed-off-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
2006-04-28[PATCH] powerpc64: Fix loading of modules without a .toc sectionAlan Modra1-4/+12
Normally, ppc64 module .ko files contain a table-of-contents (.toc) section, but if the module doesn't reference any static or external data or external procedures, it is possible for gcc/binutils to generate a .ko that doesn't have a .toc. Currently the module loader refuses to load such a module, since it needs the address of the .toc section to use in relocations. This patch fixes the problem by using the address of the .stubs section instead, which is an acceptable substitute in this situation. Signed-off-by: Paul Mackerras <[email protected]>
2005-11-14powerpc: Move most remaining ppc64 files over to arch/powerpcPaul Mackerras1-0/+455
Also deletes files in arch/ppc64 that are no longer used now that we don't compile with ARCH=ppc64 any more. Signed-off-by: Paul Mackerras <[email protected]>