public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Michael Zimmermann <sigmaepsilon92@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>,
	 edk2-devel-01 <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: PrePiLib's FwVol.c can't handle padding before volume header
Date: Sun, 10 Dec 2017 22:45:25 +0100	[thread overview]
Message-ID: <CAN9vWDKZeNTdYqYFVL3YwvQfpRs1E7NDcN3QH4HDpuLCbNcLdA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu-U6kxiw46kr4O=iTusNg_BK6Vg6_snzqjCrNWU-OTVhA@mail.gmail.com>

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
<ard.biesheuvel@linaro.org> wrote:
> On 10 December 2017 at 21:22, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> cc BaseTools maintainers
>>
>> On 10 December 2017 at 20:58, Michael Zimmermann
>> <sigmaepsilon92@gmail.com> 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?


  reply	other threads:[~2017-12-10 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-10 20:58 PrePiLib's FwVol.c can't handle padding before volume header Michael Zimmermann
2017-12-10 21:22 ` Ard Biesheuvel
2017-12-10 21:33   ` Ard Biesheuvel
2017-12-10 21:45     ` Michael Zimmermann [this message]
2017-12-10 21:49       ` Ard Biesheuvel
2017-12-10 21:58         ` Michael Zimmermann
2017-12-10 22:13           ` Ard Biesheuvel
     [not found]             ` <CAN9vWDK5MmyvinRXx5XQoNTnGi90rgDCFDqdGBk1t-QZ=NqNQg@mail.gmail.com>
     [not found]               ` <CAN9vWDLKTRjZ88uyiD0x8__Fm9y1Zx1W1z+Si9T9-REQFSeZXQ@mail.gmail.com>
     [not found]                 ` <CAN9vWDKKKaCGL9nRnqVWR8T60ABpCP7tH723EjXaHfc2bWsa1A@mail.gmail.com>
     [not found]                   ` <CAN9vWDJWshkMbfkBSc2pgyqWqWfc8QsfQT7pUM=Zx6VLx_5qZg@mail.gmail.com>
2017-12-10 22:18                     ` Michael Zimmermann
2017-12-10 23:08                       ` Ard Biesheuvel
2017-12-11  7:30                         ` Michael Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN9vWDKZeNTdYqYFVL3YwvQfpRs1E7NDcN3QH4HDpuLCbNcLdA@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox