From patchwork Mon Jul 20 15:10:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 51284 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 78C33202B9 for ; Mon, 20 Jul 2015 15:10:28 +0000 (UTC) Received: by laef2 with SMTP id f2sf41559471lae.0 for ; Mon, 20 Jul 2015 08:10:27 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=98xa8m4ufXPuDo0mBrxpSe9vogkp1n2SbcIhfLVbU50=; b=QIO29Q7xNCTc6y8fu5pae+tRPaPGWhNJJc8JP7bF7ymfzH49oHRIdqHYhW6YY6SfQl wcjIo6MrpCFU+d6S+dfmbLQxYdIu8mOf7M17ng2P3eTLogohfFAroEvZPgUN9U6cbp9n wNQe71z1vdOC58g8qOG0lGvBn1KP/QeQbYUwVdcz4Q3wvji3GUsd8AzgfgpQYRE2ZJWv PWeOrOgZx/DJhcLEEOcf69WU534JWRSjLyCrxSP0mO3ZzcnvFz22TKh3CVymAkyyYV/c dNdcWJc71TF+KPFX+o1aMC83IDGsvQT3qhSjDunxhiN5UK7Q3Ijxl8PC2pmII0p8a8+e P/aw== X-Gm-Message-State: ALoCoQn97Y/rVo6XKNSFiISTCM0jvuF1BawXUaLLR4T7Jnf9Ejml8Xkt6ddixkC9CTEv7bdYTSis X-Received: by 10.112.138.2 with SMTP id qm2mr15214609lbb.19.1437405027425; Mon, 20 Jul 2015 08:10:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.74 with SMTP id g10ls797465lab.92.gmail; Mon, 20 Jul 2015 08:10:27 -0700 (PDT) X-Received: by 10.113.4.105 with SMTP id cd9mr28227534lbd.106.1437405027279; Mon, 20 Jul 2015 08:10:27 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id ll10si18175119lac.26.2015.07.20.08.10.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2015 08:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lblf12 with SMTP id f12so97128107lbl.2 for ; Mon, 20 Jul 2015 08:10:27 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr27729156lbc.112.1437405027080; Mon, 20 Jul 2015 08:10:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp853525lba; Mon, 20 Jul 2015 08:10:26 -0700 (PDT) X-Received: by 10.194.71.82 with SMTP id s18mr61455578wju.102.1437405024197; Mon, 20 Jul 2015 08:10:24 -0700 (PDT) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com. [74.125.82.48]) by mx.google.com with ESMTPS id em3si13793206wib.90.2015.07.20.08.10.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2015 08:10:24 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.48 as permitted sender) client-ip=74.125.82.48; Received: by wgav7 with SMTP id v7so67637453wga.2 for ; Mon, 20 Jul 2015 08:10:23 -0700 (PDT) X-Received: by 10.194.118.227 with SMTP id kp3mr58692320wjb.97.1437405023725; Mon, 20 Jul 2015 08:10:23 -0700 (PDT) Received: from wychelm.lan (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by smtp.gmail.com with ESMTPSA id z9sm12254158wiv.9.2015.07.20.08.10.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2015 08:10:22 -0700 (PDT) From: Daniel Thompson To: Catalin Marinas , Will Deacon Cc: Daniel Thompson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal , Christoffer Dall , Marc Zyngier , Andre Przywara Subject: [PATCH v2 3/5] arm64: kernel: Adopt new alternative assembler macros Date: Mon, 20 Jul 2015 16:10:02 +0100 Message-Id: <1437405004-1296-4-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437405004-1296-1-git-send-email-daniel.thompson@linaro.org> References: <1436536130-31438-1-git-send-email-daniel.thompson@linaro.org> <1437405004-1296-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.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.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Convert the dynamic patching for ARM64_WORKAROUND_845719 over to the newly added alternative assembler macros. Signed-off-by: Daniel Thompson --- arch/arm64/kernel/entry.S | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index a7691a378668..be8a70d4028c 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -122,26 +122,23 @@ ct_user_enter ldr x23, [sp, #S_SP] // load return stack pointer msr sp_el0, x23 - #ifdef CONFIG_ARM64_ERRATUM_845719 - -#undef SEQUENCE_ORG -#undef SEQUENCE_ALT - +alternative_if_not ARM64_WORKAROUND_845719 + nop + nop #ifdef CONFIG_PID_IN_CONTEXTIDR - -#define SEQUENCE_ORG "nop ; nop ; nop" -#define SEQUENCE_ALT "tbz x22, #4, 1f ; mrs x29, contextidr_el1; msr contextidr_el1, x29; 1:" - + nop +#endif +alternative_else + tbz x22, #4, 1f +#ifdef CONFIG_PID_IN_CONTEXTIDR + mrs x29, contextidr_el1 + msr contextidr_el1, x29 #else - -#define SEQUENCE_ORG "nop ; nop" -#define SEQUENCE_ALT "tbz x22, #4, 1f ; msr contextidr_el1, xzr; 1:" - + msr contextidr_el1, xzr #endif - - alternative_insn SEQUENCE_ORG, SEQUENCE_ALT, ARM64_WORKAROUND_845719 - +1: +alternative_endif #endif .endif msr elr_el1, x21 // set up the return data