From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c06::22f; helo=mail-oi0-x22f.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 45A652214E326 for ; Sun, 10 Dec 2017 13:40:50 -0800 (PST) Received: by mail-oi0-x22f.google.com with SMTP id y75so10424692oie.4 for ; Sun, 10 Dec 2017 13:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EBwnVZTrOZB3+de/n6uA0h8bdaSoETJnKpSnIlyCTCs=; b=cO6WaFJGT5c2MuQPK11y045gPyllNz6xYl6WbSkO3041KcqqALwndMml0AYYIAq0cR SoZu+c6PD5keCojIXrta1g9sbV+8wK/1ZDt1TwRrNKQbKyyGxm2uZTe/z2yWuOlqJwW/ 2v2T9rhpPBGR/qHPeP+axqkI37I4EHqscuTZwQeCTgo7ZKsEJQbKayHsHxC9RExJYPcb hSXamoEHlCx+aWrU5nW8ANm+a5AbEVpm7vZGUoxIOSFT90PuMxEVrJ0CXanPPs6x7yfh 1kE6Fe7GG+94NlhfEz23cm/nMGYIUZAJu4VVMo1hMZ7kh2vpz08/5CmFuZTC2u3vMkj6 sfcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EBwnVZTrOZB3+de/n6uA0h8bdaSoETJnKpSnIlyCTCs=; b=nB2/tqiRKrx6Qa++EiUyBtendZaby73ixVhcfEYRpLQQU7GB4vV85l2rsD5FGxGb04 ngwl90qm/J1OOYjjYuDYM4/7KcGz0JC2GCope57dyr2hxw4gdmIxDyb1ghS2jzaZjUKq HSi8EcKWbe67W3278oOpXWrtKzEEHsKOfIfItRx487SY5bfP9JSn1YElHokQWuIGROnv HvKUZ9P49JBtuKRpaCWCbY+Wrw2mi/M4/6uiO0yZG5SZ3nlo9Om4qSF7Abb0cr2utB8L J5s6TrgviNaB+qaRYNsfgRYGxVNrgcQzxlwAcjlwDZrcBDW7ueJfY1RicAb6+vptML1I TdNQ== X-Gm-Message-State: AKGB3mKAqe/Es/Sd+VKWm5eo8IIbmRGwKJ8bMqmSOYDVnfs9RY1ULmia ruM9dnL6fM8q7W9ywxRwGsQUX2QcPwmFfKnauUo= X-Google-Smtp-Source: AGs4zMbAyZ3m+blUYb9qjEcShCIdEhKEX5MrWafX1szknCj7Zx/qk7Rv9ZLV4kWiwUCDU/pLnBpBuZlpu4n7Q2mbSgw= X-Received: by 10.202.170.143 with SMTP id t137mr8370540oie.313.1512942326289; Sun, 10 Dec 2017 13:45:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.1.204 with HTTP; Sun, 10 Dec 2017 13:45:25 -0800 (PST) In-Reply-To: References: From: Michael Zimmermann Date: Sun, 10 Dec 2017 22:45:25 +0100 Message-ID: To: Ard Biesheuvel Cc: "Gao, Liming" , "Zhu, Yonghong" , edk2-devel-01 , Leif Lindholm Subject: Re: PrePiLib's FwVol.c can't handle padding before volume header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Dec 2017 21:40:50 -0000 Content-Type: text/plain; charset="UTF-8" The layout is basically the same as in ArmVirtQemuKernel.fdf but I've changed the size to 8MB and these are the usage stats: FV Space Information FVMAINDEVICE [99%Full] 57856 total, 57800 used, 56 free FVMAINMSM8960 [99%Full] 222336 total, 222312 used, 24 free FVMAIN_COMPACT [63%Full] 8380416 total, 5305944 used, 3074472 free FVMAIN [99%Full] 17026304 total, 17026264 used, 40 free FVMAINQCOM [99%Full] 37184 total, 37152 used, 32 free and here's an uefitool report: https://pastebin.com/pnHNSFz4 The padding in line 13 is the one causing trouble. The interesting part is that it's not zero. it's value is '08 CD 03 01'. PrePiLib fails in this line: https://github.com/tianocore/edk2/blob/5a44a766b597e4c9960ac1936e6d18001c5e7ce2/EmbeddedPkg/Library/PrePiLib/FwVol.c#L682 The reason is simply that VolumeHandle is offset by 4 bytes. On Sun, Dec 10, 2017 at 10:33 PM, Ard Biesheuvel wrote: > On 10 December 2017 at 21:22, Ard Biesheuvel wrote: >> cc BaseTools maintainers >> >> On 10 December 2017 at 20:58, Michael Zimmermann >> wrote: >>> 'uefitool' shows me that there are 4 bytes of padding right before >>> FVMAIN when adding large(20MB) uncompressed FV's. >>> >>> FwVol fails detecting that and complains about the signature not being correct. >>> > > I missed the 'PrePiLib' in the subject, apologies. > > So could you elaborate please? What is the layout of the FV, and > when/how does PrePiLib complain about it?