aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/dma.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2008-11-01x86: Clean up late e820 resource allocationLinus Torvalds1-3/+5
This makes the late e820 resources use 'insert_resource_expand_to_fit()' instead of doing a 'reserve_region_with_split()', and also avoids marking them as IORESOURCE_BUSY. This results in us being perfectly happy to use pre-existing PCI resources even if they were marked as being in a reserved region, while still avoiding any _new_ allocations in the reserved regions. It also makes for a simpler and more accurate resource tree. Example resource allocation from Jonathan Corbet, who has firmware that has an e820 reserved entry that covered a big range (e0000000-fed003ff), and that had various PCI resources in it set up by firmware. With old kernels, the reserved range would force us to re-allocate all pre-existing PCI resources, and his reserved range would end up looking like this: e0000000-fed003ff : reserved fec00000-fec00fff : IOAPIC 0 fed00000-fed003ff : HPET 0 where only the pre-allocated special regions (IOAPIC and HPET) were kept around. With 2.6.28-rc2, which uses 'reserve_region_with_split()', Jonathan's resource tree looked like this: e0000000-fe7fffff : reserved fe800000-fe8fffff : PCI Bus 0000:01 fe800000-fe8fffff : reserved fe900000-fe9d9aff : reserved fe9d9b00-fe9d9bff : 0000:00:1f.3 fe9d9b00-fe9d9bff : reserved fe9d9c00-fe9d9fff : 0000:00:1a.7 fe9d9c00-fe9d9fff : reserved fe9da000-fe9dafff : 0000:00:03.3 fe9da000-fe9dafff : reserved fe9db000-fe9dbfff : 0000:00:19.0 fe9db000-fe9dbfff : reserved fe9dc000-fe9dffff : 0000:00:1b.0 fe9dc000-fe9dffff : reserved fe9e0000-fe9fffff : 0000:00:19.0 fe9e0000-fe9fffff : reserved fea00000-fea7ffff : 0000:00:02.0 fea00000-fea7ffff : reserved fea80000-feafffff : 0000:00:02.1 fea80000-feafffff : reserved feb00000-febfffff : 0000:00:02.0 feb00000-febfffff : reserved fec00000-fed003ff : reserved fec00000-fec00fff : IOAPIC 0 fed00000-fed003ff : HPET 0 and because the reserved entry had been split and moved into the individual resources, and because it used the IORESOURCE_BUSY flag, the drivers that actually wanted to _use_ those resources couldn't actually attach to them: e1000e 0000:00:19.0: BAR 0: can't reserve mem region [0xfe9e0000-0xfe9fffff] HDA Intel 0000:00:1b.0: BAR 0: can't reserve mem region [0xfe9dc000-0xfe9dffff] with this patch, the resource tree instead becomes e0000000-fed003ff : reserved fe800000-fe8fffff : PCI Bus 0000:01 fe9d9b00-fe9d9bff : 0000:00:1f.3 fe9d9c00-fe9d9fff : 0000:00:1a.7 fe9d9c00-fe9d9fff : ehci_hcd fe9da000-fe9dafff : 0000:00:03.3 fe9db000-fe9dbfff : 0000:00:19.0 fe9db000-fe9dbfff : e1000e fe9dc000-fe9dffff : 0000:00:1b.0 fe9dc000-fe9dffff : ICH HD audio fe9e0000-fe9fffff : 0000:00:19.0 fe9e0000-fe9fffff : e1000e fea00000-fea7ffff : 0000:00:02.0 fea80000-feafffff : 0000:00:02.1 feb00000-febfffff : 0000:00:02.0 fec00000-fec00fff : IOAPIC 0 fed00000-fed003ff : HPET 0 ie the one reserved region now ends up surrounding all the PCI resources that were allocated inside of it by firmware, and because it is not marked BUSY, drivers have no problem attaching to the pre-allocated resources. Reported-and-tested-by: Jonathan Corbet <corbet@lwn.net> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01reserve_region_with_split: Fix GFP_KERNEL usage under spinlockLinus Torvalds1-1/+1
This one apparently doesn't generate any warnings, because the function is only used during system bootup, when the warnings are disabled. But it's still very wrong. The __reserve_region_with_split() function is called with the resource_lock held for writing, so it must only ever do GFP_ATOMIC allocations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01remove unused #include <version.h>'sHuang Weiyi2-2/+0
The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION. drivers/leds/leds-hp-disk.c drivers/misc/panasonic-laptop.c This patch removes the said #include <version.h>. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01saner FASYNC handling on file closeAl Viro36-109/+13
As it is, all instances of ->release() for files that have ->fasync() need to remember to evict file from fasync lists; forgetting that creates a hole and we actually have a bunch that *does* forget. So let's keep our lives simple - let __fput() check FASYNC in file->f_flags and call ->fasync() there if it's been set. And lose that crap in ->release() instances - leaving it there is still valid, but we don't have to bother anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01file caps: always start with clear bprm->caps_*Serge Hallyn1-3/+3
While Linux doesn't honor setuid on scripts. However, it mistakenly behaves differently for file capabilities. This patch fixes that behavior by making sure that get_file_caps() begins with empty bprm->caps_*. That way when a script is loaded, its bprm->caps_* may be filled when binfmt_misc calls prepare_binprm(), but they will be cleared again when binfmt_elf calls prepare_binprm() next to read the interpreter's file capabilities. Signed-off-by: Serge Hallyn <serue@us.ibm.com> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Andrew G. Morgan <morgan@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01SELinux: properly handle empty tty_files listEric Paris1-3/+5
SELinux has wrongly (since 2004) had an incorrect test for an empty tty->tty_files list. With an empty list selinux would be pointing to part of the tty struct itself and would then proceed to dereference that value and again dereference that result. An F10 change to plymouth on a ppc64 system is actually currently triggering this bug. This patch uses list_empty() to handle empty lists rather than looking at a meaningless location. [note, this fixes the oops reported in https://bugzilla.redhat.com/show_bug.cgi?id=469079] Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
2008-10-31[CRIS] Remove links from CRIS buildJesper Nilsson5-178/+81
Remove the links to architecture and machine dependent directories (boot, lib, drivers, arch, mach) The links were created and used mostly from the arch/cris/Makefile, so why not dispense with them altogether? Changed $(ARCH) to "cris" in Makefile, it is easier to read this way. The CRISv32 head.S common files for the kernel and compressed images needed to be modified to use ifdefs instead of using the now removed mach link. Since there are only two versions, this is not a huge loss in readability. The link to vmlinux.lds.S is also replaced with a merged version which uses ifdefs to select the correct layout. System.map before and after are identical. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
2008-10-31[CRIS] Merge asm-offsets.c for both arches into one file.Jesper Nilsson3-69/+35
Eliminates the link to arch specific asm-offsets.c from CRIS architecture build system. Resulting asm-offsets.s are identical before and after change for both arch-v10 and arch-v32. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
2008-10-31Revert "powerpc: Sync RPA note in zImage with kernel's RPA note"Paul Mackerras4-145/+52
This reverts commit 91a00302959545a9ae423e99732b1e46eb19e877, plus commit 0dcd440120ef12879ff34fc78d7e4abf171c79e4 ("powerpc: Revert CHRP boot wrapper to real-base = 12MB on 32-bit") which depended on it. Commit 91a00302 was causing NVRAM corruption on some pSeries machines, for as-yet unknown reasons, so this reverts it until the cause is identified. Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Fix compile errors with CONFIG_BUG=nPaul Mackerras1-0/+2
This makes sure we don't try to call find_bug or is_warning_bug when CONFIG_BUG=n and CONFIG_XMON=y. Otherwise we get these errors: arch/powerpc/xmon/xmon.c: In function ‘print_bug_trap’: arch/powerpc/xmon/xmon.c:1364: error: implicit declaration of function ‘find_bug’ arch/powerpc/xmon/xmon.c:1364: warning: assignment makes pointer from integer without a cast arch/powerpc/xmon/xmon.c:1367: error: implicit declaration of function ‘is_warning_bug’ arch/powerpc/xmon/xmon.c:1374: error: dereferencing pointer to incomplete type make[2]: *** [arch/powerpc/xmon/xmon.o] Error 1 make[1]: *** [arch/powerpc/xmon] Error 2 make: *** [sub-make] Error 2 Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Fix format string warning in arch/powerpc/boot/main.cJon Smirl1-1/+1
Fix format string warning in arch/powerpc/boot/main.c. Also correct a typo ("uncomressed") on the same line. BOOTCC arch/powerpc/boot/main.o arch/powerpc/boot/main.c: In function 'prep_kernel': arch/powerpc/boot/main.c:65: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int' Signed-off-by: Jon Smirl <jonsmirl@gmail.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Fix bug in kernel copy of libfdt's fdt_subnode_offset_namelen()David Gibson1-3/+6
There's currently an off-by-one bug in fdt_subnode_offset_namelen() which causes it to keep searching after it's finished the subnodes of the given parent, and into the subnodes of siblings of the original node which come after it in the tree. This bug was introduced in commit ed95d7450dcbfeb45ffc9d39b1747aee82b49a51 ("powerpc: Update in-kernel dtc and libfdt to version 1.2.0"). A patch has already been submitted to dtc/libfdt mainline. We don't really want to pull in a new upstream version during the 2.6.28 cycle, but we should still fix this bug, hence this standalone version of the fix for the in-kernel libfdt. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Remove duplicate DMA entry from mpc8313erdb device treeMike Dyer1-39/+0
Commit 574366128db29e7da609ec1f9c01bf9d80adec87 added a duplicate DMA controller node. Signed-off-by: Mike Dyer <mike.dyer@provision-comm.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-10-31sh: fix sh2a cache entry_maskYoshihiro Shimoda1-4/+4
fix sh2a cache entry_mask in __flush_{purge,invalidate}_region. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: Enable NFS root in Migo-R defconfig.Kuninori Morimoto1-7/+28
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: FTRACE renamed to FUNCTION_TRACER.Paul Mundt4-5/+5
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: Fix up the shared IRQ demuxer's control bit testing logic.Michael Trimarchi2-11/+13
Correct the interrupt handler in sh4 serial device, return the correct value and check for what is anabled in the SCSCR register. The sh7722 is broken just sending a break using minicom. Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31Define SCSPTR1 for SH 7751RMatt Fleming1-0/+1
After the recent commit to kill off SCI/SCIF special casing SH 7751R fails to compile with CONFIG_SH_RTS7751R2D set. This is because SCSPTR1 is undefined. Take the value for SCSPTR1 from the SH7751R Group Hardware Manual. Signed-off-by: Matt Fleming <mjf@gentoo.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: Add sci_rxd_in of SH4-202Nobuhiro Iwamatsu1-2/+8
SH4-202 doesn't have SCSXX1. But it is treated so that there is SCSPTR1 in current code. This patch add sci_rxd_in of SH4-202. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31Add support usb setting on sh 7366Kuninori Morimoto1-0/+28
This patch add usb setting for sh 7366 Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: Change register name SCSPTR to SCSPTR2Nobuhiro Iwamatsu1-1/+1
This change a name of SCSPTR used in sci_rxd_in of SH5-101. SCSPTR is not declared and will become the error. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: use the new byteorder headers.Harvey Harrison1-19/+17
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-31sh: SHmedia ISA tuning fixups.Paul Mundt1-0/+4
SH-5 doesn't support any elaborate ISA inheritance schemes (-dsp, -up, etc.), so only bother with that if we are building an sh32 kernel. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-30sparc64: Add missing null terminating entry to bq4802_match[].David S. Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-31libata: add whitelist for devices with known good pata-sata bridgesJens Axboe2-0/+8
libata currently imposes a UDMA5 max transfer rate and 200 sector max transfer size for SATA devices that sit behind a pata-sata bridge. Lots of devices have known good bridges that don't need this limit applied. The MTRON SSD disks are such devices. Transfer rates are increased by 20-30% with the restriction removed. So add a "blacklist" entry for the MTRON devices, with a flag indicating that the bridge is known good. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-10-31sata_via: fix support for 5287Tejun Heo1-12/+143
5287 used to be treated as vt6420 but it didn't work. It's new family of controllers called vt8251 which hosts four SATA ports as M/S of the two ATA ports. This configuration is rather peculiar in that although the M/S devices are on the same port, each have its own SCR (or equivalent link status/control) registers which screws up the port-link-device hierarchy assumed by libata. Another controller which falls into this category is ata_piix w/ SIDPR access. libata now has facility to deal with this class of controllers named slave_link. A low level driver for such controllers can just call ata_slave_link_init() on the respective ports and libata will handle all the difficult parts like following up with single SRST after hardresetting both ports. This patch creates new controller class vt8251, implements slave_link aware init sequence and config space based SCR access for it and moves 5287 to the new class. This patch is based on Joseph Chan's larger patch which was created before slave_link was implemented in libata. http://thread.gmane.org/gmane.linux.kernel.commits.mm/40640 Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Joseph Chan <JosephChan@via.com.tw> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-10-31libata: Avoid overflow in ata_tf_to_lba48() when tf->hba_lbal > 127Roland Dreier1-1/+1
In ata_tf_to_lba48(), when evaluating (tf->hob_lbal & 0xff) << 24 the expression is promoted to signed int (since int can hold all values of u8). However, if hob_lbal is 128 or more, then it is treated as a negative signed value and sign-extended when promoted to u64 to | into sectors, which leads to the MSB 32 bits of section getting set incorrectly. For example, Phillip O'Donnell <phillip.odonnell@gmail.com> reported that a 1.5GB drive caused: ata3.00: HPA detected: current 2930277168, native 18446744072344861488 where 2930277168 == 0xAEA87B30 and 18446744072344861488 == 0xffffffffaea87b30 which shows the problem when hob_lbal is 0xae. Fix this by adding a cast to u64, just as is used by for hob_lbah and hob_lbam in the function. Reported-by: Phillip O'Donnell <phillip.odonnell@gmail.com> Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-10-31ATA: remove excess kernel-doc notationRandy Dunlap2-3/+0
Remove excess kernel-doc function parameter notation from drivers/ata/: Warning(drivers/ata/libata-core.c:1622): Excess function parameter or struct member 'fn' description in 'ata_pio_queue_task' Warning(drivers/ata/libata-core.c:4655): Excess function parameter or struct member 'err_mask' description in 'ata_qc_complete' Warning(drivers/ata/ata_piix.c:751): Excess function parameter or struct member 'udma' description in 'do_pata_set_dmamode' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-10-31powerpc/cell/OProfile: Fix on-stack array size in activate spu profiling functionCarl Love1-3/+10
The size of the pm_signal_local array should be equal to the number of SPUs being configured in the array. Currently, the array is of size 4 (NR_PHYS_CTRS) but being indexed by a for loop from 0 to 7 (NUM_SPUS_PER_NODE). This could potentially cause an oops or random memory corruption since the pm_signal_local array is on the stack. This fixes it. Signed-off-by: Carl Love <carll@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc/mpic: Fix regression caused by change of default IRQ affinityKumar Gala4-6/+61
The Freescale implementation of MPIC only allows a single CPU destination for non-IPI interrupts. We add a flag to the mpic_init to distinquish these variants of MPIC. We pull in the irq_choose_cpu from sparc64 to select a single CPU as the destination of the interrupt. This is to deal with the fact that the default smp affinity was changed by commit 18404756765c713a0be4eb1082920c04822ce588 ("genirq: Expose default irq affinity mask (take 3)") to be all CPUs. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Update remaining dma_mapping_ops to use map/unmap_pageMark Nelson8-99/+104
After the merge of the 32 and 64bit DMA code, dma_direct_ops lost their map/unmap_single() functions but gained map/unmap_page(). This caused a problem for Cell because Cell's dma_iommu_fixed_ops called the dma_direct_ops if the fixed linear mapping was to be used or the iommu ops if the dynamic window was to be used. So in order to fix this problem we need to update the 64bit DMA code to use map/unmap_page. First, we update the generic IOMMU code so that iommu_map_single() becomes iommu_map_page() and iommu_unmap_single() becomes iommu_unmap_page(). Then we propagate these changes up through all the callers of these two functions and in the process update all the dma_mapping_ops so that they have map/unmap_page rahter than map/unmap_single. We can do this because on 64bit there is no HIGHMEM memory so map/unmap_page ends up performing exactly the same function as map/unmap_single, just taking different arguments. This has no affect on drivers because the dma_map_single_attrs() just ends up calling the map_page() function of the appropriate dma_mapping_ops and similarly the dma_unmap_single_attrs() calls unmap_page(). This fixes an oops on Cell blades, which oops on boot without this because they call dma_direct_ops.map_single, which is NULL. Signed-off-by: Mark Nelson <markn@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc/pci: Fix unmapping of IO space on 64-bitBenjamin Herrenschmidt1-1/+1
A typo/thinko made us pass the wrong argument to __flush_hash_table_range when unplugging bridges, thus not flushing all the translations for the IO space on unplug. The third parameter to __flush_hash_table_range is `end', not `size'. This causes the hypervisor to refuse unplugging slots. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc/pci: Properly allocate bus resources for hotplug PHBsNathan Fontenot3-55/+59
Resources for PHB's that are dynamically added to a system are not properly allocated in the resource tree. Not having these resources allocated causes an oops when removing the PHB when we try to release them. The diff appears a bit messy, this is mainly due to moving everything one tab to the left in the pcibios_allocate_bus_resources routine. The functionality change in this routine is only that the list_for_each_entry() loop is pulled out and moved to the necessary calling routine. Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31OF-device: Don't overwrite numa_node in device registrationJeremy Kerr2-2/+10
Currently, the numa_node of OF-devices will be overwritten during device_register, which simply sets the node to -1. On cell machines, this means that devices can't find their IOMMU, which is referenced through the device's numa node. Set the numa node for OF devices with no parent, and use the lower-level device_initialize and device_add functions, so that the node is preserved. We can remove the call to set_dev_node in of_device_alloc, as it will be overwritten during register. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Fix swapcontext system for VSX + old ucontext sizeMichael Neuling2-39/+30
Since VSX support was added, we now have two sizes of ucontext_t; the older, smaller size without the extra VSX state, and the new larger size with the extra VSX state. A program using the sys_swapcontext system call and supplying smaller ucontext_t structures will currently get an EINVAL error if the task has used VSX (e.g. because of calling library code that uses VSX) and the old_ctx argument is non-NULL (i.e. the program is asking for its current context to be saved). Thus the program will start getting EINVAL errors on calls that previously worked. This commit changes this behaviour so that we don't send an EINVAL in this case. It will now return the smaller context but the VSX MSR bit will always be cleared to indicate that the ucontext_t doesn't include the extra VSX state, even if the task has executed VSX instructions. Both 32 and 64 bit cases are updated. [paulus@samba.org - also fix some access_ok() and get_user() calls] Thanks to Ben Herrenschmidt for noticing this problem. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Fix compiler warning for the relocatable kernelMichael Neuling1-3/+3
Fixes this warning: arch/powerpc/kernel/setup_64.c:447:5: warning: "kernstart_addr" is not defined which arises because PHYSICAL_START is no longer a constant when CONFIG_RELOCATABLE=y. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Work around ld bug in older binutilsPaul Mackerras1-0/+2
Commit 549e8152de8039506f69c677a4546e5427aa6ae7 ("powerpc: Make the 64-bit kernel as a position-independent executable") added lines to vmlinux.lds.S to add the extra sections needed to implement a relocatable kernel. However, those lines seem to trigger a bug in older versions of GNU ld (such as 2.16.1) when building a non-relocatable kernel. Since ld 2.16.1 is still a popular choice for cross-toolchains, this adds an #ifdef to vmlinux.lds.S so the added lines are only included when building a relocatable kernel. Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc/ppc64/kdump: Better flag for running relocatableMilton Miller1-11/+19
The __kdump_flag ABI is overly constraining for future development. As of 2.6.27, the kernel entry point has 4 constraints: Offset 0 is the starting point for the master (boot) cpu (entered with r3 pointing to the device tree structure), offset 0x60 is code for the slave cpus (entered with r3 set to their device tree physical id), offset 0x20 is used by the iseries hypervisor, and secondary cpus must be well behaved when the first 256 bytes are copied to address 0. Placing the __kdump_flag at 0x18 is bad because: - It was taking the last 8 bytes before the iseries hypervisor data. - It was 8 bytes for a boolean flag - It had no way of identifying that the flag was present - It does leave any room for the master to add any additional code before branching, which hurts debug. - It will be unnecessarily hard for 32 bit code to be common (8 bytes) Now that we have eliminated the use of __kdump_flag in favor of the standard is_kdump_kernel(), this flag only controls run without relocating the kernel to PHYSICAL_START (0), so rename it __run_at_load. Move the flag to 0x5c, 1 word before the secondary cpu entry point at 0x60. Initialize it with "run0" to say it will run at 0 unless it is set to 1. It only exists if we are relocatable. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Use is_kdump_kernel()Milton Miller4-8/+7
linux/crash_dump.h defines is_kdump_kernel() to be used by code that needs to know if the previous kernel crashed instead of a (clean) boot or reboot. This updates the just added powerpc code to use it. This is needed for the next commit, which will remove __kdump_flag. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31powerpc: Kexec exit should not use magic numbersMilton Miller3-19/+5
Commit 54622f10a6aabb8bb2bdacf3dd070046f03dc246 ("powerpc: Support for relocatable kdump kernel") added a magic flag value in a register to tell purgatory that it should be a panic kernel. This part is wrong and is reverted by this commit. The kernel gets a list of memory blocks and a entry point from user space. Its job is to copy the blocks into place and then branch to the designated entry point (after turning "off" the mmu). The user space tool inserts a trampoline, called purgatory, that runs before the user supplied code. Its job is to establish the entry environment for the new kernel or other application based on the contents of memory. The purgatory code is compiled and embedded in the tool, where it is later patched using the elf symbol table using elf symbols. Since the tool knows it is creating a purgatory that will run after a kernel crash, it should just patch purgatory (or the kernel directly) if something needs to happen. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-10-31lguest: fix irq vectors.Rusty Russell1-0/+3
do_IRQ: cannot handle IRQ -1 vector 0x20 cpu 0 ------------[ cut here ]------------ kernel BUG at arch/x86/kernel/irq_32.c:219! We're not ISA: we have a 1:1 mapping from vectors to irqs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-10-31lguest: fix early_ioremap.Rusty Russell1-12/+17
dmi_scan_machine breaks under lguest: lguest: unhandled trap 14 at 0xc04edeae (0xffa00000) This is because we use current_cr3 for the read_cr3() paravirt function, and it isn't set until the first cr3 change. We got away with it until this happened. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-10-31lguest: fix example launcher compile after moved asm-x86 dir.Rusty Russell2-2/+2
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-10-31x86: cpu_index build fixIngo Molnar1-0/+2
fix: arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu': arch/x86/kernel/cpu/common.c:553: error: 'struct cpuinfo_x86' has no member named 'cpu_index' as cpu_index is only available on SMP. Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-31x86/voyager: fix missing cpu_index initialisationJames Bottomley2-0/+3
Impact: fix /proc/cpuinfo output on x86/Voyager Ever since | commit 92cb7612aee39642d109b8d935ad265e602c0563 | Author: Mike Travis <travis@sgi.com> | Date: Fri Oct 19 20:35:04 2007 +0200 | | x86: convert cpuinfo_x86 array to a per_cpu array We've had an extra field in cpuinfo_x86 which is cpu_index. Unfortunately, voyager has never initialised this, although the only noticeable impact seems to be that /proc/cpuinfo shows all zeros for the processor ids. Anyway, fix this by initialising the boot CPU properly and setting the index when the secondaries update. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-31x86/voyager: fix compile breakage caused by dc1e35c6e95e8923cf1d3510438b63c600fee1e2James Bottomley3-1/+11
Impact: build fix on x86/Voyager Given commits like this: | Author: Suresh Siddha <suresh.b.siddha@intel.com> | Date: Tue Jul 29 10:29:19 2008 -0700 | | x86, xsave: enable xsave/xrstor on cpus with xsave support Which deliberately expose boot cpu dependence to pieces of the system, I think it's time to explicitly have a variable for it to prevent this continual misassumption that the boot CPU is zero. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-31ftrace: handle archs that do not support irqs_disabled_flagsSteven Rostedt3-10/+20
Impact: build fix on non-lockdep architectures Some architectures do not support a way to read the irq flags that is set from "local_irq_save(flags)" to determine if interrupts were disabled or enabled. Ftrace uses this information to display to the user if the trace occurred with interrupts enabled or disabled. Besides the fact that those archs that do not support this will fail to compile, unless they fix it, we do not want to have the trace simply say interrupts were not disabled or they were enabled, without knowing the real answer. This patch adds a 'X' in the output to let the user know that the architecture they are running on does not support a way for the tracer to determine if interrupts were enabled or disabled. It also lets those same archs compile with tracing enabled. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-30x86: fix /dev/mem mmap breakage when PAT is disabledRavikiran G Thirumalai1-0/+4
Impact: allow /dev/mem mmaps on non-PAT CPUs/platforms Fix mmap to /dev/mem when CONFIG_X86_PAT is off and CONFIG_STRICT_DEVMEM is off mmap to /dev/mem on kernel memory has been failing since the introduction of PAT (CONFIG_STRICT_DEVMEM=n case). Seems like the check to avoid cache aliasing with PAT is kicking in even when PAT is disabled. The bug seems to have crept in 2.6.26. This patch makes sure that the mmap to regular kernel memory succeeds if CONFIG_STRICT_DEVMEM=n and PAT is disabled, and the checks to avoid cache aliasing still happens if PAT is enabled. Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org> Tested-by: Tim Sirianni <tim@scalemp.com> Cc: <stable@kernel.org> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-30powerpc/44x: Update 44x defconfigsJosh Boyer11-258/+630
Update the PowerPC 44x defconfigs for 2.6.28 Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
2008-10-30powerpc/40x: Update 40x defconfigsJosh Boyer7-166/+422
Update the PowerPC 40x defconfigs for 2.6.28 Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>