From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::22a; helo=mail-it0-x22a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (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 36D2E2214E326 for ; Sun, 10 Dec 2017 13:44:38 -0800 (PST) Received: by mail-it0-x22a.google.com with SMTP id r6so11547154itr.3 for ; Sun, 10 Dec 2017 13:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WLaTidTsBukafJS9l8eCv+sH3M0guMv4q8QLKH67AW8=; b=SKGX/CFW+8yRNk7+rL6j1wUiQEKUkng97Q2iUwtx7xB71LP3zUINxXgI2TYhRncvu3 EolO0xuEqWTbaikIAKLayo68eOv7zXcG9rhwyLZo+UqYMn0h9MSFkAT4SlI8hxzTdPpd 1XPx2kequiXiPevlWHr1Pt5pUuDzBkqMfz820= 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=WLaTidTsBukafJS9l8eCv+sH3M0guMv4q8QLKH67AW8=; b=MtZ1k7S8Jd6Ml90bxAfW90v/a5xhQr/uiJ+JoPq9Xc9CBW+2jdAROP4RqmFFaZ1cU8 jBKb61FT8raZyrBd1EeftRgtBLLnnk2+inG3SkGuYv9TLrEHxj0Z1OO41Y5x9PEtCA3b skVALVpf5tonmwzuP0gzL9c+fxVVItLVFBNXKC49savXA1T7cHDGxcM452dtYeS+KRS8 5rkOdevUMmQ75BD3lx0RC9MvTxnGQt2vw/5ZvdVQjrnI7f/alV5mzx1aB9di143KOtpQ MUA7k6h/3tivlngG+l/KTAkWZdelhnf/qnR3+uNyDMiy8G3bawxEQbAr2c/aPTKg9HmQ 54oA== X-Gm-Message-State: AKGB3mLA619YtZ4RoNeDwjpMXDC4cUhHaR2Ca2y7hA3GffWfVRvjaufO s10gCrQnxJ7Ao4LBdBYr3cTUan72SpwvKKONuDrI/Q== X-Google-Smtp-Source: ACJfBotgq6NkqmVhTEdq0MgZ8MKyk0dZaunVnIhiOQVYaQ1MMozfH8ikZTI5G9YfhAL+P26YNfNeCoonsiaDGJMABow= X-Received: by 10.107.170.90 with SMTP id t87mr332926ioe.253.1512942555211; Sun, 10 Dec 2017 13:49:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Sun, 10 Dec 2017 13:49:14 -0800 (PST) In-Reply-To: References: From: Ard Biesheuvel Date: Sun, 10 Dec 2017 21:49:14 +0000 Message-ID: To: Michael Zimmermann 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:44:39 -0000 Content-Type: text/plain; charset="UTF-8" On 10 December 2017 at 21:45, Michael Zimmermann wrote: > 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. > That code is identical to PeiFfsFvPpiGetVolumeInfo() in PEI core so this does not look specific to PrePiLib. Does VolInfo complain as well?