Commit Graph

2260 Commits

Author SHA1 Message Date
Markus F.X.J. Oberhumer
d347f37227 [PATCH] i386: fix stack alignment for signal handlers
This fixes the setup of the alignment of the signal frame, so that all
signal handlers are run with a properly aligned stack frame.

The current code "over-aligns" the stack pointer so that the stack frame
is effectively always mis-aligned by 4 bytes.  But what we really want
is that on function entry ((sp + 4) & 15) == 0, which matches what would
happen if the stack were aligned before a "call" instruction.

Signed-off-by: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:45:06 -07:00
Linus Torvalds
eb1b74e097 Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-10 08:38:52 -07:00
Jeff Dike
50f72b5794 [PATCH] uml: fix x86_64 with !CONFIG_FRAME_POINTER
UML/x86_64 doesn't run when built with frame pointers disabled.  There
was an implicit frame pointer assumption in the stub segfault handler.
With frame pointers disabled, UML dies on handling its first page fault.

The container-of part of this is from Paolo Giarrusso <blaisorblade@yahoo.it>.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:37:59 -07:00
Rafael J. Wysocki
3dd083255d [PATCH] x86_64: Set up safe page tables during resume
The following patch makes swsusp avoid the possible temporary corruption
of page translation tables during resume on x86-64.  This is achieved by
creating a copy of the relevant page tables that will not be modified by
swsusp and can be safely used by it on resume.

The problem is that during resume on x86-64 swsusp may temporarily
corrupt the page tables used for the direct mapping of RAM.  If that
happens, a page fault occurs and cannot be handled properly, which leads
to the solid hang of the affected system.  This leads to the loss of the
system's state from before suspend and may result in the loss of data or
the corruption of filesystems, so it is a serious issue.  Also, it
appears to happen quite often (for me, as often as 50% of the time).

The problem is related to the fact that (at least) one of the PMD
entries used in the direct memory mapping (starting at PAGE_OFFSET)
points to a page table the physical address of which is much greater
than the physical address of the PMD entry itself.  Moreover,
unfortunately, the physical address of the page table before suspend
(i.e.  the one stored in the suspend image) happens to be different to
the physical address of the corresponding page table used during resume
(i.e.  the one that is valid right before swsusp_arch_resume() in
arch/x86_64/kernel/suspend_asm.S is executed).  Thus while the image is
restored, the "offending" PMD entry gets overwritten, so it does not
point to the right physical address any more (i.e.  there's no page
table at the address pointed to by it, because it points to the address
the page table has been at during suspend).  Consequently, if the PMD
entry is used later on, and it _is_ used in the process of copying the
image pages, a page fault occurs, but it cannot be handled in the normal
way and the system hangs.

In principle we can call create_resume_mapping() from
swsusp_arch_resume() (ie.  from suspend_asm.S), but then the memory
allocations in create_resume_mapping(), resume_pud_mapping(), and
resume_pmd_mapping() must be made carefully so that we use _only_
NosaveFree pages in them (the other pages are overwritten by the loop in
swsusp_arch_resume()).  Additionally, we are in atomic context at that
time, so we cannot use GFP_KERNEL.  Moreover, if one of the allocations
fails, we should free all of the allocated pages, so we need to trace
them somehow.

All of this is done in the appended patch, except that the functions
populating the page tables are located in arch/x86_64/kernel/suspend.c
rather than in init.c.  It may be done in a more elegan way in the
future, with the help of some swsusp patches that are in the works now.

[AK: move some externs into headers, renamed a function]

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:46 -07:00
Paolo 'Blaisorblade' Giarrusso
52a2d3e45e [PATCH] uml: cleanup whitespace for COW driver
Fix whitespace - I split this off the previous patch for easier review.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Paolo 'Blaisorblade' Giarrusso
028c0cc16e [PATCH] uml: cleanup byte order macros for COW driver
After restoring the existing code, make it work also when included in
kernelspace code (which isn't currently the case, but at least this will prevent
people from "fixing" it as just happened).
Whitespace is fixed in next patch - it cluttered the diff too much.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Paolo 'Blaisorblade' Giarrusso
855ec613ca [PATCH] uml: restore include breakage, breaking binary format of COW driver
Commit 44456d37b5, between 2.6.13-rc3 and -rc4,
was a "nice cleanup" which broke something. Revert the offending part.

It broke because:
a) because this part doesn't fall under the description
b) the author didn't know what he was doing here
c) the author didn't try to compile the existing code and see that it worked
   perfectly.
d) the author didn't ask us what was happening
e) you didn't either, and somebody there should have learned that UML is a bit
   different.

In fact, UML is special in linking to host libc and using its includes.

In particular, since host includes always define both __BIG_ENDIAN and
__LITTLE_ENDIAN, ntohll() macros started thinking to be in a big-endian world;
and on-disk compatibility was broken.

Many thanks go to Nix for reporting the problem and correctly diagnosing an
endianness problem.

Btw, this patch restores the previous code, which worked; but the definitions
would be uncorrect if used in kernelspace files.

Next patch addresses that.

Cc: Nix <nix@esperi.org.uk>, Olaf Hering <olh@suse.de>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Paolo 'Blaisorblade' Giarrusso
54a8a2220c [PATCH] uml: allow building .s/.i/.lst files from userspace files
For files which need to include glibc headers (i.e. userspace files), we
specified the correct flags only for .o, not for .s/.lst/.i. Fix this.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Paolo 'Blaisorblade' Giarrusso
9e3d862e5c [PATCH] uml: add mode=skas0 as a synonym of skas0
Too many people were confused by skas0 and tried using "mode=skas0". And after
all, they are right - accept this.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Paolo 'Blaisorblade' Giarrusso
5cd10daa0c [PATCH] Uml: hide commands when not being verbose
Add a missing $(Q) to a "ln" invocation.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-10 08:36:00 -07:00
Richard Purdie
7c3989885c [ARM] 2962/1: scoop: Allow GPIO pin suspend state to be specified
Patch from Richard Purdie

Allow the GPIO pin suspend states to be specified for SCOOP devices.
This is needed for correct operation on the spitz platform.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-10 10:20:06 +01:00
Richard Purdie
1036260e93 [ARM] 2961/1: corgi: Add missing include
Patch from Richard Purdie

Add a missing include from corgi.c

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-10 10:17:45 +01:00
Richard Purdie
97b8e00e85 [ARM] 2960/1: collie: Add missing scoop call parameters
Patch from Richard Purdie

Add some missing parameters from the scoop calls on collie.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-10 10:17:44 +01:00
George G. Davis
19da83f632 [ARM] 2959/1: Add test for invalid LDRD/STRD Rd cases in ARM alignment handler
Patch from George G. Davis

Add test for invalid LDRD/STRD Rd cases in ARM alignment handler
and restore SWP printk KERN_ERR.

Signed-off-by: Steve Longerbeam <slongerbeam@mvista.com>
Signed-off-by: George G. Davis <gdavis@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-10 10:17:44 +01:00
Russell King
ce80cc1481 [ARM] Update mach-types
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-10 09:48:10 +01:00
Sven Hartge
2e457ef667 [SPARC64]: Fix compile error in irq.c
irq.c is missing the inclusion of asm/io.h, which causes
readb() and writeb() the be undefined.

Signed-off-by: Sven Hartge <hartge@ds9.argh.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-08 21:12:04 -07:00
Al Viro
dd0fc66fb3 [PATCH] gfp flags annotations - part 1
- added typedef unsigned int __nocast gfp_t;

 - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
   the same warnings as far as sparse is concerned, doesn't change
   generated code (from gcc point of view we replaced unsigned int with
   typedef) and documents what's going on far better.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-08 15:00:57 -07:00
David S. Miller
ba6399334d [SPARC64]: Fix userland FPU state corruption.
We need to use stricter memory barriers around the block
load and store instructions we use to save and restore the
FPU register file.

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-07 13:30:49 -07:00
Tom 'spot' Callaway
eb98129eec [SPARC32]: Enable generic IOMAP.
This helps some PCI stuff build.

Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-06 22:14:59 -07:00
David S. Miller
2256c13b99 [SPARC64]: Probe for power device on ISA bus too.
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-06 20:43:54 -07:00
Linus Torvalds
edb4a3534a Merge branch 'release' of master.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6 2005-10-06 15:37:09 -07:00
Bryan Sutula
76e677e25d [IA64] Avoid kernel hang during CMC interrupt storm
I've noticed a kernel hang during a storm of CMC interrupts, which was
tracked down to the continual execution of the interrupt handler.

There's code in the CMC handler that's supposed to disable CMC
interrupts and switch to polling mode when it sees a bunch of CMCs.
Because disabling CMCs across all CPUs isn't safe in interrupt context,
the disable is done with a schedule_work().  But with continual CMC
interrupts, the schedule_work() never gets executed.

The following patch immediately disables CMC interrupts for the current
CPU.  This then allows (at least) one CPU to ignore CMC interrupts,
execute the schedule_work() code, and disable CMC interrupts on the rest
of the CPUs.

Acked-by: Keith Owens <kaos@sgi.com>
Signed-off-by: Bryan Sutula <Bryan.Sutula@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2005-10-06 15:04:11 -07:00
Linus Torvalds
5cd9a60cc6 Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-06 15:00:53 -07:00
Linus Torvalds
dce32c781b Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 2005-10-06 14:16:07 -07:00
David S. Miller
9ad98c5b44 [SPARC64]: Fix initrd when net booting.
By allocating early memory for the firmware page tables, we
can write over the beginning of the initrd image.

So what we do now is:

1) Read in firmware translations table while still on the
   firmware's trap table.
2) Switch to Linux trap table.
3) Init bootmem.
4) Build firmware page tables using __alloc_bootmem().

And this keeps the initrd from being clobbered.

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-05 15:12:00 -07:00
Catalin Marinas
e03eb5272b [ARM] 2954/1: Allow D and I cache and branch prediction disabling for ARMv6
Patch from Catalin Marinas

There is no reason to not allow these config options. They are useful when
the hardware has problems.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-05 23:06:36 +01:00
Martin Habets
782c3fd470 [SPARC]: Remove some duplicated sparc32 config items
Remove some duplicated items due to the inclusion of the general
drivers/Kconfig file. These are now taken from drivers/char/Kconfig,
and can be turned off there as well (which is desirable sometimes).

Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-05 12:21:36 -07:00
Benjamin Herrenschmidt
23cb8c297e [PATCH] ppc: Fix timekeeping with HZ=250 on some Mac models
Older Macs which uses the VIA chip timers to calibrate the timebase used
some code that wouldn't work if HZ wasn't divisible by 100...

This fixes it at least for 250.  Not totally perfect but should be
enough for now (so it at least works with the default value which is now
250).

There is still a potential issue with the core using CLOCK_TICK_RATE to
maintain xtime and CLOCK_TICK_RATE value on ppc32 is pure crap, but that
is a different problem, this patch at least brings us back to our
previous situation.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-05 07:33:42 -07:00
Linus Torvalds
50165d8b1d Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-04 15:57:53 -07:00
Andi Kleen
944d2647dd [PATCH] x86_64: Drop global bit from early low mappings
Drop global bit from early low mappings

Suggested by Linus, originally also proposed by Suresh.

This fixes a race condition with early start of udev, originally
tracked down by Suresh B. Siddha. The problem was that switching
to the user space VM would not clear the global low mappings
for the beginning of memory, which lead to memory corruption.

Drop the global bits.

The kernel mapping stays global because it should stay constant.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-04 15:56:52 -07:00
David S. Miller
0835ae0f27 [SPARC64]: Replace cheetah+ code patching with variables.
Instead of code patching to handle the page size fields in
the context registers, just use variables from which we get
the proper values.

Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-04 15:23:20 -07:00
Nicolas Pitre
c2f480869f [ARM] 2952/1: fix a register clobber list
Patch from Nicolas Pitre

If gcc decides to assign lr to %0 we're screwed.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-04 23:17:53 +01:00
Nicolas Pitre
74f8849496 [ARM] 2951/1: fix wrong comment
Patch from Nicolas Pitre

The cmpxchg emulation syscall needs write access.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-04 23:17:52 +01:00
Sascha Hauer
0a5b0aa8a3 [ARM] 2950/1: i.MX gpio setup function
Patch from Sascha Hauer

Current implementation of imx_gpio_mode does not allow to
configure all alternate routing possibilities of the i.MX. With
this patch every bit in the gpio setup registers has a
corresponding bit in the gpio_mode parameter, so every routing
should be possible now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-04 23:17:52 +01:00
Allan Graves
fad1c45c93 [PATCH] uml: Fix sysrq-r support for skas mode
The old code had the IP and SP coming from the registers in the thread
struct, which are completely wrong since those are the userspace
registers.  This fixes that by pulling the correct values from the
jmp_buf in which the kernel state of each thread is stored.

Signed-off-by: Allan Graves <allan.graves@oracle.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-04 13:22:01 -07:00
Jeff Dike
71dc036247 [PATCH] UML - Fix Al's build tidying
Al's build tidying missed one bit from me - without this UML doesn't boot.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Acked-by: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-04 13:22:01 -07:00
Adrian Bunk
3115624eda [SPARC]: "extern inline" doesn't make much sense.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-10-03 17:37:02 -07:00
Ravikiran G Thirumalai
ddea7be0ec [PATCH] x86_64: Fix numa node topology detection for srat based x86_64 boxes
2.6.14-rc2 does not assign cpus to proper nodeids on our em64t numa boxen.
Our boxes use acpi srat for parsing the numa information.

srat_detect_node() used phys_proc_id[] to get to the cpu's local apic id,
but phys_proc_id[] represents the cpu<->initial_apic_id mapping.  The
following patch fixes this problem.  Now apicid_to_node[] is properly
indexed with the local apic id.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-03 10:54:22 -07:00
Linus Torvalds
c77054e518 Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-02 18:28:32 -07:00
Catalin Marinas
2c3a054099 [ARM] 2943/1: Clear the exclusive monitor in v6_early_abort
Patch from Catalin Marinas

Data abort caused by ldrex/strex can leave the exclusive monitor in an
unpredictable state. It is recommended that a clrex/strex is performed to
clear this state.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-02 22:34:35 +01:00
Richard Henderson
d70ddac1bf [PATCH] alpha: fix kernel alignment traps
Pass in the pointer to the on-stack registers rather than using them
directly as the arguments.

Ivan noticed that I missed a spot when purging the registers as first
stack parameter idiom.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-02 14:32:49 -07:00
Linus Torvalds
b620cc2cd8 Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-10-01 17:02:13 -07:00
Sven Henkel
036bfdcb0d [PATCH] ppc32: Add new iBook 12" to PowerMac models table
This adds the new iBook G4 (manufactured after July 2005) to the
PowerMac models table.  The model name (PowerBook6,7) is taken from a
12" iBook, I don't know if it also matches the 14" version.  The patch
applies to a vanilla 2.6.13.2 kernel.

Signed-off-by: Sven Henkel <shenkel@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-01 17:01:48 -07:00
Vincent Sanders
31f919c329 [ARM] 2945/1: ARM fortunet fails to build because of missing include
Patch from Vincent Sanders

When building the fortunet ARM platform it fails to compile because of
missing include.

Signed-off-by: Vincent Sanders <vince@arm.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-01 22:56:34 +01:00
Ananth N Mavinakayanahalli
2d8ab6ad6e [PATCH] ppc64: fix up()/down() usage for kprobe_mutex
The incorrect kprobe_mutex usage on x86_64 had percolated to ppc64 too.
First noticed by Yanmin Zhang.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-01 10:54:47 -07:00
Deepak Saxena
702c96d550 [PATCH] ARM: Fix IXP2000 serial port resource range. For real this time.
Serial port only needs 32 bytes of resource space but we are currently
asking for 64K.

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
[ diff went missing first time due to corrupted patch ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-30 23:04:20 -07:00
Benjamin Herrenschmidt
a9487e48a3 [PATCH] pmac: fix cpufreq for old tipb 550Mhz
The old 550Mhz titanium powerbook can switch to a lower frequency
(500Mhz). A user has been repeately reporting overtemp conditions on his
machine at high speed so this simple patch adds support to PowerMac
cpufreq for this machine. The difference in frequency isn't big but seem
enough to fix that user's problems. The patch has been around for some
time now and doesn't seem to cause any problem, so I suppose it could go
in now.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alain RICHARD <alain.richard@equation.fr>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-30 17:20:20 -07:00
Ravikiran G Thirumalai
85cc5135ac [PATCH] x86_64 early numa init fix
The tests Alok carried out on Petr's box confirmed that cpu_to_node[BP] is
not setup early enough by numa_init_array due to the x86_64 changes in
2.6.14-rc*, and unfortunately set wrongly by the work around code in
numa_init_array().  cpu_to_node[0] gets set with 1 early and later gets set
properly to 0 during identify_cpu() when all cpus are brought up, but
confusing the numa slab in the process.

Here is a quick fix for this.  The right fix obviously is to have
cpu_to_node[bsp] setup early for numa_init_array().  The following patch
will fix the problem now, and the code can stay on even when
cpu_to_node{BP] gets fixed early correctly.

Thanks to Petr for access to his box.

Signed off by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-30 12:41:20 -07:00
Ravikiran G Thirumalai
e6a045a5b8 [PATCH] x86_64: fix the BP node_to_cpumask
Fix the BP node_to_cpumask.  2.6.14-rc* broke the boot cpu bit as the
cpu_to_node(0) is now not setup early enough for numa_init_array.
cpu_to_node[] is setup much later at srat_detect_node on acpi srat based
em64t machines.  This seems like a problem on amd machines too, Tested on
em64t though.  /sys/devices/system/node/node0/cpumap shows up sanely after
this patch.

Signed off by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-30 12:41:20 -07:00
Zhang, Yanmin
2dd960d66b [PATCH] utilization of kprobe_mutex is incorrect on x86_64
The up()/down() orders are incorrect in arch/x86_64/kprobes.c file.
kprobe_mutext is used to protect the free kprobe instruction slot list.
arch_prepare_kprobe applies for a slot from the free list, and
arch_remove_kprobe returns a slot to the free list.  The incorrect up()/down()
orders to operate on kprobe_mutex fail to protect the free list.  If 2 threads
try to get/return kprobe instruction slot at the same time, the free slot list
might be broken, or a free slot might be applied by 2 threads.

Signed-off-by: Zhang Yanmin <Yanmin.zhang@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-30 12:41:20 -07:00