From patchwork Mon Aug 11 09:24:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 35197 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A55120AEC for ; Mon, 11 Aug 2014 09:24:37 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hq11sf24543086vcb.7 for ; Mon, 11 Aug 2014 02:24:37 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=aDvXYRoRJ6f8iVCiyrxfoVMQnyLwFFnZ7NfGOy1Ee9M=; b=gQjA57JU9SXB9Fy4CL49NWvlWyAHdiyqEgjvGQXFgXUmw+Gx7kuxsyP9dU6wiZ8xlQ OvVNi+Px53csvFYzSEwQtRJWLfV7EBuavQOGHYRvkNB9RA7CeNQx909M/DZKbXokUx+C MlMXYLSDSFVt/BY0eXEdKPXbHhpEa0HO2Cp4CBvZEtrI/DuOPUhHvRq00DdatQfz1LDp FHaNcmQhnnIFo86Q198R7CDNngTmrfVxtdF2WzgRahADuqr8NbiDb1MCTEx3ueAB9Uvr uvZOBzY8cZLnuyXOoQJdwsvWDX2fTYKebo1lnUn7lU0v0tKorxbIDJ91mYtztH4Hbw7W PGyA== X-Gm-Message-State: ALoCoQmHx8Bn9he32NQ9WSjErRopGAWzb9K2wpsYcQ95hDZq8RMmIXMaH7XEyvX0dI25NFlPV6Cy X-Received: by 10.224.169.20 with SMTP id w20mr21061765qay.4.1407749077364; Mon, 11 Aug 2014 02:24:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.6 with SMTP id s6ls1314627qgd.22.gmail; Mon, 11 Aug 2014 02:24:37 -0700 (PDT) X-Received: by 10.52.160.10 with SMTP id xg10mr18094839vdb.1.1407749077312; Mon, 11 Aug 2014 02:24:37 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ss10si6206924vcb.92.2014.08.11.02.24.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 02:24:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so11220028vcb.19 for ; Mon, 11 Aug 2014 02:24:37 -0700 (PDT) X-Received: by 10.52.88.74 with SMTP id be10mr146757vdb.54.1407749077141; Mon, 11 Aug 2014 02:24:37 -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.221.37.5 with SMTP id tc5csp149817vcb; Mon, 11 Aug 2014 02:24:36 -0700 (PDT) X-Received: by 10.70.90.161 with SMTP id bx1mr336260pdb.150.1407749076252; Mon, 11 Aug 2014 02:24:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ki10si12959987pbd.62.2014.08.11.02.24.35 for ; Mon, 11 Aug 2014 02:24:36 -0700 (PDT) Received-SPF: none (google.com: stable-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 S1752692AbaHKJYf (ORCPT + 1 other); Mon, 11 Aug 2014 05:24:35 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:61687 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbaHKJYe (ORCPT ); Mon, 11 Aug 2014 05:24:34 -0400 Received: from leverpostej.cambridge.arm.com (leverpostej.cambridge.arm.com [10.1.205.151]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s7B9OCwo002358; Mon, 11 Aug 2014 10:24:12 +0100 (BST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: will.deacon@arm.com, Mark Rutland , stable@vger.kernel.org Subject: [PATCH 1/2] ARM: abort: don't clear the exclusive monitors Date: Mon, 11 Aug 2014 10:24:07 +0100 Message-Id: <1407749048-18909-1-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mark.rutland@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 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: , 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 Cc: stable@vger.kernel.org --- 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 3815a82..8c48c5c 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