From patchwork Wed Jul 22 11:21:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 51341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 6CA6720323 for ; Wed, 22 Jul 2015 11:21:25 +0000 (UTC) Received: by laef2 with SMTP id f2sf57581870lae.0 for ; Wed, 22 Jul 2015 04:21:24 -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=V20tMg7LdTC5QQ90dvUKxTdqu446hVjKzCHOt+G6pvDjUd2YKRtcSEnTM58y4mp4mn k603HWmrTKS75u3G336pC0IuZ7kM3FGK75IQ0gKrfTHWmNjCflxT3Rc6zvuq3H14opJS LcaG/sRU/detQMeb2vXEU4d4l0CWcHh83X2IHGskeKPhslvjzso9SmKMNN/rU1djmURq xevF/Q6oSXtoVrdsGWR5UGXmAcID8E8/ceN+3UEuKGoM6teMKLrdmuqDXSrgtXj2dfO7 ZE21Pxf1oM5B2eN9ctT9nh52TqaGo2XG7QDJ4TIKBQAQufMKD96vxBwxsHRxbfcRzcmd LlVQ== X-Gm-Message-State: ALoCoQnoFtzn/nMgg1i6lNL0Ubp6j3WQyZ627qCxwzAf/4gQfa+zuRRPgG1A8ie7CvowrWVuI5kr X-Received: by 10.112.181.37 with SMTP id dt5mr985334lbc.10.1437564084205; Wed, 22 Jul 2015 04:21:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.111 with SMTP id q15ls70450laa.99.gmail; Wed, 22 Jul 2015 04:21:24 -0700 (PDT) X-Received: by 10.153.7.137 with SMTP id dc9mr1855330lad.16.1437564084065; Wed, 22 Jul 2015 04:21:24 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id u9si931096lbw.89.2015.07.22.04.21.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 04:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lblf12 with SMTP id f12so134381734lbl.2 for ; Wed, 22 Jul 2015 04:21:23 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1934299lbc.32.1437564083941; Wed, 22 Jul 2015 04:21:23 -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 l6csp2046585lba; Wed, 22 Jul 2015 04:21:23 -0700 (PDT) X-Received: by 10.194.243.230 with SMTP id xb6mr4077411wjc.13.1437564080511; Wed, 22 Jul 2015 04:21:20 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com. [209.85.212.169]) by mx.google.com with ESMTPS id it9si24213668wid.64.2015.07.22.04.21.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 04:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; Received: by wicgb10 with SMTP id gb10so93446826wic.1 for ; Wed, 22 Jul 2015 04:21:20 -0700 (PDT) X-Received: by 10.194.58.199 with SMTP id t7mr4208904wjq.45.1437564080266; Wed, 22 Jul 2015 04:21:20 -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 j7sm1901235wjz.11.2015.07.22.04.21.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 04:21:19 -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 v3 3/5] arm64: kernel: Adopt new alternative assembler macros Date: Wed, 22 Jul 2015 12:21:03 +0100 Message-Id: <1437564065-4356-4-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437564065-4356-1-git-send-email-daniel.thompson@linaro.org> References: <1436536130-31438-1-git-send-email-daniel.thompson@linaro.org> <1437564065-4356-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.182 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