'strace' shows a problem with a missing release_task for self-reaping
clones that have been traced. We need to defer releasing them until the
tracer is done with them, but if the tracer dies, we need to handle that
case gracefully too.
We do that by having 'forget_original_parent()' generate a list of tasks
to release when this case happens.
Patch based on discussions on linux-kernel, and suggestions from Roland
McGrath <roland@redhat.com>.
[PATCH] enable SMP Opterons boot an NX-enabled x86 kernel
This fixes a corner-case NX bug: the x86 SMP kernel doesnt boot on SMP
Opterons if NX is enabled [and mem=nopentium is specified], due to
kernel-space NX protection preventing the SMP trampoline from being
executable.
Since the SMP trampoline is a rare case of 'dynamic code' executed by
the kernel (it has to be below 640K so it cannot be part of the kernel
text itself), i've added the necessary infrastructure to enable/disable
executability of specific kernel pages.
We cannot simply disable NX via the MSR because we've got the NX bits in
the kernel pagetables, which are set up before we do the SMP bootup.
The NX bit in the pagetables is undefined if EFER.NXE is 0, so we cannot
count on NX-capable CPUs not faulting when they encounter them.
I've tested the x86 kernel on a non-NX SMP x86 box and on an NX UP box,
on which i've also tested a simulated SMP trampoline, it all works fine.
- add infrastructure to enable/disable executability of kernel pages
The conversion to ANSI, caused a warning because the mulitcast code needs
a cast. dmi->dmi_addr is a u8 array, and fddi_addr is just a wrapper around a u8 array.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Russell King [Wed, 30 Jun 2004 19:28:19 +0000 (15:28 -0400)]
[PATCH] PCMCIA net device unplugging ordering fix
This is a rather old patch which re-orders the teardown of PCMCIA
network devices. Current device drivers remove the IO mappings,
interrupts, and free any PCMCIA windows before they unregister
themselves from the network layer.
This patch ensures that we first unregister from the network layer
before performing any teardown of resources or windows.
Note: the only card which has been tested in this patch is pcnet_cs.
[PATCH] get rid of __OPTIMIZE__ requirement in net drivers
Several network drivers have checks that they are only built with -O.
This breaks checking with sparse and other tools, and seems like a holdover from
when drivers were built out of tree and the kernel build system was less stable.
This patch gets rid of these.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
This started out from sparse warnings about calling with fddi_broadcast
that is declared const. This fixes that and gets rid of some of the namespace
pollution of this driver by moving the predicate function is_individual, is_broadcast, ...
as inline's in the one file that uses them.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Don Fry [Wed, 30 Jun 2004 19:20:36 +0000 (15:20 -0400)]
[PATCH] pcnet32: correctly program bcr32.
The pcnet32 driver was not correctly enabling MII autonegotiation after
booting when ppc firmware forced the speed/duplex mode of the chip.
After several conversations with AMD this patch corrects the problem.
I have tested this on hardware I have available (ia32 and ppc64) but I
would like wider audience testing of this patch.
Don Fry [Wed, 30 Jun 2004 19:20:18 +0000 (15:20 -0400)]
[PATCH] pcnet32: acknowledge all interrupts early.
A recent change I made broke pcnet32 in a way that allowed real hardware
to work, but broke VMWare. This patch acknowledges all interrupts early
in the pcnet32_interrupt while loop. Without this patch on real hardware
the first transmit operation would clear the 'init' interrupt, but in
VMWare it would rain interrupts. Keith Moore did more testing for me
on VMWare and I did a better job testing on hardware. Petr Vandrovec
correctly pointed out the source of the problem on lkml.
This patch is not needed for 2.4.27-rc1 unless my patch labeled
"pcnet32: recover after rx hang" is applied (which it has not).
Russell King [Tue, 29 Jun 2004 19:26:07 +0000 (20:26 +0100)]
[ARM] Miscellaneous fixes
- Remove 'arc' machine name from Makefile
- clk_set_rate() should return non-zero atm.
- proc-sa1100.S doesn't need asm/ptrace.h
- update mach-types
- kill line of spaces in clock.h
Russell King [Tue, 29 Jun 2004 17:48:23 +0000 (18:48 +0100)]
[ARM] Move arch_adjust_zones to asm/memory.h
This places arch_adjust_zones along side ISA_DMA_THRESHOLD. These
two are related, but having them in separate files means its not
obvious that they are.
ISA_DMA_THRESHOLD is a DMA mask which must be defined such that it
matches the memory handed out by GFP_DMA, which in turn is controlled
by arch_adjust_zones.
Russell King [Tue, 29 Jun 2004 14:39:12 +0000 (15:39 +0100)]
[ARM] Prevent static data in misc.o
Static data causes GOTOFF relocations to be used, which won't work
because we want to relocate the .data section separately from the
.text section. Therefore, force all data to be nonstatic.
Russell King [Tue, 29 Jun 2004 13:33:49 +0000 (14:33 +0100)]
[ARM] Kernel boot decompressor updates
- use 'Image' target for kernel image to be compressed rather than
duplicating its generation.
- use .incbin-based generation of ELF objects from binary data rather
than 'ld'-based generation.
Russell King [Tue, 29 Jun 2004 12:38:54 +0000 (13:38 +0100)]
[ARM] Move ZTEXTADDR/ZBSSADDR initialisation to compressed/Makefile
Since this is where these two variables are used, it makes sense to
have them in that makefile. Also, consolidate "targets"
initialisation, fixes a missing FORCE dependency for the uImage rule,
and remove more FTVPCI code.
Oleg Nesterov [Tue, 29 Jun 2004 12:26:38 +0000 (05:26 -0700)]
[PATCH] kill mm_struct.used_hugetlb
mm_struct.used_hugetlb used to eliminate costly find_vma() from
follow_page(). Now it is used only in ia64 version of follow_huge_addr().
I know nothing about ia64, but this REGION_NUMBER() looks simple enough to
kill used_hugetlb.
There is debug version (commented out) of follow_huge_addr() in i386 which
looks at used_hugetlb, but it can work without this check.
Dave Hansen [Tue, 29 Jun 2004 12:21:13 +0000 (05:21 -0700)]
[PATCH] fix page->count discrepancy for zero page
While writing some analysis tools for memory hot-remove, we came across a
single page which had a ->count that always increased, without bound. It
ended up always being the zero page, and it was caused by a leaked
reference in some do_wp_page() code that ends up avoiding PG_reserved
pages.
Basically what happens is that page_cache_release()/put_page() ignore
PG_reserved pages, while page_cache_get()/get_page() go ahead and take the
reference. So, each time there's a COW fault on the zero-page, you get a
leaked page->count increment.
It's pretty rare to have a COW fault on anything that's PG_reserved, in
fact, I can't think of anything else that this applies to other than the
zero page.
In any case, it the bug doesn't cause any real problems, but it is a bit of
an annoyance and is obviously incorrect. We've been running with this
patch for about 3 months now, and haven't run into any problems with it.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Bottomley [Tue, 29 Jun 2004 12:20:29 +0000 (05:20 -0700)]
[PATCH] dma_get_required_mask()
This patch implements dma_get_required_mask() which may be used by drivers
to probe the optimal DMA descriptor type they should be implementing on the
platform.
I've also tested it this time with the sym_2 driver...making it chose the
correct descriptors for the platform. (although I don't have a 64 bit
platform with >4GB memory, so I only confirmed it selects the 32 bit
descriptors all the time...)
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mika Kukkonen [Tue, 29 Jun 2004 12:20:18 +0000 (05:20 -0700)]
[PATCH] Combined patch for remaining trivial sparse warnings in allnoconfig build
Well, one of these (fs/block_dev.c) is little non-trivial, but i felt
throwing that away would be a shame (and I did add comments ;-).
Also almost all of these have been submitted earlier through other
channels, but have not been picked up (the only controversial is again the
fs/block_dev.c patch, where Linus felt a better job would be done with
__ffs(), but I could not convince myself that is does the same thing as
original code).
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Matt Domsch [Tue, 29 Jun 2004 12:20:06 +0000 (05:20 -0700)]
[PATCH] EDD: store mbr_signature on first 16 int13 devices
Currently, the x86/x86_64 real-mode kernel setup code reads and stores the
mbr_signature (4 bytes in the MBR at offset 440 decimal) for BIOS int13h
device 80h only. This is useful, but not as useful as if we stored such
signatures for all int13h devices. Think OS installer wanting to set up md
software RAID across several BIOS disks.
Patch below against 2.6.7 allows the storing of the mbr_signature for the
first 16 BIOS int13h devices, and exports them via
/sys/firmware/edd/int13_dev8x/mbr_signature as before.
This also merges the three EXPORT_SYMBOLs that setup.c exported for edd.c's
use into one.
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mundt [Tue, 29 Jun 2004 12:19:10 +0000 (05:19 -0700)]
[PATCH] sh64: Fix syscall table alignment
If the syscall table is in the text section, the movi that loads its
address into a register will at link time have its immediates resolved as
though it's an SHmedia symbol, i.e. the LSB will be 1. This is then
misaligned as a base address for loading the address to jump to.
This could be fixed either by moving the table back to the .data section
(as done here), or by masking off the LSB after loading the table address
into a register.
Signed-off-by: Richard Curnow <richard.curnow@superh.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mundt [Tue, 29 Jun 2004 12:18:58 +0000 (05:18 -0700)]
[PATCH] sh64 support
This patch adds sh64 support.
This is a bit overdue, as this was on the should-fix list, though we
weren't done debugging and finishing off the port until just recently (I
did a port against 2.5.68 but it wasn't in any shape to be merged).
sh64 is already in 2.4 and has been for quite awhile, so this is mostly
just a forward port of that code to 2.6 with appropriate bug fixes, etc.
along the way. There isn't much in the way of new features that have been
added to the port yet, though I have added rough hugetlb and oprofile
support.
This patch doesn't really touch any common code, with the exception of an
ifdef or two for keyboard support and an ifdef in fb.h to omit sh64 from
the __raw_xxx() wrapping that sh does.
The only other common driver changes were to sh-sci for serial support, but
those bits were already merged with the latest batch of sh-sci updates.
Beyond that, the port is completely isolated.
Signed-off-by: Richard Curnow <richard.curnow@superh.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tigran Aivazian [Tue, 29 Jun 2004 12:17:15 +0000 (05:17 -0700)]
[PATCH] fix to microcode driver for the old CPUs.
Here is a patch against Linux 2.6.7 which fixes the sigmatch() macro to
work for the relatively old processors as well, which have 'pf == 0'
(processor flags as read from MSR 0x17), For example, the processors
failing without this patch are Pentium II 300 MHz (Klamath) with
family/model/stepping 6/3/4 and 6/3/3.
The patch also contains minor cosmetic changes (to make source code more
uniform).
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Antonino Daplas [Tue, 29 Jun 2004 12:17:04 +0000 (05:17 -0700)]
[PATCH] fbcon: fix display artifacts
Fixed display artifacts present in the space reserved for the boot logo.
Use attributes of the background erase character instead of hardcoding the
color to zero.
Signed-off-by: Antonino A. Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Russell King [Tue, 29 Jun 2004 12:16:41 +0000 (05:16 -0700)]
[PATCH] Provide console_suspend() and console_resume()
Add console_stop() and console_start() methods so the serial drivers
can disable console output before suspending a port, and re-enable output
afterwards.
We also add locking to ensure that we synchronise with any in-progress
printk.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Russell King [Tue, 29 Jun 2004 12:16:30 +0000 (05:16 -0700)]
[PATCH] Provide console_device()
[This patch series has also been separately sent to the architecture
maintainers]
Add console_device() to return the console tty driver structure and the
index. Acquire the console lock while scanning the list of console drivers
to protect us against console driver list manipulations.
Signed-off-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
I am not exactly 100% sure I translated it correctly since I have no idea
what exactly was that NEC v850 evaluation board, but should be OK (say 95%
sure).
Acked by Miles Bader <miles@lsi.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Yoav Zach [Tue, 29 Jun 2004 12:16:08 +0000 (05:16 -0700)]
[PATCH] binfmt misc fd passing via ELF aux vector
The proposed patch uses the aux-vector to pass the fd of the open misc
binary to the interpreter, instead of using argv[1] for that purpose.
Previous patch - open_nonreadable_binaries, offered the option of
binfmt_misc opening the binary on behalf of the interpreter. In case
binfmt_misc is requested to do that it would pass the file-descriptor of
the open binary to the interpreter as its second argument (argv[1]). This
method of passing the file descriptor was suspected to be problematic,
since it changes the command line that users expect to see when using tools
such as 'ps' and 'top'.
The proposed patch changes the method of passing the fd of the open binary
to the translator. Instead of passing it as an argument, binfmt_misc will
request the ELF loader to pass it as a new element in the aux-vector that
it prepares on the stack for ELF interpreter. With this patch, argv[1]
will hold the full path to the binary regardless of whether it opened it or
not.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andy Whitcroft [Tue, 29 Jun 2004 12:15:56 +0000 (05:15 -0700)]
[PATCH] ppc64: fix deadlocks when oopsing while mmap_sem is held
If a fault in the kernel leads to an unexpected protection fault whilst in
a code path which holds mmap_sem we will deadlock in do_page_fault() while
trying to classify the fault. By carefully testing the source of the fault
we can detect and OOPS on the vast majority of these, greatly enhancing
diagnosis of such bugs.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Tue, 29 Jun 2004 12:15:45 +0000 (05:15 -0700)]
[PATCH] x86_64 .init.setup alignment fix
We're now putting 24-byte structures into .init.setup via __setup. But
x86_64's compiler is emitting a `.align 16' in there, so they end up on
32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong.
Fix that up by forcing the compiler to align these structures to sizeof(long).