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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 EF312C43331 for ; Sun, 29 Mar 2020 14:02:45 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 4E1D8206F6 for ; Sun, 29 Mar 2020 14:02:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E1D8206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48qy360yzQzDqWG for ; Mon, 30 Mar 2020 01:02:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.210.66; helo=mail-ot1-f66.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48qy0j3SHtzDqGq for ; Mon, 30 Mar 2020 01:00:33 +1100 (AEDT) Received: by mail-ot1-f66.google.com with SMTP id 111so15113340oth.13 for ; Sun, 29 Mar 2020 07:00:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QNLlN1zb7CRtDuVy5Iix3XnwCOUZPqrirtS+X+CgoVE=; b=r+E9lfDfLmQYMpvBaQInVGEbvkxziPAajz0wS3WWZimWcyAh5mxTaslN3rQ3sNz1mi 1Ra4aPQlRDOerp830IvjSgUwnET+bnhGg8xsoRw0YFHyjmP3NVQOWwo5iwYxYr5zZu+Q rEEukK6KrI4pGyepLaIAz5bwmGB1eiJfuXoUKE7gABwwNf6KLacYkKfcBVpHi2GwP3QM 8qLRTjV4kdqamuajMB715lzjnIBwcZO3sQjECSmPWr79O+2+DyMYsyiAPhc/MPn/TpEo in5mpVTTVXzOTh3Q1A9gRWd82VJix9A/Tw4UrbpWBpYjChz/eleN0IANcKTXYwN+QEWa BhiQ== X-Gm-Message-State: ANhLgQ09g/aBFsk+isSd/JpUheLL1QuWQ0qvOWvTRlozqZK13Dzzs8v+ gZchcHcaua+hiHtyn2bfqP0zJg1cMaa6H54oBuM= X-Google-Smtp-Source: ADFU+vtZcnjvciREbPV3aE1DKklNynoYrVXM5GmbgxK/5cng9VzfaBdVb0Gmw3D+X2C3eyx9p2xCYsevdeeVYPGXK20= X-Received: by 2002:a05:6830:15c2:: with SMTP id j2mr5548328otr.107.1585490431002; Sun, 29 Mar 2020 07:00:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Sun, 29 Mar 2020 16:00:20 +0200 Message-ID: Subject: Re: [PATCH 7/9] powerpc/ps3: Add check for otheros image size To: Geoff Levand Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev , Markus Elfring , Dan Carpenter , Emmanuel Nicolet Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Geoff, On Fri, Mar 27, 2020 at 9:26 PM Geoff Levand wrote: > The ps3's otheros flash loader has a size limit of 16 MiB for the > uncompressed image. If that limit will be reached output the > flash image file as 'otheros-too-big.bld'. > > Signed-off-by: Geoff Levand Thanks for your patch! > --- a/arch/powerpc/boot/wrapper > +++ b/arch/powerpc/boot/wrapper > @@ -570,7 +570,16 @@ ps3) > count=$overlay_size bs=1 > > odir="$(dirname "$ofile.bin")" > - rm -f "$odir/otheros.bld" > - gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld" > + > + # The ps3's flash loader has a size limit of 16 MiB for the uncompressed > + # image. If a compressed image that exceeded this limit is written to > + # flash the loader will decompress that image until the 16 MiB limit is > + # reached, then enter the system reset vector of the partially decompressed > + # image. No warning is issued. > + rm -f "$odir"/{otheros,otheros-too-big}.bld > + size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1) > + bld="otheros.bld" > + [ $size -le 16777216 ] || bld="otheros-too-big.bld" > + gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld" > ;; > esac Why not print an error message and exit 1 instead, like is done for other fatal errors? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds