Add a memory barrier to the assembly checksum code - the code was copied
straight from the i386 one, and the patch resyncs the code with the
original. I'll check if the original code can be included directly (i.e.
"#include") after 2.6.9.
Without this patch, every 2.6 UML release corrupts the checksum of every
UDP fragmented packet with size >= MTU (verified by various people, we all
agree on this issue; nobody reported "Works fine here"). The corrupted
packets are not accepted, thus blocking any kind of communication with
large-sized UDP packets.
In fact, I've even dissected the UML -> host traffic before and after this
patch with Ethereal - and it always reported an incorrect checksum for
fragmented UDP packets before and always correct after applying the patch.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: use always a separate io thread for UBD
Currently, ubd=sync is different from replacing ubd#= with ubd#s=. This is
against Principle of Least Surprise, so remove this difference.
Also the current ubd=sync behaviour is completely useless: it is to make sure
that when the kernel has synched its I/O to the virtual disk, the host does
not invalidate this with his caching; this causes ReiserFS corruption.
But since actually we call end_request() only after the io_thread has done its
work, we never lie to the block layer. Using O_SYNC as we do when replacing
ubd#= with ubd#s= is enough.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
From: BlaisorBlade <blaisorblade_spam@yahoo.it>, Chris Wright <chrisw@osdl.org>
Avoid deadlocking onto the request lock in the UBD driver, i.e. don't lock
the queue spinlock when called from the request function.
In detail:
Rename ubd_finish() to __ubd_finish() and remove ubd_io_lock from it. Add
wrapper, ubd_finish(), which grabs lock before calling __ubd_finish(). Update
do_ubd_request to use the lock free __ubd_finish() to avoid deadlock. Also,
apparently prepare_request is called with ubd_io_lock held, so remove locks
there.
Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Makes the UML build system work well even under parallel make (tested, so far,
even with -j50). Please notice that it must be updated for every makefile
change. Or better, every makefile change must use correct dependencies (and
they are easy to miss).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Uml-specific patch (which requires a mainline hook, mailed separately).
This patch avoid the linking kludge which leaves kbuild link vmlinux and then
link it with libc inside linux. This kludge has the big problem of making
kallsyms break, since the kallsyms pass is done on a completely
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: no extraversion in arch/um/Makefile for mainline
Extraversion in arch/um/Makefile is not needed in mainline, but just for
separate patches; also, they should set it in the main Makefile, not elsewhere
(Jeff Garzik has just complained). Also remove the dependency from version.h
on arch/um/Makefile: it was added because arch/um/Makefile could change the
kernel version number.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This forces make to use bash rather than whatever /bin/sh is linked to.
Without this, since there are some bash extensions used in the build and when
/bin/sh isn't bash, then the build fails without a clear error message.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] uml: Set cflags before including arch Makefile
If arch/$(ARCH)/Makefile is included before adding -O2 (and the rest) to
CFLAGS, I must duplicate the addition of it to USER_CFLAGS for UML. So let's
fix this. Also, the below code is useless, since if CONFIG_DEBUG_INFO is y,
then CONFIG_FRAME_POINTER is always y.
Add some updates for API changes in 2.6.8 which were not included in the
original UML patch; these fixes were detected by some warnings, so I probably
missed some more ones.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
James Morris [Wed, 13 Oct 2004 14:28:10 +0000 (07:28 -0700)]
[PATCH] SELinux: fix bugs in mprotect hook
The patch below by Roland McGrath fixes two bugs in the implementation of
the selinux_file_mprotect hook:
It calls selinux_file_mmap, which has two problems. First, the stacked
security module will get both mmap and mprotect callbacks for an
mprotect call, which is wrong. Secondly, the vm_flags value contains
VM_* bits, and these do not match the MAP_* bits of the same name or
function, so it passes bogus flags and causes every mprotect to be
treated as if MAP_SHARED were in use.
The patch shares the common code while not having one function call the
other, and fixes these two bugs.
Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This fixes a bug in SELinux to retain the ptracer SID (if any) across fork.
Otherwise, SELinux will always deny attempts by traced children to exec
domain-changing programs even if the policy would have allowed the tracer
to trace the new domains as well.
Signed-off-by: Stephen Smalley <sds@epoch.ncsc.mil> Signed-off-by: James Morris <jmorris@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Tim Schmielau [Wed, 13 Oct 2004 14:27:49 +0000 (07:27 -0700)]
[PATCH] Fix reporting of process start times
Derive process start times from the posix_clock_monotonic notion of uptime
instead of "jiffies", consistent with the earlier change to /proc/uptime
itself.
(http://linus.bkbits.net:8080/linux-2.5/cset@3ef4851dGg0fxX58R9Zv8SIq9fzNmQ?na%0Av=index.html|src/.|src/fs|src/fs/proc|related/fs/proc/proc_misc.c)
Process start times are reported to userspace in units of 1/USER_HZ since
boot, thus applications as procps need the value of "uptime" to convert
them into absolute time.
Currently "uptime" is derived from an ntp-corrected time base, but process
start time is derived from the free-running "jiffies" counter. This
results in inaccurate, drifting process start times as seen by the user,
even if the exported number stays constant, because the users notion of
"jiffies" changes in time.
It's John Stultz's patch anyways, which I only messed up a bit, but since
people started trading signed-off lines on lkml:
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olaf Kirch [Wed, 13 Oct 2004 14:27:25 +0000 (07:27 -0700)]
[PATCH] auth_domain_lookup fix
This patch makes sure that auth_domain_lookup returns NULL when it doesn't
find a matching entry, rather than the last entry in the hash chain.
Signed-off-by: Olaf Kirch <okir@suse.de> Acked-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hirokazu Takata [Wed, 13 Oct 2004 14:26:37 +0000 (07:26 -0700)]
[PATCH] m32r: remove obsolete system calls
This patch is for removing obsolete system calls from m32r kernel, such as
old_mmap and old_select.
* arch/m32r/kernel/entry.S:
- Remove an obsolete system call, old_mmap, from the syscall table.
* arch/m32r/kernel/sys_m32r.c:
- Remove obsolete system calls, old_mmap() and old_select().
- do_mmap2() is renamed to sys_mmap2().
* CAUTION (for m32r users):
The new kernel (applied this patch) does not have a backward
compatibility. The new kernel and old library pair does not work.
So, those who want to use the new kernel must use a new version of
glibc (the GNU C library), which uses the "mmap2(_NR_mmap2)" syscall
for __mmap() instead of the "old_mmap(__NR_mmap)".
The new glibc package, libc6_2.3.2.ds1-16.0.3_m32r.deb, is provided
on the following site, please apt-get/download it and upgrade.
Andrew Morton [Wed, 13 Oct 2004 14:26:13 +0000 (07:26 -0700)]
[PATCH] revert writeback threshold changes
The post-2.6.8 recent tweaks to the page writeback thresholding code seems to
be doing the wrong thing for small unmapped_ratios - nathans had a few
problems with it. The problem it was trying to fix is minor and fairly
theoretical anyway, so back it out to the old code.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- Remove the setting of CLOCK_REALTIME and CLOCK_MONOTONIC resolution
according to the interpolator resolution since this causes periodic timer
signals to fail. The clocks will still be high-resolution but the
"resolution" reported reflects the timer intervals possible via
timer_settime (also more conformant to what the Single Unix Specification
says).
- Make the IA64 clock_gettime fastcall fall back on negative clock
numbers instead of returning CLOCK_REALTIME.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] megaraid 2.20.4: fix a data corruption bug
Fixes a data corruption issue. Because of a typo in the driver, IO packets
were wrongly shared by the IOCTL path. This caused the whole IO command
to be replaced by an incoming IOCTL command.
Nick Piggin [Mon, 11 Oct 2004 01:26:06 +0000 (18:26 -0700)]
[PATCH] ACPI: check parameter for NULL
ACPI still explodes on my old PII and stops it booting.
Anyway, it is oopsing in drivers/acpi/scan.c line 207 where element
(which is NULL) gets dereferenced.
The ACPI bios on this thing has always seemed to be pretty broken, but
this at least allows the 'power' button to continue to work (the only
reason why I want ACPI).
Dave Jones [Sun, 10 Oct 2004 10:48:06 +0000 (03:48 -0700)]
[PATCH] find_isa_irq_pin can't be __init
As spotted by one of our Fedora users, we sometimes
oops during shutdown (http://www.roberthancock.com/kerneloops.png)
because disable_IO_APIC() wants to call find_isa_irq_pin(),
which we threw away during init.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Len Brown [Sun, 10 Oct 2004 09:21:08 +0000 (05:21 -0400)]
[ACPI] If BIOS disabled the LAPIC, believe it by default.
"lapic" is available to force enabling the LAPIC
in the event you know more than your BIOS vendor.
http://bugzilla.kernel.org/show_bug.cgi?id=3238
Linus Torvalds [Sun, 10 Oct 2004 03:21:04 +0000 (20:21 -0700)]
Use "request_resource()" to properly fix up PCI resource clashes.
This is made possible by the previous resource allocation ordering
patch.
Now that we run the pre-existing PCI resource discovery _before_
ACPI resources have been added, we should not "insert" the resources
into any existing tree. If they clash with existing resources, we
should re-allocate them (later, when we have the full resource map).
Li Shaohua [Sun, 10 Oct 2004 03:15:28 +0000 (20:15 -0700)]
[PATCH] PCI resource allocation re-ordering
This re-orders the PCI and ACPI IO resource assignment as suggested by
Linus.
With this patch, now the sequence of reserving resources is:
1. PCI claim BAR
2. ACPI reserve motherboard resources
3. PNP reserve motherboard resources
4. PCI allocate resources for uninitialized PCI devices
This way the kernel allocates new PCI resources after it has full
knowledge of the resource state, and at the same time allows ACPI and
PnP to be run _after_ we've filled in our knowledge about pre-allocated
resources.
The way it is done is to make the last phase of the original PCI assign
resources code to be an 'fs_initcall', along with the ACPI and PnP
initializations.
The blacklist stuff is broken. When set_using_dma() calls into
->ide_dma_check(), it returns __ide_dma_off() for a blacklisted drive.
This of course succeeds, returning success to the caller of ->ide_dma_check().
Not so good... It then uncondtionally calls ->ide_dma_on(), which turns on
DMA for the drive.
This moves the check to __ide_dma_on() so we also catch the buggy
->ide_dma_check() defined by various chipset drivers.
Sascha Hauer [Sat, 9 Oct 2004 23:05:21 +0000 (00:05 +0100)]
[ARM PATCH] 2073/3: Hynix h720x architecture support
Patch from Sascha Hauer
This patch supports the Hynix developer boards h7201 and h7202 for the
HMS30C7201 and HMS30C7202 CPUs.
Changes to previous patch:
- reorganized file structure. We now have common.c which shares stuff
common to all h720x processors and cpu-h720[12].c files for the cpu
specific stuff
- fixed timer handling for timers 1/2
- cleaned up h720x register definitions and splitted in files specific
to each cpu and one generic part
Signed-off-by: Thomas Gleixner Signed-off-by: Robert Schwebel Signed-off-by: Sascha Hauer
Ali Saidi [Sat, 9 Oct 2004 08:05:14 +0000 (01:05 -0700)]
[PATCH] alpha: cpu mask fix-ups broke SMP DP264 machines in 2.6.8
The cpu mask fix-ups in 2.6.8 broke SMP kernels booting on a DP264.
Instead of not setting the DIM for cpus that did not exit, the patch
inadvertently doesn't set the DIM for CPUs that do exist. Thus no device
interrupts get to the cpu.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck [Sat, 9 Oct 2004 08:04:14 +0000 (01:04 -0700)]
[PATCH] s390: common i/o layer
Common i/o layer changes:
- Fix error handling in io_subchannel_register.
- Fix __MAX_SUBCHANNELS limit checking.
- Clear slow_subchannel structure after kmalloc.
- Update ssd_info if a different device appears at an already known
subchannel to get the correct set of chpids.
- Avoid struct initializers to reduce stack usage of ccwgroup_create,
readall_cmb and io_subchannel_recog,
- Setup fields in pmcw in each retry because msch might fail and a stsch
overwrites them.
- Prevent irq_exit() in cio_tpi from calling do_softirq by adding a
local_bh_disable/__local_bh_enable pair.
- Retry sense id after receiving an unsolicited interrupt.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Colin Leroy [Sat, 9 Oct 2004 08:03:50 +0000 (01:03 -0700)]
[PATCH] therm_adt746x: various fixes
This one removes the other occurences of "°C"; fixes displayed fan speed so
that it uses the same scale than other occurences of this parameter instead
of RPM only; fixes the RPM reading of the fan so that it shows zero instead
of 82 when it is effectively stopped.
Signed-off-by: Colin Leroy <colin@colino.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
hugetblfs appears not to support the creation of files larger than 2GB.
hugetlbfs_vmtruncate() checks against the s_maxbytes member of the super
block and returns EFBIG if the requested file size is too large.
Signed-off-by: Guy Cardwell <gcardwel@motorola.com> Signed-off-by: William Irwin <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ian Campbell [Sat, 9 Oct 2004 08:03:26 +0000 (01:03 -0700)]
[PATCH] pm: console driver fixes
Fix warnings in kernel/power/console.c by only declaring orig_fgconsole
and orig_kmsg when required by SUSPEND_CONSOLE. Restore kmsg_redirect on
resume.
Signed-off-by: Ian Campbell <icampbell@arcom.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Sat, 9 Oct 2004 05:51:39 +0000 (22:51 -0700)]
[PATCH] i2o.h fix
i2o.h uses stuff defined in linux/dma-mapping.h but includes
asm/dma-mapping.h instead. It works by accident on some platforms
(they end up pulling linux/dma-mapping.h from asm-generic/pci-dma-compat.h
before it hits the fan), but breaks on e.g. alpha.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Russell King [Sat, 9 Oct 2004 00:48:34 +0000 (01:48 +0100)]
[PCMCIA] Improve locking for memory resource probing.
- Pass a mask of the regions we wish to be probed to validate_mem
- Only take s->skt_sem if we need to probe resources on a socket
This prevents a deadlock reported by Adam Belay caused by ds.c waiting
with the socket semaphore held for userspace to respond. Meanwhile,
userspace may under some rare circumstances issue a request to read
tuples from the card, which tries to take the socket semaphore again.
Linus Torvalds [Fri, 8 Oct 2004 11:30:54 +0000 (04:30 -0700)]
Update ray_cs Raylink/WebGear wireless driver.
This adds iomem annotations, cleans up the code, fixes
an oops at unload time, and builds in the wireless
extensions that were not getting enabled due to an
obsolete CONFIG_NET_PCMCIA_RADIO test.
Tested by Jean Tourrilhes, who pointed out the wireless
extensions problem.
Russell King [Fri, 8 Oct 2004 16:37:05 +0000 (17:37 +0100)]
[ARM] Remove cache type check before flushing ARMv6 cache.
We do not need to check which type of cache we have before
using using the Harvard or von Neumann cache instructions -
the unimplemented instructions are defined to be NOPs.
David Woodhouse [Fri, 8 Oct 2004 00:36:04 +0000 (17:36 -0700)]
[PATCH] PPC64 Replace cmp instructions with cmpw/cmpd
On Fri, 2004-10-08 at 15:37 +1000, Paul Mackerras wrote:
> This patch replaces cmp{,l}{,i} with cmp{,l}[wd]{,i} as appropriate.
> The original patch was from Segher Boessenkool, slightly modified by
> me.
And also for ppc32 and arch/ppc64/kernel/ItLpQueue.c...
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Fri, 8 Oct 2004 00:35:51 +0000 (17:35 -0700)]
[PATCH] PPC64 Replace cmp instructions with cmpw/cmpd
There were a few places in assembly code in the ppc64 part of the
kernel where we were using the old forms of the compare instruction
(cmp, cmpi, cmpl, cmpli) which don't specify the operand size (word or
doubleword). These have been accepted for a long time for backward
compatibility with the old POWER architecture (and defaulted to a
32-bit comparison) but are now being rejected by the latest versions
of binutils. Some of them were actual bugs in that they were on
things which were actually 64-bit values such as pointers (not that
any of them actually caused a problem in practice).
This patch replaces cmp{,l}{,i} with cmp{,l}[wd]{,i} as appropriate.
The original patch was from Segher Boessenkool, slightly modified by
me.
Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Mackerras [Fri, 8 Oct 2004 00:35:39 +0000 (17:35 -0700)]
[PATCH] PPC64: Remove degree symbol from rtas-proc.c
Alan Cox pointed out that the degree symbol in the thermal sensor proc
files that we have on ppc64 cause problems for people using other
locales or UTF-8. This patch makes them disappear.
Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Some stuffs in ppc_ksyms.c where still #ifdef CONFIG_PPC_PSERIES, which
is no longer set for PowerMac-only configs. Change them to depend on
CONFIG_PPC_MULTIPLATFORM for now. Later on, a bunch of these will be
just gone since those are mostly deprecated functions and I'll move the
exports close to the actual functions.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Currently hostfs passes the rdev value from stat() on the host as rdev
value to return to stat() on the guest; but we cannot pass rdev as is
because glibc and the kernel disagree about its definition. So we must
decode it in a major/minor couple with glibc macros and re-encode it in
kernelspace code.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>