Commit Graph

265908 Commits

Author SHA1 Message Date
Will Deacon
1bfcac2772 ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers
commit 8130b9d7b9 upstream.

If we are context switched whilst copying into a thread's
vfp_hard_struct then the partial copy may be corrupted by the VFP
context switching code (see "ARM: vfp: flush thread hwstate before
restoring context from sigframe").

This patch updates the ptrace VFP set code so that the thread state is
flushed before the copy, therefore disabling VFP and preventing
corruption from occurring.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-29 10:09:09 +08:00
Dave Martin
7b93e41954 ARM: 7307/1: vfp: fix ptrace regset modification race
commit 247f4993a5 upstream.

In a preemptible kernel, vfp_set() can be preempted, causing the
hardware VFP context to be switched while the thread vfp state is
being read and modified.  This leads to a race condition which can
cause the thread vfp state to become corrupted if lazy VFP context
save occurs due to preemption in between the time thread->vfpstate
is read and the time the modified state is written back.

This may occur if preemption occurs during the execution of a
ptrace() call which modifies the VFP register state of a thread.
Such instances should be very rare in most realistic scenarios --
none has been reported, so far as I am aware.  Only uniprocessor
systems should be affected, since VFP context save is not currently
lazy in SMP kernels.

The problem was introduced by my earlier patch migrating to use
regsets to implement ptrace.

This patch does a vfp_sync_hwstate() before reading
thread->vfpstate, to make sure that the thread's VFP state is not
live in the hardware registers while the registers are modified.

Thanks to Will Deacon for spotting this.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-29 10:08:43 +08:00
Will Deacon
c94ffc3b1c ARM: 7306/1: vfp: flush thread hwstate before restoring context from sigframe
commit 2af276dfb1 upstream.

Following execution of a signal handler, we currently restore the VFP
context from the ucontext in the signal frame. This involves copying
from the user stack into the current thread's vfp_hard_struct and then
flushing the new data out to the hardware registers.

This is problematic when using a preemptible kernel because we could be
context switched whilst updating the vfp_hard_struct. If the current
thread has made use of VFP since the last context switch, the VFP
notifier will copy from the hardware registers into the vfp_hard_struct,
overwriting any data that had been partially copied by the signal code.

Disabling preemption across copy_from_user calls is a terrible idea, so
instead we move the VFP thread flush *before* we update the
vfp_hard_struct. Since the flushing is performed lazily, this has the
effect of disabling VFP and clearing the CPU's VFP state pointer,
therefore preventing the thread from being updated with stale data on
the next context switch.

Tested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-29 10:08:02 +08:00
Catalin Marinas
fefa6c1370 ARM: 7150/1: Allow kernel unaligned accesses on ARMv6+ processors
commit 8428e84d42 upstream.

Recent gcc versions generate unaligned accesses by default on ARMv6 and
later processors. This patch ensures that the SCTLR.A bit is always
cleared on such processors to avoid kernel traping before
alignment_init() is called.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: John Linn <John.Linn@xilinx.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-05-29 10:06:02 +08:00
宋秀杰
fdbf540e99 rk30 phone: modify headset detect irq level for actul device 2012-05-28 23:16:16 +08:00
hhb
e3d8e46711 rk30 phone loquat: modify lcd driver 2012-05-28 22:33:51 +08:00
hhb
0c70ed1791 Revert "rk30 phone loquat: modify lcd driver"
This reverts commit 0355a52ff6b48bc565dec18ca45bca233e819117.
2012-05-28 22:29:47 +08:00
hhb
8dc8ae11b0 rk30 phone loquat: modify lcd driver 2012-05-28 22:29:47 +08:00
hhb
83d604b555 rk30 phone loquat: optimize touch screen report points 2012-05-28 22:29:47 +08:00
hhb
485d428d32 rk30 phone loquat: fix bug touch screen don't work when resume from suspend 2012-05-28 22:29:47 +08:00
张晴
f8869d536a rk30:phone loquat:reduce arm and logic voltage when pmu enter sleep,set spi gpio pullup and down disable when in sleep 2012-05-28 22:19:05 +08:00
张晴
a2cf542e12 rk30:sdk:Solve the RTC alarm automatic startup 2012-05-28 20:22:36 +08:00
chenxing
d12c9020e9 rk30:sdk: clock_data add cpu 1.1G and 1.3G support 2012-05-28 19:57:55 +08:00
张晴
3317f45d6b rk30:phone loquat:modify the pmu battery charger work quenes 2012-05-28 19:46:44 +08:00
root
eeaa1163b4 camera rk30 : add fps detection code. 2012-05-28 18:49:24 +08:00
张晴
7e937c0cfd rk30:phone loquat:add clk switch from 24M to 32K when in sleep 2012-05-28 18:35:21 +08:00
root
fa21dda874 camera : ov2655 svga series has wrong(added soft sleep),fix it . 2012-05-28 15:35:34 +08:00
黄涛
6583eddfe8 rk30: reset: pll enter slow mode when reset
slow down core periph. fix unable to boot sometime.
2012-05-27 19:11:44 +08:00
黄涛
aeb4f125a5 rk: fiq_debugger: support reboot with command 2012-05-27 18:45:06 +08:00
hhb
7b8ca11798 rk30 phone loauqt: add touch screen synaptics s3202 standar drivers 2012-05-27 15:52:01 +08:00
hhb
76ca4c2356 rk30 phone loauqt: add touch screen synaptics s3202 drivers 2012-05-27 15:50:06 +08:00
hhb
fc98cd32b3 rk30 phone loquat: modify lcd init registers 2012-05-27 15:47:03 +08:00
chenxing
d9f7423f07 rk30:sdk: fix compiled error when disable dvfs in menuconfig 2012-05-25 22:23:35 +08:00
wdc
de451c76c8 Loquate: Add bt sleep and wakeup host function 2012-05-25 18:14:54 +08:00
root
8c1ec65410 camera rk30 : expire time of reinit timer is not accurate,fix it 2012-05-25 10:11:05 +08:00
lw
b60762f147 rk30_phone_loquat:modify sensors orientation 2012-05-24 18:05:18 +08:00
宋秀杰
068a81907d rk30 phone: modify the fmt of codec side in bt and bb incall mode, slove a Uninitialized bug 2012-05-24 16:38:50 +08:00
CMY
9840f354b3 BT: enable bt_wakeup_host irq when system entern deep slep 2012-05-23 18:32:02 +08:00
lw
d60f44699a gsensor:add lis3dh file 2012-05-23 16:04:43 +08:00
lw
e8113fc3ae gsensor:add lis3dh support 2012-05-23 15:36:26 +08:00
lw@rock-chips.com
44caee7170 gsensor:modify gsensor struct name 2012-05-23 15:15:08 +08:00
CMY
884a116a32 Enable bluetooth auto sleep function 2012-05-22 23:12:33 +08:00
张晴
5541fd205e rk30:phone loquat:supply the PMU usb charge 2012-05-22 20:47:57 +08:00
宋秀杰
5d698a48e0 rk30 phone: aic3262 set codec phone call slave 2012-05-22 17:23:19 +08:00
hhb
61dbbb9601 rk30 phone loquat: remove touch screen in defconfig 2012-05-22 14:29:26 +08:00
hwg
6a1396c113 ethernet: solve spin_lock_irqsave problem 2012-05-21 20:20:04 +08:00
root
0e4af9baad camera rk30 : fix ov3640 compile erro. 2012-05-21 15:23:03 +08:00
kfx
693e20b9f6 i2c-dev: struct i2c_msg: be compatible with standard interface 2012-05-21 10:39:03 +08:00
yangkai
cbb6f08877 update for rk30 usbhost multicore process 2012-05-19 11:00:26 +08:00
yangkai
10f680f3cc update rk30 dwc_otg_check_dpdm 2012-05-19 10:50:24 +08:00
ddl
83e861e658 camera: add ov3660 information in rk_camera.h 2012-05-19 10:06:36 +08:00
CMY
86bc06a4ae fix bug for rk903 work in rk29 2012-05-18 20:21:51 +08:00
zsq
c4061043b4 fix rga prescale mode dst height bug 2012-05-18 17:00:51 +08:00
root
afec3ebd9c camera rk30 : change the version to the odd ,0xb,indicate that it's NOT sure the stable one. 2012-05-18 15:25:29 +08:00
hwg
40ebbf4547 BT: modify bcm4330 compile error 2012-05-18 15:18:54 +08:00
许盛飞
20fa9b336b rk29: adc bat bug 2012-05-18 15:14:52 +08:00
root
8b3bdad7ab camera rk30 : the interval time(1s) is too short when stream on,adjust that. 2012-05-18 12:15:00 +08:00
黄涛
c5f1d3c957 rk30: camera: speedup boot time by init async 2012-05-18 09:52:06 +08:00
黄涛
0a708a171b rk30: lcdc: remove set aclk rate code 2012-05-18 09:52:06 +08:00
root
e834f5b525 camera rk30 : add control of pd_cif clock , just reinit the sensor at the first time of no data. 2012-05-17 21:07:05 +08:00