From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70005C2D0E4 for ; Tue, 17 Nov 2020 12:48:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD32C2222A for ; Tue, 17 Nov 2020 12:48:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iQPQUmLc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="QWbPwXXR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD32C2222A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=ziX82xwGU4to44mgxeX/5bRrkN6ZcD4769863FiJRnE=; b=iQPQUmLcJ34kSLHqKl2kkXrLem 7fYPWEcQIoZifJ+hOF/OQcu/1dBipsH9nKL6VHGcwqJhSSbCYGIK8bgbmwntMQe7AK+ZIKFORj1q8 o8MRtE3aINucSfiEO9/lot457EKUN669I4APUCAQQaPM3UMWVD6Rf9YdcU/BOU3vUsTIcUsg21KZx WDrLCP0cPCbH3Y1qEi0R2s+hVjmKDW/zxoor0UPqCXp5EiUmXSDSnqBmqPlgLhBjDQslrlf2679cP vzaZwuiENFtgMhyV4wuR9ak2gqahWsqOVJPEW6/56lKfNWqwFOfpVI2ek+PYcO6/bB8j+qHyxl/ON j0s2Wi9A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf0P0-0007EV-Ni; Tue, 17 Nov 2020 12:48:06 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf0Ow-0007DV-TH for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 12:48:05 +0000 Received: from localhost.localdomain (82-64-249-211.subs.proxad.net [82.64.249.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F7C02222A; Tue, 17 Nov 2020 12:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605617282; bh=mBYuQFlArxEVG3kvh2qxH8Isfp92mZKy26oYTtKIn2Y=; h=From:To:Cc:Subject:Date:From; b=QWbPwXXRMjKAjMVhkzb2T5O4s5oDupUewowBtoLdbX/OR593FQI83E7HPx2B54npd cRiy8wxZNt/jCbt2JNT6d4XhUcJUd6q5SDfkHeYL2g1RGOuEDLX8iFrA7agfRqANY5 kh4MjCCEE8LbAD8OYT1AwdJkaiAau+eDPjOZ1IP8= From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 0/3] arm64: head: pad Image header to 64 KB and unmap it Date: Tue, 17 Nov 2020 13:47:26 +0100 Message-Id: <20201117124729.12642-1-ardb@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_074803_047372_12C11D25 X-CRM114-Status: GOOD ( 15.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, robin.murphy@arm.com, Ard Biesheuvel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The EFI header definition was updated recently to increase the section alignment to 64 KB, which causes the EFI loader to put the kernel Image at an offset that is guaranteed to be compatible with the kernel's image placement policy when CONFIG_RELOCATABLE=y, removing the need to move it around in DRAM before boot. This change failed to take into account that the first section in the PE/COFF description should start at a 64 KB aligned boundary as well, and so even though EFI loaders don't seem to care, the current PE/COFF layout is not 100% compliant. So let's fix this by padding the size of the .head region to 64 KB, and while at it, removing it from the kernel's executable mapping, which is now guaranteed to be possible regardless of the page size the kernel is running with. And if we don't map it, we don't need to reserve it either. Changes since v1: - drop the original first patch that fixed the actual bug - it has already been merged - add Will's acks - use a better NOP and a better name for the macro that emits it (#3) Cc: catalin.marinas@arm.com Cc: will@kernel.org Cc: mark.rutland@arm.com Cc: james.morse@arm.com Cc: robin.murphy@arm.com Ard Biesheuvel (3): arm64: omit [_text, _stext) from permanent kernel mapping arm64/head: avoid symbol names pointing into first 64 KB of kernel image arm64: head: tidy up the Image header definition arch/arm64/kernel/efi-header.S | 84 ++++++++++++-------- arch/arm64/kernel/head.S | 19 +---- arch/arm64/kernel/setup.c | 4 +- arch/arm64/kernel/vmlinux.lds.S | 2 +- arch/arm64/mm/init.c | 2 +- arch/arm64/mm/mmu.c | 10 +-- 6 files changed, 60 insertions(+), 61 deletions(-) -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel