From patchwork Fri Sep 13 17:03:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 2891291 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1E3899F1C0 for ; Fri, 13 Sep 2013 17:03:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB9D8202C4 for ; Fri, 13 Sep 2013 17:03:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BE86202C3 for ; Fri, 13 Sep 2013 17:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426Ab3IMRDi (ORCPT ); Fri, 13 Sep 2013 13:03:38 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:35153 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752587Ab3IMRDh (ORCPT ); Fri, 13 Sep 2013 13:03:37 -0400 Received: by mail-wg0-f50.google.com with SMTP id f12so1417527wgh.17 for ; Fri, 13 Sep 2013 10:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Q5CcVjd4cTra97iGnbgTP/UAKlWWU7+KlFMWd0oZAac=; b=hyCvgPdb/n8o8wIB9V5H40qNqt1ObKzf5YZipNaGUcLYpm9OwqvCLnsXiigMQzhWo/ mKicviEzEBSPyCDncdm9gRgFQrqFDoK88RA9wTH2el791d5W8wwosi29sTc/qOTlAR88 eGZ/hWuPZomXLb3GrRAuWTtekgWounBpoJ93+9TAUQ6MQXW6MUeatfAcAZdye9m8Av6j DAh5qlVb+BSYodFdnA1804HJb+d7gzvVERZo3CW/sBpxRdiePygi+HaQP9KliXddLYYu Emoc85xuGs4URY1HFghrysrcyWJMGF+ZSJxifrcwD55Y/ZjbRZr2yq016cnDbHxGgyO5 Rb6w== X-Received: by 10.194.242.200 with SMTP id ws8mr2072883wjc.60.1379091816715; Fri, 13 Sep 2013 10:03:36 -0700 (PDT) Received: from localhost (64.104.89.79.rev.sfr.net. [79.89.104.64]) by mx.google.com with ESMTPSA id dx7sm4901949wib.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 10:03:36 -0700 (PDT) Date: Fri, 13 Sep 2013 19:03:34 +0200 From: Frederic Weisbecker To: Kevin Hilman Cc: Nicolas Pitre , Guenter Roeck , Russell King - ARM Linux , Anil Kumar , "linux-omap@vger.kernel.org" , linux-arm , Tony Lindgren , "devicetree-discuss@lists.ozlabs.org" , Benoit Cousson Subject: [PATCH] arm: Fix build error with context tracking calls Message-ID: <20130913170331.GA8453@somewhere> References: <20130908090206.GK25647@n2100.arm.linux.org.uk> <522CB0DE.2010102@roeck-us.net> <20130909105115.GL25647@n2100.arm.linux.org.uk> <522DB86A.8010207@roeck-us.net> <20130909160348.GB18975@roeck-us.net> <20130909203141.GM25647@n2100.arm.linux.org.uk> <20130909210203.GC28416@roeck-us.net> <87y574g1fi.fsf@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87y574g1fi.fsf@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Sep 10, 2013 at 08:07:45AM -0700, Kevin Hilman wrote: > Nicolas Pitre writes: > > > Adding Kevin Hilman to the CC as he might be interested as well. > > Thanks, I'd already noticed this but was distracted getting arm-soc > changes ready for the merge window. Looking into it now. Kevin, can you please try this patch? It built tested fine on ARM and live tested correctly on x86. There should be no problem but just in case. Thanks! Tested-by: Kevin Hilman --- From 9bb601401baea0a2b2eead3909a9f186d894d617 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Tue, 10 Sep 2013 00:54:17 +0200 Subject: [PATCH] arm: Fix build error with context tracking calls ad65782fba50 (context_tracking: Optimize main APIs off case with static key) converted context tracking main APIs to inline functions and left ARM asm callers behind. This can be easily fixed by making ARM calling the post static keys context tracking functions. We just need to replicate the static key checks there. We'll remove these later when ARM will support the context tracking static keys. Reported-by: Guenter Roeck Reported-by: Russell King Signed-off-by: Frederic Weisbecker Cc: Kevin Hilman Cc: Guenter Roeck Cc: Nicolas Pitre Cc: Anil Kumar Cc: Tony Lindgren Cc: Benoit Cousson --- arch/arm/kernel/entry-header.S | 8 ++++---- kernel/context_tracking.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index de23a9b..39f89fb 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S @@ -329,10 +329,10 @@ #ifdef CONFIG_CONTEXT_TRACKING .if \save stmdb sp!, {r0-r3, ip, lr} - bl user_exit + bl context_tracking_user_exit ldmia sp!, {r0-r3, ip, lr} .else - bl user_exit + bl context_tracking_user_exit .endif #endif .endm @@ -341,10 +341,10 @@ #ifdef CONFIG_CONTEXT_TRACKING .if \save stmdb sp!, {r0-r3, ip, lr} - bl user_enter + bl context_tracking_user_enter ldmia sp!, {r0-r3, ip, lr} .else - bl user_enter + bl context_tracking_user_enter .endif #endif .endm diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 247091b..859c8df 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -51,6 +51,15 @@ void context_tracking_user_enter(void) unsigned long flags; /* + * Repeat the user_enter() check here because some archs may be calling + * this from asm and if no CPU needs context tracking, they shouldn't + * go further. We can remove that check here once these archs support the static key + * check. + */ + if (!static_key_false(&context_tracking_enabled)) + return; + + /* * Some contexts may involve an exception occuring in an irq, * leading to that nesting: * rcu_irq_enter() rcu_user_exit() rcu_user_exit() rcu_irq_exit() @@ -151,6 +160,9 @@ void context_tracking_user_exit(void) { unsigned long flags; + if (!static_key_false(&context_tracking_enabled)) + return; + if (in_interrupt()) return;