From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3A844740052 for ; Tue, 16 Jan 2024 13:01:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bBh9lKzFyU4OvalRdRHN8f9warLQpJx/uPTLn82ujf4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705410082; v=1; b=uWoqvjhb8PwxaaxXAj3+RTDAhLymIXWUBe/TA8TGIBASgo4mmTG58a3wZT7ZVdDttvXh3+Fw EeXFpDuhas5Lb/Nadf4jSj8rdaMY7fUacN+PLSo2SYINjZYyIDK/NQWjNJZs+sTID59W7IXPD8Y f+0zq81BsHVpzQ0obNceKQco= X-Received: by 127.0.0.2 with SMTP id cpKSYY7687511xqF5DvbFkvK; Tue, 16 Jan 2024 05:01:22 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.12938.1705410081153050604 for ; Tue, 16 Jan 2024 05:01:21 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-_hFqrcnlPNu9SKLRmC9bkg-1; Tue, 16 Jan 2024 08:01:13 -0500 X-MC-Unique: _hFqrcnlPNu9SKLRmC9bkg-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57ACD1025886 for ; Tue, 16 Jan 2024 13:01:13 +0000 (UTC) X-Received: from [10.39.194.248] (unknown [10.39.194.248]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBD821BDB0; Tue, 16 Jan 2024 13:01:12 +0000 (UTC) Message-ID: <8a5ffd2a-9856-9ed4-d712-8f86dfac6096@redhat.com> Date: Tue, 16 Jan 2024 14:01:11 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 5/6] OvmfPkg/VirtNorFlashDxe: ValidateFvHeader: unwritten state is EOL too To: devel@edk2.groups.io, kraxel@redhat.com Cc: oliver@redhat.com References: <20240115155948.136499-1-kraxel@redhat.com> <20240115155948.136499-6-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240115155948.136499-6-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: wir2abgjnFw7xVbnDvaNVvH5x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=uWoqvjhb; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/15/24 16:59, Gerd Hoffmann wrote: > It is possible to find variable entries with State being 0xff, i.e. not > updated since flash block erase. This indicates the variable driver > could not complete the header write while appending a new entry, and > therefore State was not set to VAR_HEADER_VALID_ONLY. >=20 > This can only happen at the end of the variable list, so treat this as > additional "end of variable list" condition. >=20 > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c b/OvmfPkg/VirtNorF= lashDxe/VirtNorFlashFvb.c > index 8fcd999ac6df..c8b5e0be1379 100644 > --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c > +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c > @@ -302,6 +302,11 @@ ValidateFvHeader ( > break; > } > =20 > + if (VarHeader->State =3D=3D 0xff) { > + DEBUG ((DEBUG_INFO, "%a: end of var list (unwritten state)\n", __f= unc__)); > + break; > + } > + > VarName =3D NULL; > switch (VarHeader->State) { > // usage: State =3D VAR_HEADER_VALID_ONLY Reviewed-by: Laszlo Ersek -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113896): https://edk2.groups.io/g/devel/message/113896 Mute This Topic: https://groups.io/mt/103741666/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-