aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
AgeCommit message (Collapse)Author
2008-04-24[POWERPC] 4xx: Fix 460GT support to not enable FPUStefan Roese
The AMCC 460GT doesn't have an FPU so let's not enable support for it. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
2008-04-24[POWERPC] cell: Generalize io-workarounds codeIshizaki Kou
This splits cell io-workaround code into spider-pci dependent code and a generic part, and also moves io-workarounds initialization into cell_setup_phb. Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Mark udbg console as CON_ANYTIME, ie. callable early in bootMichael Ellerman
The udbg console should be safe to call basically at any time after boot. It does not need any per-cpu resources or for the cpu to be online, as long as there is a udbg_putc routine hooked up it should work. So mark it as CON_ANYTIME. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Set udbg_console index to 0Michael Ellerman
Because the udbg_console has CON_ENABLED set, it's possible that when we register it with the console code the index won't be set. This leads to slightly confusing boot messages like: [ 0.000000] console [udbg-1] enabled We could remove CON_ENABLED, but we don't want to do that, we always want the udbg console to be activated, even if the user specified some other console on the command line. The simplest fix seems to be just to set the index to 0 by hand. There is no issue with duplicate udbg consoles, as we guard against registering multiple times in register_early_udbg_console(). Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Raise the upper limit of NR_CPUS and move the pacas into the BSSTony Breeds
This adds the required functionality to fill in all pacas at runtime. With NR_CPUS=1024 text data bss dec hex filename 137 1704032 0 1704169 1a00e9 arch/powerpc/kernel/paca.o :Before 121 1179744 524288 1704153 1a00d9 arch/powerpc/kernel/paca.o :After Also remove unneeded #includes from arch/powerpc/kernel/paca.c Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Clean up misc_64.SKumar Gala
* Removed get_msr(), get_srr0(), and get_srr1() - not used anywhere * Use STACK_FRAME_OVERHEAD instead of magic number Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Discourage people from fiddling with kernel data from prom_initMichael Ellerman
As BenH said the other day, it is an "accident" that prom_init.o is linked with the rest of the kernel. The truth is a little more subtle, prom_init isn't truly bootloader, it does access kernel data in a few places. What we can do is discourage people from adding new code that accesses data outside of prom_init. And hence this patch; from the script: # This script checks prom_init.o to see what external symbols it # is using, if it finds symbols not in the whitelist it returns # an error. The point of this is to discourage people from # intentionally or accidentally adding new code to prom_init.c # which has side effects on other parts of the kernel. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Cleanup asm-offsets.cKumar Gala
* Removed TI_EXECDOMAIN define as its not used anywhere * Use STACK_INT_FRAME_SIZE to allow common define of INT_FRAME_SIZE * Define TI_CPU on both ppc32 & ppc64 (removes an ifdef). Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Clean up access to thread_info in assemblyKumar Gala
Use (31-THREAD_SHIFT) to get to thread_info from stack pointer. This makes the code a bit easier to read and more robust if we ever change THREAD_SHIFT. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Fix new warnings arising from stacktrace patchChristoph Hellwig
Remove the inclusion of asm-offsets.h from stacktrace.c. It isn't supposed to be included in C code and it causes problems with multiple definitions of things. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] 85xx: Add support for relocatable kernel (and booting at non-zero)Kumar Gala
Added support to allow an 85xx kernel to be run from a non-zero physical address (useful for cooperative asymmetric multiprocessing situations and kdump). The support can be configured at compile time by setting CONFIG_PAGE_OFFSET, CONFIG_KERNEL_START, and CONFIG_PHYSICAL_START as desired. Alternatively, the kernel build can set CONFIG_RELOCATABLE. Setting this config option causes the kernel to determine at runtime the physical addresses of CONFIG_PAGE_OFFSET and CONFIG_KERNEL_START. If CONFIG_RELOCATABLE is set, then CONFIG_PHYSICAL_START has no meaning. However, CONFIG_PHYSICAL_START will always be used to set the LOAD program header physical address field in the resulting ELF image. Currently we are limited to running at a physical address that is a multiple of 256M. This is due to how we map TLBs to cover lowmem. This should be fixed to allow 64M or maybe even 16M alignment in the future. It is considered an error to try and run a kernel at a non-aligned physical address. All the magic for this support is accomplished by proper initialization of the kernel memory subsystem and use of ARCH_PFN_OFFSET. The use of ARCH_PFN_OFFSET only affects normal memory and not IO mappings. ioremap uses map_page and isn't affected by ARCH_PFN_OFFSET. /dev/mem continues to allow access to any physical address in the system regardless of how CONFIG_PHYSICAL_START is set. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Fix kernel stack allocation alignmentBenjamin Herrenschmidt
The powerpc kernel stacks need to be naturally aligned, as they contain the thread info at the bottom, which is obtained by clearing the low bits of the stack pointer. However, when using 64K pages, the stack is smaller than a page, so we use kmalloc to allocate it, but that doesn't provide the alignment guarantee we need. It appeared to work so far... until one enables SLUB debugging which then returns unaligned pointers. Ooops... This fixes it by using a slab cache with enforced alignment. It relies on my previous patch that adds a thread_info_cache_init() callback. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24Merge branch 'powerpc-next' of ↵Paul Mackerras
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc
2008-04-24Revert "[POWERPC] Add compat handler for PTRACE_GETSIGINFO"Paul Mackerras
This reverts commit e4cc58944c1e2ce41e3079d4eb60c95e7ce04b2b, as requested by Roland McGrath, because compat_ptrace_request (added in commit e16b27816462de700f9508d86954410c41105dc2, "ptrace: compat_ptrace_request siginfo") now handles this case. Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (42 commits) PCI: Change PCI subsystem MAINTAINER PCI: pci-iommu-iotlb-flushing-speedup PCI: pci_setup_bridge() mustn't be __devinit PCI: pci_bus_size_cardbus() mustn't be __devinit PCI: pci_scan_device() mustn't be __devinit PCI: pci_alloc_child_bus() mustn't be __devinit PCI: replace remaining __FUNCTION__ occurrences PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno() PCI: clean up resource alignment management PCI: aerdrv_acpi.c: remove unneeded NULL check PCI: Update VIA CX700 quirk PCI: Expose PCI VPD through sysfs PCI: iommu: iotlb flushing PCI: simplify quirk debug output PCI: iova RB tree setup tweak PCI: parisc: use generic pci_enable_resources() PCI: ppc: use generic pci_enable_resources() PCI: powerpc: use generic pci_enable_resources() PCI: ia64: use generic pci_enable_resources() ...
2008-04-21Merge branch 'master' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits) [POWERPC] Fix compile breakage for 64-bit UP configs [POWERPC] Define copy_siginfo_from_user32 [POWERPC] Add compat handler for PTRACE_GETSIGINFO [POWERPC] i2c: Fix build breakage introduced by OF helpers [POWERPC] Optimize fls64() on 64-bit processors [POWERPC] irqtrace support for 64-bit powerpc [POWERPC] Stacktrace support for lockdep [POWERPC] Move stackframe definitions to common header [POWERPC] Fix device-tree locking vs. interrupts [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const [POWERPC] Remove unused __max_memory variable [POWERPC] Simplify xics direct/lpar irq_host setup [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ() [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade() [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c [POWERPC] Use asm-generic/bitops/find.h in bitops.h [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup [POWERPC] 85xx: Fix the size of qe muram for MPC8568E [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier. [POWERPC] 86xx: mark functions static, other minor cleanups ...
2008-04-21[POWERPC] ppc32: Fix errata for 603 CPUsKumar Gala
603 CPUs have the same issue that some 750 CPUs have in that they can crash in funny ways if a store from an FPU register instruction is executed on a register that has never been initialized since power on. This patch fixes it by making sure all FP registers have been properly initialized at kernel boot. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-04-20PCI: powerpc: use generic pci_enable_resources()Bjorn Helgaas
Use the generic pci_enable_resources() instead of the arch-specific code. The generic version is functionally equivalent, but uses dev_printk. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-20[POWERPC] Define copy_siginfo_from_user32Roland McGrath
Define the copy_siginfo_from_user32 entry point for powerpc, so that generic CONFIG_COMPAT code can call it. We already had the code rolled into compat_sys_rt_sigqueueinfo, this just moves it out into the canonical function that other arch's define. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-20[POWERPC] Add compat handler for PTRACE_GETSIGINFOAndreas Schwab
Current versions of gdb require a working implementation of PTRACE_GETSIGINFO for proper watchpoint support. Since struct siginfo contains pointers it must be converted when passed to a 32-bit debugger. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-18arch: Remove unnecessary inclusions of asm/semaphore.hMatthew Wilcox
None of these files use any of the functionality promised by asm/semaphore.h. It's possible that they rely on it dragging in some unrelated header file, but I can't build all these files, so we'll have fix any build failures as they come up. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-18Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (58 commits) ide: remove ide_init_default_irq() macro ide: move default IDE ports setup to ide_generic host driver ide: remove obsoleted "idex=noprobe" kernel parameter (take 2) ide: remove needless hwif->irq check from ide_hwif_configure() ide: init hwif->{io_ports,irq} explicitly in legacy VLB host drivers ide: limit legacy VLB host drivers to alpha, x86 and mips cmd640: init hwif->{io_ports,irq} explicitly cmd640: cleanup setup_device_ptrs() ide: add ide-4drives host driver (take 3) ide: remove ppc ifdef from init_ide_data() ide: remove ide_default_io_ctl() macro ide: remove CONFIG_IDE_ARCH_OBSOLETE_INIT ide: add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS (take 2) ppc/pmac: remove no longer needed IDE quirk ppc: don't include <linux/ide.h> ppc: remove ppc_ide_md ppc/pplus: remove ppc_ide_md.ide_init_hwif hook ppc/sandpoint: remove ppc_ide_md hooks ppc/lopec: remove ppc_ide_md hooks ppc/mpc8xx: remove ppc_ide_md hooks ...
2008-04-18[POWERPC] irqtrace support for 64-bit powerpcBenjamin Herrenschmidt
This adds the low level irq tracing hooks to the powerpc architecture needed to enable full lockdep functionality. This is partly based on Johannes Berg's initial version. I removed the asm trampoline that isn't needed (thus improving performance) and modified all sorts of bits and pieces, reworking most of the assembly, etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-18[POWERPC] Stacktrace support for lockdepChristoph Hellwig
This adds stacktrace support for powerpc, which will be needed for lockdep. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-18[POWERPC] Move stackframe definitions to common headerBenjamin Herrenschmidt
This moves various definitions used all over the place to parse stack frames to ptrace.h so only one definition is needed. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-18[POWERPC] Fix device-tree locking vs. interruptsBenjamin Herrenschmidt
Lockdep found out that we can occasionally take the device-tree lock for reading from softirq time (from rtas_token called by the rtas real time clock code called by the NTP code), while we take it occasionally for writing without masking interrupts. The combination of those two can thus deadlock. While some of those cases of interrupt read lock could be fixed (such as caching the RTAS tokens) I figured that taking the lock for writing is so rare (device-tree modification) that we may as well penalize that case and allow reading from interrupts. Thus, this turns all the writers to take the lock with irqs masked to avoid the situation. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-18ppc: remove ppc_ide_mdBartlomiej Zolnierkiewicz
* Add special cases for pplus and prep to ide_default_{irq,io_base}() (+ FIXMEs about the need to use IDE platform host driver instead). * Remove no longer needed ppc_ide_md and struct ide_machdep_calls. * Then remove <linux/ide.h> include from: - arch/powerpc/kernel/setup_32.c - arch/ppc/kernel/ppc_ksyms.c - arch/ppc/kernel/setup.c - arch/ppc/platforms/pplus.c - arch/ppc/platforms/prep_setup.c There should be no functional changes caused by this patch. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17Generic semaphore implementationMatthew Wilcox
Semaphores are no longer performance-critical, so a generic C implementation is better for maintainability, debuggability and extensibility. Thanks to Peter Zijlstra for fixing the lockdep warning. Thanks to Harvey Harrison for pointing out that the unlikely() was unnecessary. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Ingo Molnar <mingo@elte.hu>
2008-04-17[POWERPC] Make Book-E debug handling SMP safeKumar Gala
global_dbcr0 needs to be a per cpu set of save areas instead of a single global on all processors. Also, we switch to using DBCR0_IDM to determine if the user space app is being debugged as its a more consistent way. In the future we should support features like hardware breakpoint and watchpoints which will have DBCR0_IDM set but not necessarily DBCR0_IC (single step). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-04-17[POWERPC] Rework Book-E debug exception handlingKumar Gala
The architecture allows for "Book-E" style debug interrupts to either go to critial interrupts of their own debug interrupt level. To allow for a dynamic kernel to support machines of either type we want to be able to compile in the interrupt handling code for both exception levels. Towards this goal we renamed the debug handling macros to specify the interrupt level in their name (DEBUG_CRIT_EXCEPTION/DebugCrit and DEBUG_DEBUG_EXCEPTION/DebugDebug). Additionally, on the Freescale Book-e parts we expanded the exception stacks to cover the maximum case of needing three exception stacks (normal, machine check and debug). There is some kernel text space optimization to be gained if a kernel is configured for a specific Freescale implementation but we aren't handling that now to allow for the single kernel image support. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-04-17[POWERPC] pseries/phyp dump: Reserve a variable amount of space at bootManish Ahuja
This changes the way we calculate how much space to reserve for the pHyp dump. Currently we reserve 256MB only. With this change, the code first checks to see if an amount has been specified on the boot command line with the "phyp_dump_reserve_size" option, and if so, uses that much. Otherwise it computes 5% of total ram and rounds it down to a multiple of 256MB, and uses the larger of that or 256MB. This is for large systems with a lot of memory (10GB or more). The aim is to have more space available for the kernel on reboot on machines with more resources. Although the dump will be collected pretty fast and the memory released really early on allowing the machine to have the full memory available, this alleviates any issues that can be caused by having way too little memory on very very large systems during those few minutes. Signed-off-by: Manish Ahuja <mahuja@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] Update linker script to properly set physical addressesKumar Gala
We can set LOAD_OFFSET and use the AT attribute on sections and the linker will properly set the physical address of the LOAD program header for us. This allows us to know how the PHYSICAL_START the user configured a kernel with by just looking at the resulting vmlinux ELF. This is pretty much stolen from how x86 does things in their linker scripts. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] Clean up some linker and symbol usageKumar Gala
* PAGE_OFFSET is not always the start of code, use _stext instead. * grab PAGE_SIZE and KERNELBASE from asm/page.h like ppc64 does. Makes the code a bit more common and provide a single place to manipulate the defines for things like kdump. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] 85xx: Cleanup TLB initializationKumar Gala
* Determine the RPN we are running the kernel at runtime rather than using compile time constant for initial TLB * Cleanup adjust_total_lowmem() to respect memstart_addr and be a bit more clear on variables that are sizes vs addresses. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] Efika: Really, don't pretend to be CHRPDavid Woodhouse
Fedora 9 works on Efika without the separate 'device-tree supplement', thanks to the kernel's own fixups. With one exception -- because 'CHRP' still appears on the 'machine:' line in /proc/cpuinfo, the installer misdetects the platform and misconfigures yaboot, putting it into a PReP boot partition instead of in the /boot filesystem where the Efika's firmware could find it. The kernel's fixups for Efika already correct one instance of 'chrp', in the 'device_type' property. This fixes it in the 'CODEGEN,description' property too, since that's what's exposed to userspace in /proc/cpuinfo. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] Fixup softirq preempt countBenjamin Herrenschmidt
This fixes the handling of the preempt count when switching interrupt stacks so that HW interrupt properly get the softirq mask copied over from the previous stack. It also initializes the softirq stack preempt_count to 0 instead of SOFTIRQ_OFFSET, like x86, as __do_softirq() does the increment, and we hit some lockdep checks if we have it twice. That means we do run for a little while off the softirq stack with the preempt-count set to 0, which could be deadly if we try to take a softirq at that point, however we do so with interrupts disabled, so I think we are ok. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-17[POWERPC] Initialize paca->current earlierBenjamin Herrenschmidt
Currently, we initialize the "current" pointer in the PACA (which is used by the "current" macro in the kernel) before calling setup_system(). That means that early_setup() is called with current still "NULL" which is -not- a good idea. It happens to work so far but breaks with lockdep when early code calls printk. This changes it so that all PACAs are statically initialized with __current pointing to the init task. For non-0 CPUs, this is fixed up before use. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-15[POWERPC] iSeries: Make iseries_reg_save private to iSeriesStephen Rothwell
Now that we have the alpaca, the reg_save_ptr is no longer needed in the paca. Eradicate all global uses of it and make it static in the iSeries lpardata.c Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-15[POWERPC] iSeries: Use alternate paca structure for bootingStephen Rothwell
The iSeries HV only needs the first two fields of the paca statically initialised, so create an alternate paca that contains only those and switch to our real paca immediately after boot. This is in order to make the 1024 cpu patches easier since they will no longer have to statically initialise the pacas for iSeries. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-14[POWERPC] Fix handling of unrecoverable SLB miss interruptsPaul Mackerras
If an SLB miss interrupt happens while the RI bit of MSR is zero, we can't just return, because RI being zero indicates that SRR0/SRR1 potentially had live values in them, and the process of taking an interrupt overwrites them. This should never happen, but if it does, we try to print a nice oops message. That doesn't work, however, because the code at unrecov_slb assumes that the MMU has been turned on, but we call it with the MMU off (and have done so since the SLB miss handler was rewritten to run without turning the MMU on) -- except on iSeries, where everything runs with the MMU on. This fixes it by adding the necessary code to turn the MMU on if necessary. Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-14Merge branch 'linux-2.6'Paul Mackerras
2008-04-07[POWERPC] Convert pci and eeh code to of_device_is_availableNathan Lynch
A couple of places are duplicating the function of of_device_is_available; convert them to use it. Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-07[POWERPC] Add hand-coded assembly strcmpSteven Rostedt
We have an assembly version of strncmp for the bootwrapper, but not for the kernel, so we end up using the C version in the kernel. This takes the strncmp code from the bootup and copies it to the kernel proper, adding two instructions so it copes correctly with len==0. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-07[POWERPC] Replace logical-AND by bit-AND in pci_process_ISA_OF_ranges()Roel Kluin
Replace logical "&&" by bit "&" for ISA_SPACE_MASK. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-03[POWERPC] Fix rtas_flash procfs interfaceMaxim Shchetynin
Handling of the proc_dir_entry->count was changed in 2.6.24-rc5. After this change, the default value for pde->count is 1 and not 0 as before. Therefore, if we want to check whether our procfs file is already opened (already in use), we have to check if pde->count is greater than 2 rather than 1. Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com> Signed-off-by: Jens Osterkamp <jens@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-03[POWERPC] Fix iSeries hard irq enabling regressionBenjamin Herrenschmidt
A subtle bug sneaked into iSeries recently. On this platform, we must not normally clear MSR:EE (the hardware external interrupt enable) except for short periods of time. Taking an interrupt while soft-disabled doesn't cause us to clear it for example. The iSeries kernel expects to mostly run with MSR:EE enabled at all times except in a few exception entry/exit code paths. Thus local_irq_enable() doesn't check if it needs to hard-enable as it expects this to be unnecessary on iSeries. However, hard_irq_disable() _does_ cause MSR:EE to be cleared, including on iSeries. A call to it was recently added to the context switch code, thus causing interrupts to become disabled for a long periods of time, causing the iSeries watchdog to kick in under some circumstances and other nasty things. This patch fixes it by making local_irq_enable() properly re-enable MSR:EE on iSeries. It basically removes a return statement here to make iSeries use the same code path as everybody else. That does mean that we might occasionally get spurious decrementer interrupts but I don't think that matters. Another option would have been to make hard_irq_disable() a nop on iSeries but I didn't like it much, in case we have good reasons to hard-disable. Part of the patch is fixes to make sure the hard_enabled PACA field is properly set on iSeries as it used not to be before, since it was mostly unused. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-01[POWERPC] Replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-01[POWERPC] Add kernel parameter to set l3cr for MPC745xRobert Brose
Old-world powermacs don't set L2CR or L3CR on processor upgrade cards. This simple patch allows the setting of L3CR via a kernel parameter (like the existing kernel parameter to set L2CR). Signed-off-by: Robert Brose <bob@qbjnet.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-01[POWERPC] move_device_tree() should be __initGeert Uytterhoeven
WARNING: vmlinux.o(.text+0x1e4c0): Section mismatch in reference from the function .move_device_tree() to the function .init.text:.lmb_alloc_base() The function .move_device_tree() references the function __init .lmb_alloc_base(). This is often because .move_device_tree lacks a __init annotation or the annotation of .lmb_alloc_base is wrong. move_device_tree() is called from early_init_devtree() only, which is __init Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-03-28[POWERPC] Fix missed hardware breakpoints across multiple threadsMichael Ellerman
There is a bug in the powerpc DABR (data access breakpoint) handling, which can result in us missing breakpoints if several threads are trying to break on the same address. The circumstances are that do_page_fault() calls do_dabr(), this clears the DABR (sets it to 0) and sets up the signal which will report to userspace that the DABR was hit. The do_signal() code will restore the DABR value on the way out to userspace. If we reschedule before calling do_signal(), __switch_to() will check the cached DABR value and compare it to the new thread's value, if they match we don't set the DABR in hardware. So if two threads have the same DABR value, and we schedule from one to the other after taking the interrupt for the first thread hitting the DABR, the second thread will run without the DABR set in hardware. The cleanest fix is to move the cache update into set_dabr(), that way we can't forget to do it. Reported-by: Jan Kratochvil <jan.kratochvil@redhat.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>