Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1244495pxa; Thu, 6 Aug 2020 03:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYBO0gcueUZbUabMrbFf+huv2258AkS8owmP/j8ME6KMM5R1mgttE6Xug8CiK1ey66OIO5 X-Received: by 2002:aa7:c6ce:: with SMTP id b14mr3535231eds.208.1596708943054; Thu, 06 Aug 2020 03:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596708943; cv=none; d=google.com; s=arc-20160816; b=sudYF37ZzDm5oXLXCsEWM+6DxlKqWP5K1lV1i94Yu7rPZqR/28v1d2v2pZZ/Ap8l61 mVZhYvIdAnflkDBlYnygaNEp40NkKn4oY+3syIpC3ivubwFNOe9hxYEQJdyrzGvDyKoo KWRlkxK95Ptng2uesVEAGLRSRyJRG3cNZw96fszpGqHFxpQQDXzjhb26Zf0eF++PpweO bwbNEKLHfvI20VjAsxJBVEqFys/J0lTzkSz6b68dmTYCxP+rupvxzxMFG5jT4FbyqzN3 BMYzpfygL0CDGfIpMNyr8rC53xMKbzGeet6IrF0pLrLAba1lzPepQPVkzlO/9/YXPpvK MMjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=9dX/bRSkZ53qhCOq8/7508fbRufKnExby3lIfqewQ/k=; b=BBYkVUiowguzMdx9sJGC87geqgpgPZ9QEMS8zXNO/u4B0Mcn886ygeACLurTBrsSLa NkLA8nege9RHdyosggSIaJhBFwC+FAVQgirFdYEHP51KErHMdSorEg9BoCuqJsXpzW0c FvQ8TgajfmrhO7MauC4ODrKfpsrusxmLlOV2JfIoxyihPBh1zfKEz5ElS3jWhdcBzEMA 7T52o1eXGlJ7b6/q6MRjLvN4K3rijYolRUTq8m+tmyanGcZjcTPU4aLTFrJfd6FcXxH0 F7DRYLYwZNsvAOeGzgl1v+eTBte9tqRtv3KJ4a35trPXY64yZ2KtottZpHG37w+ZTloC TGiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=oT6asMAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx7si2834894ejb.752.2020.08.06.03.15.19; Thu, 06 Aug 2020 03:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=oT6asMAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbgHFKMi (ORCPT + 99 others); Thu, 6 Aug 2020 06:12:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729265AbgHFKM1 (ORCPT ); Thu, 6 Aug 2020 06:12:27 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACEABC061574 for ; Thu, 6 Aug 2020 03:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=9dX/bRSkZ53qhCOq8/7508fbRufKnExby3lIfqewQ/k=; b=oT6asMAWUevoGmLuxn2iarS9l/ UgaQ6ZDHg/+xij+wXVy8oAhgVCD9nouYVrBc+rV/DNnG9FtHCX6vMi0E1O5tJPKehtK0rBDPG0mbu 86VJbBQnZn8RhOsnRZ67KnEkEuhnzKKTU2VP4HBQgIehtotTUcbY0Hq5lnjLU8eKLqxt2NqLmiECH c7kTyiLlF1V9CS6oDrxjGHadEH1+KOijMnMzhov74wDhlJYoukOf1lLgQSqvtVBZThWJJV+I62mQK xVjQMSddlC6RSSTG6ivVwTeHTJK9mrBULj7GLRcSvlyHT8g5TfuwaGnkwZtmJ0g3Olj1Mc8E8RvuR 1BETifbA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:58866 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3csp-0004V7-76; Thu, 06 Aug 2020 11:12:23 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1k3cso-0007LC-VJ; Thu, 06 Aug 2020 11:12:23 +0100 In-Reply-To: <20200806101145.GC1551@shell.armlinux.org.uk> References: <20200806101145.GC1551@shell.armlinux.org.uk> From: Russell King To: Norbert Lange Cc: Arnd Bergmann , linux-kernel , Petr Malat , Kees Cook , Adam Borowski , Sedat Dilek , Andrew Morton , Nick Terrell , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: add TEXT_OFFSET to decompressor kexec image structure MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Date: Thu, 06 Aug 2020 11:12:22 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the TEXT_OFFSET to the decompressor's kexec image structure to kexec knows what offset to use. Signed-off-by: Russell King --- arch/arm/Makefile | 3 +++ arch/arm/boot/compressed/Makefile | 1 + arch/arm/boot/compressed/vmlinux.lds.S | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 01ed27a538b4..ab2d66e40b7f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -139,6 +139,9 @@ head-y := arch/arm/kernel/head$(MMUEXT).o # Text offset. This list is sorted numerically by address in order to # provide a means to avoid/resolve conflicts in multi-arch kernels. +# Note: the 32kB below this value is reserved for use by the kernel +# during boot, and this offset is critical to the functioning of +# kexec-tools. textofs-y := 0x00008000 # We don't want the htc bootloader to corrupt kernel during resume textofs-$(CONFIG_PM_H1940) := 0x00108000 diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 433fb7f04aa5..0890d82b8cf4 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -70,6 +70,7 @@ ZBSSADDR := ALIGN(8) endif CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)" +CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)" compress-$(CONFIG_KERNEL_GZIP) = gzip compress-$(CONFIG_KERNEL_LZO) = lzo diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 09ac33f52814..da1f6fa5345b 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -42,10 +42,11 @@ SECTIONS } .table : ALIGN(4) { _table_start = .; - LONG(ZIMAGE_MAGIC(4)) + LONG(ZIMAGE_MAGIC(5)) LONG(ZIMAGE_MAGIC(0x5a534c4b)) LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start)) LONG(ZIMAGE_MAGIC(_kernel_bss_size)) + LONG(ZIMAGE_MAGIC(TEXT_OFFSET)) LONG(0) _table_end = .; } -- 2.20.1