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: 10246777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D33CA60211 for ; Wed, 28 Feb 2018 04:18:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1F4628A05 for ; Wed, 28 Feb 2018 04:18:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B694328A0E; Wed, 28 Feb 2018 04:18:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4F1A628A05 for ; Wed, 28 Feb 2018 04:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=e+bG4ELwzTjAswDKaoqVbU8MWdGG8vQHGDTMGUMbYgE=; b=CEF/AlakJl5E6uA2eXi0HGFye5 lIiKesPZcHmRf1+P0JMPagT2+ejtNG9EEtpObwqeTYV7GeZLpxetqAYo3KfRFVtJhMAct0ZnZaldC z4Vvq5pTHgHAK79ABaVumlOoAPbqmFauxK2vZyClyeFIgiPTkqMh2NVFwpYpYncv/vfkaVdeSfBJ3 c8A6YhGzOrZoAkmUbFCeAmhKNRxfGl6wZzCNo/Sb4B78veXMkUYFACJJyPljwavzBxHO11kU51zT9 0EVb6akRkeF96zLzGJ9k/ZOJNvFcd3uB0nhgqyOrUj55fMN1vyOZvFsu0RQOb4vVAfMvTy/ka/2Vl Bj2IVGFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqtBz-0005Ui-VZ; Wed, 28 Feb 2018 04:18:12 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqt9p-0002b7-6Y for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Feb 2018 04:15:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GyALvW8YeD+0MJZ/yzzKdZ537ez2Q1z5R4zg8/QPH8A=; b=OhdTeDGwLnkgNSXAq9mT5hM8L cbv6FhNY/y98dA4Tle7gOxoipimHvzlhoD4Mn9Jmdd2zzp6MR2ufCWW5uZCBsnFq8uTNWmlMt9xgL 7AV3PT3dK7bLrs5WsaQ6pKAmq9lkte144wQ+ZQpfMCU6XNsp64cPgV1wyyVVU1CjpAdthSo6cjMcZ hlN5ymfBYlsQZCVtWx9Nt0D4m59lP4hq0vJRDyXeMdcn6X32yKNxGWRouXD09pHWN92EYRXByH4qs oK3MBNYZas1wrPUyP/L10qphkjZcpaTdYE4GUI9arsb3IU6SwpAusmEMx6BwmIgrDlN3J8s3QQjB+ O+2BW/KxQ==; Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqstW-0002Ji-RD for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2018 03:59:09 +0000 Received: by mail-pl0-x244.google.com with SMTP id ay8-v6so773564plb.4 for ; Tue, 27 Feb 2018 19:58:56 -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=Af5+8ZSIhrO10mqO6i5YEav6qY66MO/KzXrDuGJ79SYi4OvGxPPXi2Dze5oOfAv/DK aODTzEGVtRkzjNmr2zOi6ElsidGB05AqQ7ZTiLKf0kdzO0MTHAcj8u+3ERF7RQCcaWyR 3/U5AqClsGaD7AJ22ke+wYuLRmbl6phuuWrBIdD3dpsSej4gKYSudOCZzyDHPjN7+6u6 JZW5EDhnF7Mx3hQ1mzdpukFRbRc3mDvZJwrwR063YaO/poyx5RFGkzi2OjZ0pVy4+8uN 7VSSird1lEepG3uZbTBO1aGzx28p4/EbNPqfGnv+JsX6Dhtzq2KlXihN7rt59cp9RQa+ dUkg== X-Gm-Message-State: APf1xPBjJESKwRrMzuSHoKe1cgU0PeyokEPi7A9GfynPCinKEuo7BzKP 3dnB07JmGjxUmH2Hyt7qzrMphQ== X-Google-Smtp-Source: AH8x226G4tHD/kAA0X1641MuVoz7Nn7dz5UI4/0Gvyj/nIz3MPPrqBXfxQbVdIOVXLP6Dp+4oHVlTg== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180228_035906_876018_9AE0761E X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Shi MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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)