From patchwork Tue Apr 3 11:09:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 132718 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3665963ljb; Tue, 3 Apr 2018 04:10:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48D2LFb/Pbu+1cyNM9gHzEVPFExtDCZ7HZOGhS7EYSQGIyiu5vSyDYcNjtfkObSzlS99Uoq X-Received: by 2002:a17:902:32a2:: with SMTP id z31-v6mr14049839plb.41.1522753810649; Tue, 03 Apr 2018 04:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522753810; cv=none; d=google.com; s=arc-20160816; b=0pZtGScfdFfQs4Nkm8lGd6KlzIejoP28QXHgngg7kPj9nniqagc9Zy5ugLpzWo//z6 mVJ1TDs964XEf649dUouIEwzcdqyvCSZKMQyLxnasE/mlfuutN9nnV+QAtuHDVAZV6AD Kg5g7+ZpKo8tfOMmMaSLUqDtAeu9xfQ/wA2gr762SXfGzfjK1zI5RasJTCq6HoAq9ZD7 P5bU8StuT1EMcBeNnWAGkqI/Ggmp0WZfJajfqd8JN+XCWjUv7i3X5QIRKw6BcnizKJ5j x4ZqO1xCnMa9b+0HBhfJW9nGTqiqaSglu2iel2nzKpL1ikjGDARTqiQHaf8qKVn3Dsf2 JnCg== 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:arc-authentication-results; bh=TSGLKWVtHredrz4STIIQIGxjUpOVnk+aKaR2CppEihg=; b=UMvVUf0l45MJPB15pnmWTGeBnaH3v9YXQ5L4nlVwnOkkmFw7KKXbDFKGF1S9yi5BJx wV96pMQrn1y3y3xBtwQZsisxAkpEDJTIJTck8ZNQiKtfO3U3BcV8taAwTyyvHp3LVI9Z t7vuMFL4tqkOTMz5zfN9HiN6vgV40TKRMtr/nSzC0xVSGIcci7Ou/pUCKYzdbtEexLGB l224etb26wAMF94jU6BUQmixZqhK8/C8IBFPTyFnFNi2hoOkN7PyvkHbhuIAhfjKEZ2P 1uy8n631Ni44hjy4HDNMqEcZIlv9dr9p/mcm4a7+KU4HqsGdKSZLl0EfigsM51gAcib+ sGVg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si1862166pgc.577.2018.04.03.04.10.10; Tue, 03 Apr 2018 04:10:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755063AbeDCLKI (ORCPT + 11 others); Tue, 3 Apr 2018 07:10:08 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59336 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755482AbeDCLKG (ORCPT ); Tue, 3 Apr 2018 07:10:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 98D8515AB; Tue, 3 Apr 2018 04:10:05 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 680D23F587; Tue, 3 Apr 2018 04:10:04 -0700 (PDT) From: Mark Rutland To: stable@vger.kernel.org Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com Subject: [PATCH v4.9.y 10/27] arm64: entry: Explicitly pass exception level to kernel_ventry macro Date: Tue, 3 Apr 2018 12:09:06 +0100 Message-Id: <20180403110923.43575-11-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180403110923.43575-1-mark.rutland@arm.com> References: <20180403110923.43575-1-mark.rutland@arm.com> 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 [v4.9 backport] [Mark: avoid dependency on C error handler backport] Signed-off-by: Mark Rutland [v4.9 backport] --- arch/arm64/kernel/entry.S | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) -- 2.11.0 diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 08f6f059e960..0a9f6e7a76d6 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_invalid // 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_invalid // 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_invalid // 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_invalid // 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_invalid_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_invalid_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)