linux-stable-rt/arch/x86/kernel
Frédéric Weisbecker ac2b86fdef x86/ftrace: use uaccess in atomic context
With latest -tip I get this bug:

[   49.439988] in_atomic():0, irqs_disabled():1
[   49.440118] INFO: lockdep is turned off.
[   49.440118] Pid: 2814, comm: modprobe Tainted: G        W 2.6.27-rc7 #4
[   49.440118]  [<c01215e1>] __might_sleep+0xe1/0x120
[   49.440118]  [<c01148ea>] ftrace_modify_code+0x2a/0xd0
[   49.440118]  [<c01148a2>] ? ftrace_test_p6nop+0x0/0xa
[   49.440118]  [<c016e80e>] __ftrace_update_code+0xfe/0x2f0
[   49.440118]  [<c01148a2>] ? ftrace_test_p6nop+0x0/0xa
[   49.440118]  [<c016f190>] ftrace_convert_nops+0x50/0x80
[   49.440118]  [<c016f1d6>] ftrace_init_module+0x16/0x20
[   49.440118]  [<c015498b>] load_module+0x185b/0x1d30
[   49.440118]  [<c01767a0>] ? find_get_page+0x0/0xf0
[   49.440118]  [<c02463c0>] ? sprintf+0x0/0x30
[   49.440118]  [<c034e012>] ? mutex_lock_interruptible_nested+0x1f2/0x350
[   49.440118]  [<c0154eb3>] sys_init_module+0x53/0x1b0
[   49.440118]  [<c0352340>] ? do_page_fault+0x0/0x740
[   49.440118]  [<c0104012>] syscall_call+0x7/0xb
[   49.440118]  =======================

It is because ftrace_modify_code() calls copy_to_user and
copy_from_user.
These functions have been inserted after guessing that there
couldn't be any race condition but copy_[to/from]_user might
sleep and __ftrace_update_code is called with local_irq_saved.

These function have been inserted since this commit:
d5e92e8978fd2574e415dc2792c5eb592978243d:
"ftrace: x86 use copy from user function"

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-14 10:38:16 +02:00
..
acpi Merge branch 'linus' into x86/quirks 2008-10-12 12:43:21 +02:00
cpu ftrace: mark lapic_wd_event() notrace 2008-10-14 10:34:36 +02:00
.gitignore
Makefile traps: x86: finalize unification of traps.c 2008-10-13 10:33:29 +02:00
alternative.c x86: improve UP kernel when CPU-hotplug and SMP is enabled 2008-10-13 10:33:46 +02:00
amd_iommu.c Merge branches 'core/iommu', 'x86/amd-iommu' and 'x86/iommu' into x86-v28-for-linus-phase3-B 2008-10-10 19:47:12 +02:00
amd_iommu_init.c x86, amd-iommu: propagate PCI device enabling error 2008-10-12 15:24:53 +02:00
aperture_64.c x86, debug printouts: IOMMU setup failures should not be KERN_ERR 2008-09-30 10:25:28 +02:00
apic_32.c Merge branch 'linus' into oprofile-v2 2008-10-13 11:05:51 +02:00
apic_64.c Merge branch 'linus' into oprofile-v2 2008-10-13 11:05:51 +02:00
apm_32.c Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1 2008-10-06 18:17:07 +02:00
asm-offsets.c
asm-offsets_32.c
asm-offsets_64.c
audit_64.c
bios_uv.c
bootflag.c
cpuid.c
crash.c
crash_dump_32.c
crash_dump_64.c Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1 2008-10-06 18:17:07 +02:00
doublefault_32.c x86: fix virt_addr_valid() with CONFIG_DEBUG_VIRTUAL=y, v2 2008-10-13 10:33:15 +02:00
ds.c x86: ds.c ptrace.c integer as NULL pointer sparse fixes 2008-09-24 09:57:47 +02:00
dumpstack_32.c dumpstack: x86: various small unification steps 2008-10-13 10:33:45 +02:00
dumpstack_64.c dumpstack: x86: various small unification steps, fix 2008-10-13 10:33:49 +02:00
e820.c Merge commit 'v2.6.27-rc6' into x86/unify-cpu-detect 2008-09-10 14:00:45 +02:00
early-quirks.c Merge branch 'linus' into x86/quirks 2008-10-12 12:43:21 +02:00
early_printk.c warnings: fix arch/x86/kernel/early_printk.c 2008-10-12 15:19:36 +02:00
efi.c x86: trivial printk fix in efi.c 2008-10-03 10:18:30 +02:00
efi_32.c
efi_64.c
efi_stub_32.S
efi_stub_64.S
entry_32.S ftrace: x86 mcount stub 2008-10-14 10:34:58 +02:00
entry_64.S ftrace: x86 mcount stub 2008-10-14 10:34:58 +02:00
es7000_32.c x86: check dsdt before find oem table for es7000, v2 2008-10-13 10:21:07 +02:00
ftrace.c x86/ftrace: use uaccess in atomic context 2008-10-14 10:38:16 +02:00
genapic_64.c
genapic_flat_64.c
genx2apic_cluster.c
genx2apic_phys.c
genx2apic_uv_x.c x86, UV: new UV genapic functions for x2apic 2008-10-13 10:22:53 +02:00
geode_32.c
head.c x86: print out EBDA/lowmem address 2008-10-13 10:21:10 +02:00
head32.c
head64.c x86_64: be less annoying on boot, v2 2008-09-29 10:04:53 +02:00
head_32.S x86, cpa: rename PTE attribute macros for kernel direct mapping in early boot 2008-10-10 19:29:11 +02:00
head_64.S x86, cpa: rename PTE attribute macros for kernel direct mapping in early boot 2008-10-10 19:29:11 +02:00
hpet.c Merge commit 'v2.6.27-rc6' into timers/hpet 2008-09-14 18:24:00 +02:00
i386_ksyms_32.c
i387.c x86: xsave: set FP, SSE bits in the xsave header in the user sigcontext 2008-10-07 14:36:08 -07:00
i8237.c
i8253.c
i8259.c
init_task.c
io_apic_32.c
io_apic_64.c warnings: fix arch/x86/kernel/io_apic_64.c 2008-10-12 15:22:22 +02:00
io_delay.c
ioport.c
ipi.c
irq_32.c
irq_64.c
irqinit_32.c
irqinit_64.c x86: cleanup, remove extra ifdef 2008-10-13 10:22:44 +02:00
k8.c x86, gart: add detection of AMD family 0x11 northbridges 2008-09-05 19:11:44 +02:00
kdebugfs.c arch/x86/kernel/kdebugfs.c: introduce missing kfree 2008-09-10 14:03:49 +02:00
kgdb.c kgdb, x86: Avoid invoking kgdb_nmicallback twice per NMI 2008-10-06 13:50:59 -05:00
kprobes.c
kvm.c
kvmclock.c
ldt.c Merge branch 'linus' into x86/xen 2008-10-12 12:37:32 +02:00
machine_kexec_32.c
machine_kexec_64.c
mca_32.c
mfgpt_32.c
microcode_amd.c x86, microcode_amd: cleanup, mark request_microcode_user() as unsupported 2008-09-24 10:32:37 +02:00
microcode_core.c x86/microcode: fix sleeping function called from invalid context at kernel/mutex.c 2008-10-02 17:52:33 +02:00
microcode_intel.c x86: moved microcode.c to microcode_intel.c 2008-09-23 12:21:42 +02:00
mmconf-fam10h_64.c
module_32.c
module_64.c
mpparse.c Merge branch 'x86/apic' into x86-v28-for-linus-phase4-B 2008-10-11 20:17:36 +02:00
msr.c
nmi.c x86, NMI watchdog: setup before enabling NMI watchdog 2008-09-22 19:48:19 +02:00
numaq_32.c Merge branch 'x86/apic' into x86-v28-for-linus-phase4-B 2008-10-11 20:17:36 +02:00
olpc.c x86, olpc: fix endian bug in openfirmware workaround 2008-09-24 10:29:04 +02:00
paravirt-spinlocks.c
paravirt.c Merge branch 'linus' into x86/xen 2008-10-12 12:37:32 +02:00
paravirt_patch_32.c
paravirt_patch_64.c
pci-calgary_64.c iommu: export iommu_area_reserve helper function 2008-09-22 16:47:50 +02:00
pci-dma.c Merge branches 'core/iommu', 'x86/amd-iommu' and 'x86/iommu' into x86-v28-for-linus-phase3-B 2008-10-10 19:47:12 +02:00
pci-gart_64.c Merge branches 'core/iommu', 'x86/amd-iommu' and 'x86/iommu' into x86-v28-for-linus-phase3-B 2008-10-10 19:47:12 +02:00
pci-nommu.c x86: export pci-nommu's alloc_coherent 2008-09-25 11:02:25 +02:00
pci-swiotlb_64.c
pcspeaker.c x86: use platform_device_register_simple() 2008-09-22 12:58:36 +02:00
pmtimer_64.c
probe_roms_32.c
process.c Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
process_32.c x86: __show_registers() and __show_regs() API unification 2008-10-13 10:33:04 +02:00
process_64.c x86: __show_registers() and __show_regs() API unification 2008-10-13 10:33:04 +02:00
ptrace.c Merge branches 'x86/xen', 'x86/build', 'x86/microcode', 'x86/mm-debug-v2', 'x86/memory-corruption-check', 'x86/early-printk', 'x86/xsave', 'x86/ptrace-v2', 'x86/quirks', 'x86/setup', 'x86/spinlocks' and 'x86/signal' into x86/core-v2 2008-10-12 15:50:02 +02:00
pvclock.c
quirks.c x86: hpet: modify IXP400 quirk to enable interrupts 2008-09-05 18:59:41 +02:00
reboot.c
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
rtc.c
scx200_32.c
setup.c x86, uv: add early detection of UV system types 2008-10-13 10:21:51 +02:00
setup_percpu.c Merge commit 'v2.6.27-rc7' into x86/debug 2008-09-22 13:08:57 +02:00
sigframe.h Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
signal_32.c Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
signal_64.c Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D 2008-10-11 20:23:20 +02:00
smp.c
smpboot.c x86: remove additional_cpus 2008-10-13 10:33:48 +02:00
smpcommon.c
stacktrace.c
step.c
summit_32.c
sys_i386_32.c
sys_x86_64.c Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1 2008-10-06 18:17:07 +02:00
syscall_64.c
syscall_table_32.S
tce_64.c
test_nx.c
test_rodata.c
time_32.c x86: wrap MCA_bus test around an ifdef 2008-10-13 10:21:47 +02:00
time_64.c x86: move vgetcpu mode probing to cpu detection 2008-10-13 10:21:49 +02:00
tlb_32.c
tlb_64.c
tlb_uv.c
tls.c
tls.h
topology.c
trampoline.c
trampoline_32.S
trampoline_64.S
traps.c dumpstack: x86: move die_nmi to dumpstack_32.c 2008-10-13 10:33:39 +02:00
tsc.c Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1 2008-10-06 18:17:07 +02:00
tsc_sync.c
verify_cpu_64.S
visws_quirks.c
vm86_32.c
vmi_32.c Merge branch 'x86/apic' into x86-v28-for-linus-phase4-B 2008-10-11 20:17:36 +02:00
vmiclock_32.c
vmlinux.lds.S
vmlinux_32.lds.S
vmlinux_64.lds.S x86: fix early panic on amd64 due to typo in supported CPU section 2008-10-12 11:19:27 +02:00
vsmp_64.c x86: fix 27-rc crash on vsmp due to paravirt during module load 2008-09-23 10:31:26 +02:00
vsyscall_64.c
x8664_ksyms_64.c
xsave.c x86, fpu: check __clear_user() return value 2008-10-12 15:17:39 +02:00