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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 A9761C4338F for ; Fri, 30 Jul 2021 15:45:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6DBF060F26 for ; Fri, 30 Jul 2021 15:45:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6DBF060F26 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CHvg5e/4KIWT7Z3SoNQYmjD5eRh5RjOQaUl1O9fPBzw=; b=mDhb4l2BQVFrka 1Pr0TCwtNzw4NOVc2CHMid1k3fjwykjMxAHCHb3O+kVMv62niJquf57NmAUq2s8Yw84q36LnPFsK8 pBEGhKVh4hk1m4FHcdffVmaHrn4gkOynGZSv9IsNRfuJlkZOxX8R9gxmq2fNjM0t29JYmx44e5AD3 Ti8lucuhcppr9Fzpef4BzUEKv+CXozCeEgsD1PhOhCYOQgdhPQGU8X1CqNpzQ2Fjldu9wTqHoho1i VV8K1pP4rpSILwwcAnPDT9216ABbV2oYgi4UI1BuEQf26wE2IMoEA4Uoet1SZcmhguAdloPk6xoAJ iEckX5TyLeB4MhNRLOnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9UfK-009LZ0-N1; Fri, 30 Jul 2021 15:43:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9UfG-009LYN-Nm for linux-arm-kernel@lists.infradead.org; Fri, 30 Jul 2021 15:43:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59F72113E; Fri, 30 Jul 2021 08:43:06 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.13.245]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B3FC83F66F; Fri, 30 Jul 2021 08:43:02 -0700 (PDT) Date: Fri, 30 Jul 2021 16:43:00 +0100 From: Mark Rutland To: Andre Przywara Cc: linux-arm-kernel@lists.infradead.org, Jaxson.Han@arm.com, Wei.Chen@arm.com Subject: Re: [boot-wrapper PATCH 07/12] aarch64: respect text offset Message-ID: <20210730154300.GD19569@C02TD0UTHF1T.local> References: <20210729152050.23635-1-mark.rutland@arm.com> <20210729152050.23635-8-mark.rutland@arm.com> <20210730161338.269f12c2@slackpad.fritz.box> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210730161338.269f12c2@slackpad.fritz.box> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210730_084310_868148_9B23E90D X-CRM114-Status: GOOD ( 19.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Fri, Jul 30, 2021 at 04:13:38PM +0100, Andre Przywara wrote: > On Thu, 29 Jul 2021 16:20:45 +0100 > Mark Rutland wrote: > > > The boot-wrapper assumes that an AArch64 kernel's text offset is 0x80000 > > rather than reading the `text_offset` field from the Image header as the > > documentation says it should. > > > > Add a script to figure this out during the build process. As with FDT.pm > > the parsing of the Image (and common logic associated with this) is > > factored into a module that we may use in more scripts in future. > > > > Signed-off-by: Mark Rutland > > --- > > Makefile.am | 4 +-- > > scripts/AA64Image.pm | 87 +++++++++++++++++++++++++++++++++++++++++++++ > > scripts/aa64-load-offset.pl | 28 +++++++++++++++ > > 3 files changed, 117 insertions(+), 2 deletions(-) > > create mode 100755 scripts/AA64Image.pm > > create mode 100755 scripts/aa64-load-offset.pl > > +sub get_load_offset > > +{ > > + my $self = shift; > > + my $min = shift; > > + my $offset = $self->get_text_offset(); > > + > > + if ($min < $offset) { > > So this should be ($min <= $offset), otherwise a kernel with > TEXT_OFFSET 0x80000 needlessly gets loaded up to 2.5MB. Good spot; I've fixed that up locally. > Otherwise looks good and seems to handle the cases I tested correctly. Great! Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel