Thread (27 messages) flat view 27 messages, 2 authors, 2021-08-02

Re: [boot-wrapper PATCH 07/12] aarch64: respect text offset

From: Mark Rutland <mark.rutland@arm.com>
Date: 2021-07-30 15:45:25

On Fri, Jul 30, 2021 at 04:13:38PM +0100, Andre Przywara wrote:
On Thu, 29 Jul 2021 16:20:45 +0100
Mark Rutland [off-list ref] wrote:
quoted
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 <mark.rutland@arm.com>
---
 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
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help