From patchwork Tue Sep 23 02:31:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zefan Li X-Patchwork-Id: 37709 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A8D5202A1 for ; Tue, 23 Sep 2014 02:40:42 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id hi2sf2043605wib.11 for ; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=aTdR02+2dlpk99EmtWsPhpyJ2XnnY1py3pyzbxuEqk8=; b=VwhpiOPZ4garzo9GmUAdxdIHGPnchYzxApmmR0v4lbF2pk+pGVMr8XFUjwRADxs4ZC 9RBMxrT1gJuPdA5EaQDxOVfUXbZEhc+afHGoocCJYEqKVM6w3n3hPM7mGzUKFweI6N0I ihSZweERcNHn/+lM9KzDorUouEJqyCnFaUigg3VGmnhVmP8yNyiCz01cP7YJdB1uosEt Sn4rb7z5RfHavUvKGqcI1cKt1wN2F5SVpDE5jhJh98VIp37qEqRlZBADxr5iufoeGsV3 2qEstUt4yEG4tW2c7ySw+ON/qcI2EjPZK6nfOhDHy+bxqq2b/78hRv9HTVq+Im4Ckq+N 0Dmg== X-Gm-Message-State: ALoCoQm72vsC9LnAQLrd9rFT4Vur3yRQ0kG4R6ITq6kb3k0gsKMFtgi825N56S7jd66VFyA1SyOS X-Received: by 10.194.87.35 with SMTP id u3mr971782wjz.3.1411440041476; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.226 with SMTP id d2ls560801lab.66.gmail; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) X-Received: by 10.153.4.39 with SMTP id cb7mr29446154lad.19.1411440041319; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id 8si16638359las.83.2014.09.22.19.40.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Sep 2014 19:40:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id 10so7279889lbg.38 for ; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) X-Received: by 10.112.147.74 with SMTP id ti10mr27840170lbb.29.1411440041253; Mon, 22 Sep 2014 19:40:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp341982lbb; Mon, 22 Sep 2014 19:40:40 -0700 (PDT) X-Received: by 10.66.90.137 with SMTP id bw9mr30907574pab.7.1411440038819; Mon, 22 Sep 2014 19:40:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ka6si18122620pad.166.2014.09.22.19.40.38 for ; Mon, 22 Sep 2014 19:40:38 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754867AbaIWCk0 (ORCPT + 27 others); Mon, 22 Sep 2014 22:40:26 -0400 Received: from mail.kernel.org ([198.145.19.201]:38433 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753128AbaIWCkW (ORCPT ); Mon, 22 Sep 2014 22:40:22 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0477B2015E; Tue, 23 Sep 2014 02:40:21 +0000 (UTC) Received: from localhost.localdomain (unknown [183.247.163.231]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A1762021A; Tue, 23 Sep 2014 02:40:17 +0000 (UTC) From: Zefan Li To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mark Rutland , Russell King , Zefan Li Subject: [PATCH 3.4 31/45] ARM: 8128/1: abort: don't clear the exclusive monitors Date: Tue, 23 Sep 2014 10:31:33 +0800 Message-Id: <1411439507-30391-31-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1411439259-30224-1-git-send-email-lizf@kernel.org> References: <1411439259-30224-1-git-send-email-lizf@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Rutland 3.4.104-rc1 review patch. If anyone has any objections, please let me know. ------------------ commit 85868313177700d20644263a782351262d2aff84 upstream. The ARMv6 and ARMv7 early abort handlers clear the exclusive monitors upon entry to the kernel, but this is redundant: - We clear the monitors on every exception return since commit 200b812d0084 ("Clear the exclusive monitor when returning from an exception"), so this is not necessary to ensure the monitors are cleared before returning from a fault handler. - Any dummy STREX will target a temporary scratch area in memory, and may succeed or fail without corrupting useful data. Its status value will not be used. - Any other STREX in the kernel must be preceded by an LDREX, which will initialise the monitors consistently and will not depend on the earlier state of the monitors. Therefore we have no reason to care about the initial state of the exclusive monitors when a data abort is taken, and clearing the monitors prior to exception return (as we already do) is sufficient. This patch removes the redundant clearing of the exclusive monitors from the early abort handlers. Signed-off-by: Mark Rutland Acked-by: Will Deacon Signed-off-by: Russell King Signed-off-by: Zefan Li --- arch/arm/mm/abort-ev6.S | 6 ------ arch/arm/mm/abort-ev7.S | 6 ------ 2 files changed, 12 deletions(-) diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 8074199..5d777a5 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S @@ -17,12 +17,6 @@ */ .align 5 ENTRY(v6_early_abort) -#ifdef CONFIG_CPU_V6 - sub r1, sp, #4 @ Get unused stack location - strex r0, r1, [r1] @ Clear the exclusive monitor -#elif defined(CONFIG_CPU_32v6K) - clrex -#endif mrc p15, 0, r1, c5, c0, 0 @ get FSR mrc p15, 0, r0, c6, c0, 0 @ get FAR /* diff --git a/arch/arm/mm/abort-ev7.S b/arch/arm/mm/abort-ev7.S index 7033752..4812ad0 100644 --- a/arch/arm/mm/abort-ev7.S +++ b/arch/arm/mm/abort-ev7.S @@ -13,12 +13,6 @@ */ .align 5 ENTRY(v7_early_abort) - /* - * The effect of data aborts on on the exclusive access monitor are - * UNPREDICTABLE. Do a CLREX to clear the state - */ - clrex - mrc p15, 0, r1, c5, c0, 0 @ get FSR mrc p15, 0, r0, c6, c0, 0 @ get FAR