From: Greg Kroah-Hartman Date: Fri, 3 Oct 2014 20:01:15 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.16.4~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b23ba03c09eed4608b979ba682cd878b84c981d7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: alarmtimer-do-not-signal-sigev_none-timers.patch alarmtimer-lock-k_itimer-during-timer-callback.patch parisc-only-use-mfast-indirect-calls-option-for-32-bit-kernel-builds.patch --- diff --git a/queue-3.10/alarmtimer-do-not-signal-sigev_none-timers.patch b/queue-3.10/alarmtimer-do-not-signal-sigev_none-timers.patch new file mode 100644 index 00000000000..9c34380d801 --- /dev/null +++ b/queue-3.10/alarmtimer-do-not-signal-sigev_none-timers.patch @@ -0,0 +1,52 @@ +From 265b81d23a46c39df0a735a3af4238954b41a4c2 Mon Sep 17 00:00:00 2001 +From: Richard Larocque +Date: Tue, 9 Sep 2014 18:31:04 -0700 +Subject: alarmtimer: Do not signal SIGEV_NONE timers + +From: Richard Larocque + +commit 265b81d23a46c39df0a735a3af4238954b41a4c2 upstream. + +Avoids sending a signal to alarm timers created with sigev_notify set to +SIGEV_NONE by checking for that special case in the timeout callback. + +The regular posix timers avoid sending signals to SIGEV_NONE timers by +not scheduling any callbacks for them in the first place. Although it +would be possible to do something similar for alarm timers, it's simpler +to handle this as a special case in the timeout. + +Prior to this patch, the alarm timer would ignore the sigev_notify value +and try to deliver signals to the process anyway. Even worse, the +sanity check for the value of sigev_signo is skipped when SIGEV_NONE was +specified, so the signal number could be bogus. If sigev_signo was an +unitialized value (as it often would be if SIGEV_NONE is used), then +it's hard to predict which signal will be sent. + +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: Richard Cochran +Cc: Prarit Bhargava +Cc: Sharvil Nanavati +Signed-off-by: Richard Larocque +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/alarmtimer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -421,8 +421,10 @@ static enum alarmtimer_restart alarm_han + { + struct k_itimer *ptr = container_of(alarm, struct k_itimer, + it.alarm.alarmtimer); +- if (posix_timer_event(ptr, 0) != 0) +- ptr->it_overrun++; ++ if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) { ++ if (posix_timer_event(ptr, 0) != 0) ++ ptr->it_overrun++; ++ } + + /* Re-add periodic timers */ + if (ptr->it.alarm.interval.tv64) { diff --git a/queue-3.10/alarmtimer-lock-k_itimer-during-timer-callback.patch b/queue-3.10/alarmtimer-lock-k_itimer-during-timer-callback.patch new file mode 100644 index 00000000000..0f6997b3db3 --- /dev/null +++ b/queue-3.10/alarmtimer-lock-k_itimer-during-timer-callback.patch @@ -0,0 +1,59 @@ +From 474e941bed9262f5fa2394f9a4a67e24499e5926 Mon Sep 17 00:00:00 2001 +From: Richard Larocque +Date: Tue, 9 Sep 2014 18:31:05 -0700 +Subject: alarmtimer: Lock k_itimer during timer callback + +From: Richard Larocque + +commit 474e941bed9262f5fa2394f9a4a67e24499e5926 upstream. + +Locks the k_itimer's it_lock member when handling the alarm timer's +expiry callback. + +The regular posix timers defined in posix-timers.c have this lock held +during timout processing because their callbacks are routed through +posix_timer_fn(). The alarm timers follow a different path, so they +ought to grab the lock somewhere else. + +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: Richard Cochran +Cc: Prarit Bhargava +Cc: Sharvil Nanavati +Signed-off-by: Richard Larocque +Signed-off-by: John Stultz +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/alarmtimer.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/kernel/time/alarmtimer.c ++++ b/kernel/time/alarmtimer.c +@@ -419,8 +419,12 @@ static enum alarmtimer_type clock2alarm( + static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm, + ktime_t now) + { ++ unsigned long flags; + struct k_itimer *ptr = container_of(alarm, struct k_itimer, + it.alarm.alarmtimer); ++ enum alarmtimer_restart result = ALARMTIMER_NORESTART; ++ ++ spin_lock_irqsave(&ptr->it_lock, flags); + if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) { + if (posix_timer_event(ptr, 0) != 0) + ptr->it_overrun++; +@@ -430,9 +434,11 @@ static enum alarmtimer_restart alarm_han + if (ptr->it.alarm.interval.tv64) { + ptr->it_overrun += alarm_forward(alarm, now, + ptr->it.alarm.interval); +- return ALARMTIMER_RESTART; ++ result = ALARMTIMER_RESTART; + } +- return ALARMTIMER_NORESTART; ++ spin_unlock_irqrestore(&ptr->it_lock, flags); ++ ++ return result; + } + + /** diff --git a/queue-3.10/parisc-only-use-mfast-indirect-calls-option-for-32-bit-kernel-builds.patch b/queue-3.10/parisc-only-use-mfast-indirect-calls-option-for-32-bit-kernel-builds.patch new file mode 100644 index 00000000000..a075a189a84 --- /dev/null +++ b/queue-3.10/parisc-only-use-mfast-indirect-calls-option-for-32-bit-kernel-builds.patch @@ -0,0 +1,49 @@ +From d26a7730b5874a5fa6779c62f4ad7c5065a94723 Mon Sep 17 00:00:00 2001 +From: John David Anglin +Date: Mon, 22 Sep 2014 20:54:50 -0400 +Subject: parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds + +From: John David Anglin + +commit d26a7730b5874a5fa6779c62f4ad7c5065a94723 upstream. + +In spite of what the GCC manual says, the -mfast-indirect-calls has +never been supported in the 64-bit parisc compiler. Indirect calls have +always been done using function descriptors irrespective of the +-mfast-indirect-calls option. + +Recently, it was noticed that a function descriptor was always requested +when the -mfast-indirect-calls option was specified. This caused +problems when the option was used in application code and doesn't make +any sense because the whole point of the option is to avoid using a +function descriptor for indirect calls. + +Fixing this broke 64-bit kernel builds. + +I will fix GCC but for now we need the attached change. This results in +the same kernel code as before. + +Signed-off-by: John David Anglin +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/Makefile | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/parisc/Makefile ++++ b/arch/parisc/Makefile +@@ -46,7 +46,12 @@ cflags-y := -pipe + + # These flags should be implied by an hppa-linux configuration, but they + # are not in gcc 3.2. +-cflags-y += -mno-space-regs -mfast-indirect-calls ++cflags-y += -mno-space-regs ++ ++# -mfast-indirect-calls is only relevant for 32-bit kernels. ++ifndef CONFIG_64BIT ++cflags-y += -mfast-indirect-calls ++endif + + # Currently we save and restore fpregs on all kernel entry/interruption paths. + # If that gets optimized, we might need to disable the use of fpregs in the diff --git a/queue-3.10/series b/queue-3.10/series index 513087058d9..bb9e4eac3a0 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -117,3 +117,6 @@ nilfs2-fix-data-loss-with-mmap.patch ocfs2-dlm-do-not-get-resource-spinlock-if-lockres-is-new.patch sched-fix-unreleased-llc_shared_mask-bit-during-cpu-hotplug.patch powerpc-perf-fix-abiv2-kernel-backtraces.patch +parisc-only-use-mfast-indirect-calls-option-for-32-bit-kernel-builds.patch +alarmtimer-do-not-signal-sigev_none-timers.patch +alarmtimer-lock-k_itimer-during-timer-callback.patch