From patchwork Wed Feb 28 03:56:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 129895 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp568133lja; Tue, 27 Feb 2018 19:58:59 -0800 (PST) X-Google-Smtp-Source: AG47ELtGnSF/dsVpoDXex+BIyv5/JgJ2lZ9NC+PC02ZtL15n4Q+xNN4oQoC5VunVrNJdxw4bx+Pf X-Received: by 2002:a17:902:a613:: with SMTP id u19-v6mr11385053plq.92.1519790338888; Tue, 27 Feb 2018 19:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519790338; cv=none; d=google.com; s=arc-20160816; b=RB5FofnjFZrrhDN1/u9GZphGHAti+N5NwIcGx2aspFbUDQHTyjpwbFiaRhU03Sst6s kzqOXFVL/pxhxWd9xJypq7/2Ypqxx0840dAgVB6YDVXp6w+e2ySbwpbDbtYAE7gAu6WG +r13uPUkfhCedILhlkGaSMdbZgzN8IyrK/moSJmUezmZNMA6cgDuNVWcdJxXSYTSbOn4 N0HGxOhotLTIOmtrQ1BDbSz2pobaAbH1EVtd45XtgQn56YAcV9rTj3Lw+xKBfElafQSf ISjXdmxcHbVWJsS82FOcjsL1w81qUSGSNElHGCEi8MRc1DtZ3gNj+hrQdzyrFiRG2dEu JZ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GyALvW8YeD+0MJZ/yzzKdZ537ez2Q1z5R4zg8/QPH8A=; b=E//2bMUaDAH8t5jcw6RLxtQoPT5s0YAOnTd0ypXHU+/8JxcHB5RGLM+TUpabn3+2zs CoZ9rE+LU3jx1tp2e4NhhzRh1JkQQinT1hDBdL+GtA1OJO6122N7zvQE5AdWdxByebRf Md34YAU5lzgaz6Now49ebq03gLADSOi5ibMVVVaJWOzhNlxvvTptF4CyAklqpCjCj26U zlOA7Amo0Fn0jszKv4RLsEOLttf5SGzNbxfdFPzCxku/zbhvlrAIQy+/AaZQbgWvVGn6 yWThVx+hC9butpCR0ON70D6R+w3aY5NFy66xOIvnYMm8Pfbb3Pmg5faa5oQf5kdwNJ5t Y8+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DdvPmhiC; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si474395pgq.168.2018.02.27.19.58.58; Tue, 27 Feb 2018 19:58:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DdvPmhiC; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751764AbeB1D64 (ORCPT + 10 others); Tue, 27 Feb 2018 22:58:56 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40598 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbeB1D6z (ORCPT ); Tue, 27 Feb 2018 22:58:55 -0500 Received: by mail-pl0-f66.google.com with SMTP id i6-v6so770474plt.7 for ; Tue, 27 Feb 2018 19:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GyALvW8YeD+0MJZ/yzzKdZ537ez2Q1z5R4zg8/QPH8A=; b=DdvPmhiCUper7kGPYu9IsYe8LnYjqQDwut7q/Pgjt6ABptGQETKOR7hJbEkAj5FyFp p3WXAYuzrrfnJsz8F4Jf6xj4dhiMfxMLBVjcC8rNeNxGnPpXf6HNRIaElqwNHoYjZsPi vqy+lPycvj5WTS1lcUkRIRGSAIrVtm7n5Q0Qg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GyALvW8YeD+0MJZ/yzzKdZ537ez2Q1z5R4zg8/QPH8A=; b=gPk4YmWzqNYhkUEgfYyUswJtFq6bjoAHoxLjwXvcZKf+YXTdm16pL9Bic0eDgriXv7 CpCHLWSVS/oilaz5cJLrJXp1zhMV8tPHUA7mHy9TFD+CDZKsBaGvx+dKHWKVkGm9U4Lk Ygc6ibEDeTz1SgOArhe4D9OksV1eyCzdr8v86k8T4GQPoZHXwZi2887y510p65dCudA9 KNId38O0dqlhKwi8CPJo0xSNsPehGeIqzDwrjXwjInh2cdf1BddkZxjVMkFOZXlLV4oF Tagssc8a8nz3uoTkF0x8Py14dSSHkf0jC+piM1GXihdJjlwgA6YW/2Fjpd4PB0Dl2oc1 YBJA== X-Gm-Message-State: APf1xPCuaPs1+37egar3xvPrX9BD9OAEearQBClb9J/EwyWcf5LXw4+1 b9XNHHsnJDW8rIisC37LK6RXRA== X-Received: by 2002:a17:902:2006:: with SMTP id n6-v6mr16536609pla.149.1519790334519; Tue, 27 Feb 2018 19:58:54 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id q17sm739911pgt.7.2018.02.27.19.58.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 19:58:54 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alex Shi Subject: [PATCH 11/29] arm64: entry: Explicitly pass exception level to kernel_ventry macro Date: Wed, 28 Feb 2018 11:56:33 +0800 Message-Id: <1519790211-16582-12-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519790211-16582-1-git-send-email-alex.shi@linaro.org> References: <1519790211-16582-1-git-send-email-alex.shi@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will Deacon commit 5b1f7fe41909 upstream. We will need to treat exceptions from EL0 differently in kernel_ventry, so rework the macro to take the exception level as an argument and construct the branch target using that. Reviewed-by: Mark Rutland Tested-by: Laura Abbott Tested-by: Shanker Donthineni Signed-off-by: Will Deacon Signed-off-by: Alex Shi Conflicts: no vmap_stack in arch/arm64/kernel/entry.S --- arch/arm64/kernel/entry.S | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) -- 2.7.4 diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index f0c6b37..7b1be51 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -70,10 +70,10 @@ #define BAD_FIQ 2 #define BAD_ERROR 3 - .macro kernel_ventry label + .macro kernel_ventry, el, label, regsize = 64 .align 7 sub sp, sp, #S_FRAME_SIZE - b \label + b el\()\el\()_\label .endm .macro kernel_entry, el, regsize = 64 @@ -264,31 +264,31 @@ tsk .req x28 // current thread_info .align 11 ENTRY(vectors) - kernel_ventry el1_sync_invalid // Synchronous EL1t - kernel_ventry el1_irq_invalid // IRQ EL1t - kernel_ventry el1_fiq_invalid // FIQ EL1t - kernel_ventry el1_error_invalid // Error EL1t + kernel_ventry 1, sync_invalid // Synchronous EL1t + kernel_ventry 1, irq_invalid // IRQ EL1t + kernel_ventry 1, fiq_invalid // FIQ EL1t + kernel_ventry 1, error_invalid // Error EL1t - kernel_ventry el1_sync // Synchronous EL1h - kernel_ventry el1_irq // IRQ EL1h - kernel_ventry el1_fiq_invalid // FIQ EL1h - kernel_ventry el1_error // Error EL1h + kernel_ventry 1, sync // Synchronous EL1h + kernel_ventry 1, irq // IRQ EL1h + kernel_ventry 1, fiq_invalid // FIQ EL1h + kernel_ventry 1, error // Error EL1h - kernel_ventry el0_sync // Synchronous 64-bit EL0 - kernel_ventry el0_irq // IRQ 64-bit EL0 - kernel_ventry el0_fiq_invalid // FIQ 64-bit EL0 - kernel_ventry el0_error // Error 64-bit EL0 + kernel_ventry 0, sync // Synchronous 64-bit EL0 + kernel_ventry 0, irq // IRQ 64-bit EL0 + kernel_ventry 0, fiq_invalid // FIQ 64-bit EL0 + kernel_ventry 0, error // Error 64-bit EL0 #ifdef CONFIG_COMPAT - kernel_ventry el0_sync_compat // Synchronous 32-bit EL0 - kernel_ventry el0_irq_compat // IRQ 32-bit EL0 - kernel_ventry el0_fiq_invalid_compat // FIQ 32-bit EL0 - kernel_ventry el0_error_compat // Error 32-bit EL0 + kernel_ventry 0, sync_compat, 32 // Synchronous 32-bit EL0 + kernel_ventry 0, irq_compat, 32 // IRQ 32-bit EL0 + kernel_ventry 0, fiq_invalid_compat, 32 // FIQ 32-bit EL0 + kernel_ventry 0, error_compat, 32 // Error 32-bit EL0 #else - kernel_ventry el0_sync_invalid // Synchronous 32-bit EL0 - kernel_ventry el0_irq_invalid // IRQ 32-bit EL0 - kernel_ventry el0_fiq_invalid // FIQ 32-bit EL0 - kernel_ventry el0_error_invalid // Error 32-bit EL0 + kernel_ventry 0, sync_invalid, 32 // Synchronous 32-bit EL0 + kernel_ventry 0, irq_invalid, 32 // IRQ 32-bit EL0 + kernel_ventry 0, fiq_invalid, 32 // FIQ 32-bit EL0 + kernel_ventry 0, error_invalid, 32 // Error 32-bit EL0 #endif END(vectors)