From patchwork Wed Feb 28 03:56:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10246767 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 671B660362 for ; Wed, 28 Feb 2018 04:15:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55CFE28AB2 for ; Wed, 28 Feb 2018 04:15:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A50C28ABB; Wed, 28 Feb 2018 04:15:22 +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 BA36528AB2 for ; Wed, 28 Feb 2018 04:15:21 +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=+Iy1zclbrqMQtd2sMVZ0Add/dEpthFco4GobnHaFzC0=; b=tv08aPXVUR9LO/NqIV4hHlNFOx 29/DbfTgQl5qtkVSOiR+ayMHLl1LkYiFwTiw925eeXSqsM6AzL2hQfss0/URie01n5w7Bgo2gYGgr e9uM07Ohb7zOMgxnnCw88XDRdWIxSnWpePHUxXCYXi1z5CDZYJjevtTHT1c+1WihSka4XnT2aSrBs 2RHLsWFfQYtFQT0+yzW3P4sDW+gHVUBjnI4b1hvBAnhNBrfIwPpOlH1xr2c4GQrNKHPQ1s5U7TgOs ljjaxpy1ECCiTpOXs++Ty5jpx8mJr55N4mzos72JErxfsG9M33zHnMjcImO6h3pAn6+PkIRK/I+z0 OHUNgx1w==; 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 1eqt9B-0003gR-D2; Wed, 28 Feb 2018 04:15:17 +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 1eqt99-0002b7-1Y for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Feb 2018 04:15:15 +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=bmODirOIrB4Uq31RHiBfVSkaHJATLnMI0vQEAhunKG8=; b=aLe8AEM783QwGvuogvA5jD86c 5Ax3V/2zeefJal2phMbJeafmYkr9f8jV87mGxvAcQmFfUG3NhTCQ+xLcVVulaYm7VVXE8IfY11ggx SAva/6NlgM7jUUPNPCvDiqjmf3ipYWoaGRV/0a+3J2IgBJXbnE2TzkTCL7K/Sc6rCp5ZQmi08Utkk x3CCwtP9nZjgc35UBqelCCkEnMlxdpGpc8b+p9D9e8PSnkOcwOjnbkslZ9VnjzlIZ8WpNMpqZAfRp cQPvbuCH0p8xJJYiTAp7gNt+UgFzvZPRWg4v7j9eUm12PxmGKVC2FbacRFF0kK3SgHDuGDrv7D4bO F8SFzb4NQ==; Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqsvh-0002XQ-Cn for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2018 04:01:23 +0000 Received: by mail-pg0-x242.google.com with SMTP id y8so482912pgr.9 for ; Tue, 27 Feb 2018 20:01:11 -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=bmODirOIrB4Uq31RHiBfVSkaHJATLnMI0vQEAhunKG8=; b=OFGVOi3he6LzbyCn520fy0htDXYWk4kbNgIkyA8pCCclqXIPvz0RdVaYJZUfuMjKOP pSO0DUNMTxa1Z6BfQfxCctG2TL/hpA87CwrHZKXJUkkuf4bUk1QP9XwypRJWvzYFZEyR waXAonKRxDizWyqDhU4oyjXBQNKTBjUZJQuWI= 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=bmODirOIrB4Uq31RHiBfVSkaHJATLnMI0vQEAhunKG8=; b=ED5h186ZN96DDQC8W3yGNzbg6gG7k1Fipd9DLrh+O1Ut1aYtTQzFwzXVZmzvEn8t5P Q8cXApPIjdABww7Us+2JRYT7ER3XK94KIIX5SjAzRpaAMMNaJLeQVe5u+D7iqHehmn8E n+57KKTK3iVxABviH9kKKIb9E86ne+qeeLU9po5rCrq8MGv1+ebfYfT6rm1qDcgBOyiM 8wxcEnKJjU60PVBhf8GOsSYoucGe/iPO1i4IDrzWKotyUp5od2zAE8tVFz5HcVMKO4eG 6PvKnt/5SF3qwJSl2ZOZG6q55AxhR8QvaVQfgnJPyKthfRqtuh3Iy+702pVUHQ4CkLw/ XMoA== X-Gm-Message-State: APf1xPCr2csP1ixyY+hKrwiXgKpxKJ9KCPXRtZURhVo62mINuRMBU1c1 w2QXnxbgvFwLkI2t3t5RGzxkOw== X-Google-Smtp-Source: AH8x227SuX5WwZFgwfKuExpUc9zfYuA6ARG9YyVBTDtrAM/EiLSQ65zuPy7YXAAGQjCPhcnwvXXmFg== X-Received: by 10.98.202.138 with SMTP id y10mr16237682pfk.184.1519790469719; Tue, 27 Feb 2018 20:01:09 -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.20.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 20:01:09 -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 29/29] arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives Date: Wed, 28 Feb 2018 11:56:51 +0800 Message-Id: <1519790211-16582-30-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_040121_424582_BEF4930E X-CRM114-Status: GOOD ( 15.20 ) 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 439e70e27a51 upstream. The identity map is mapped as both writeable and executable by the SWAPPER_MM_MMUFLAGS and this is relied upon by the kpti code to manage a synchronisation flag. Update the .pushsection flags to reflect the actual mapping attributes. Reported-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Alex Shi --- arch/arm64/kernel/cpu-reset.S | 2 +- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/sleep.S | 2 +- arch/arm64/mm/proc.S | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/cpu-reset.S b/arch/arm64/kernel/cpu-reset.S index 65f42d2..f736a6f 100644 --- a/arch/arm64/kernel/cpu-reset.S +++ b/arch/arm64/kernel/cpu-reset.S @@ -16,7 +16,7 @@ #include .text -.pushsection .idmap.text, "ax" +.pushsection .idmap.text, "awx" /* * __cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2) - Helper for diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 539bebc..fa52817 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -473,7 +473,7 @@ ENDPROC(__primary_switched) * end early head section, begin head code that is also used for * hotplug and needs to have the same protections as the text region */ - .section ".idmap.text","ax" + .section ".idmap.text","awx" ENTRY(kimage_vaddr) .quad _text - TEXT_OFFSET diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S index 1bec41b..0030d69 100644 --- a/arch/arm64/kernel/sleep.S +++ b/arch/arm64/kernel/sleep.S @@ -95,7 +95,7 @@ ENTRY(__cpu_suspend_enter) ret ENDPROC(__cpu_suspend_enter) - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(cpu_resume) bl el2_setup // if in EL2 drop to EL1 cleanly bl __cpu_setup diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 5c268f5..c07d9cc 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -83,7 +83,7 @@ ENDPROC(cpu_do_suspend) * * x0: Address of context pointer */ - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(cpu_do_resume) ldp x2, x3, [x0] ldp x4, x5, [x0, #16] @@ -147,7 +147,7 @@ alternative_else_nop_endif ret ENDPROC(cpu_do_switch_mm) - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" .macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2 adrp \tmp1, empty_zero_page @@ -180,7 +180,7 @@ ENDPROC(idmap_cpu_replace_ttbr1) .popsection #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" .macro __idmap_kpti_get_pgtable_ent, type dc cvac, cur_\()\type\()p // Ensure any existing dirty @@ -368,7 +368,7 @@ ENDPROC(idmap_kpti_install_ng_mappings) * Initialise the processor for turning the MMU on. Return in x0 the * value of the SCTLR_EL1 register. */ - .pushsection ".idmap.text", "ax" + .pushsection ".idmap.text", "awx" ENTRY(__cpu_setup) tlbi vmalle1 // Invalidate local TLB dsb nsh