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 6DA36AC105E for ; Tue, 16 Jan 2024 09:38:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Lzb2FDtyNxyKGgAK0psLzDUNke2c33GuJqqBaLu2Q6o=; 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=1705397879; v=1; b=cYKxQfDPwdjJyXcaC9OQIB+u6QYgEeCAtkxLbY+cgfjWhKrTmyUteXyButJk+k/B7vhOqu6C AtGnH9bpoOzaErnGGE+A7QCvvt9pdzEnV8csCS0u+DxfHj1Fj4lE10P8RdZV/3r2zjnyyCqE5uJ doOyKhEb80Fl7ZpJUFOGo3Qo= X-Received: by 127.0.0.2 with SMTP id PW2gYY7687511xXpERi9PbTD; Tue, 16 Jan 2024 01:37:59 -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.web10.9532.1705397878165955432 for ; Tue, 16 Jan 2024 01:37:58 -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-583-YQb1M8WiNL2E8k2b1sHxJQ-1; Tue, 16 Jan 2024 04:37:47 -0500 X-MC-Unique: YQb1M8WiNL2E8k2b1sHxJQ-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 D36F485A5B5; Tue, 16 Jan 2024 09:37:46 +0000 (UTC) X-Received: from [10.39.194.248] (unknown [10.39.194.248]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9EB41BDB0; Tue, 16 Jan 2024 09:37:45 +0000 (UTC) Message-ID: Date: Tue, 16 Jan 2024 10:37:44 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements To: Ard Biesheuvel Cc: devel@edk2.groups.io, kraxel@redhat.com, Ard Biesheuvel , Jiewen Yao , oliver@redhat.com References: <20240112113754.14710-1-kraxel@redhat.com> <01ac5fab-2710-4231-a7cd-1c550fa6319f@redhat.com> From: "Laszlo Ersek" In-Reply-To: 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: 2GgckgCyEx4UmfZIsJt1frXkx7686176AA= 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=cYKxQfDP; 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 18:56, Ard Biesheuvel wrote: > On Mon, 15 Jan 2024 at 11:21, Laszlo Ersek wrote: >> >> On 1/12/24 12:37, Gerd Hoffmann wrote: >>> This is a little series containing the flash corruption fix sent >>> yesterday with an slightly improved commit message and some small >>> improvements on top of this. >>> >>> Gerd Hoffmann (4): >>> OvmfPkg/VirtNorFlashDxe: fix shadowbuffer reads >>> OvmfPkg/VirtNorFlashDxe: clarify block write logic >>> OvmfPkg/VirtNorFlashDxe: allow larger writes without block erase >>> OvmfPkg/VirtNorFlashDxe: ValidateFvHeader: unwritten state is EOL too >>> >>> OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c | 33 +++++++++++------------ >>> OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c | 5 ++++ >>> 2 files changed, 21 insertions(+), 17 deletions(-) >>> >> >> Looking at the original code makes me throw a fit (no offense -- I don't >> know who wrote it, and I don't want to check). >> >=20 > Hi Laszlo, >=20 > I am not the author of the original code, but I suppose I should take > at least some of the blame here, having added some of the logic to > reduce the number of MMIO accesses (which are disproportionately > expensive under virtualization), and this is where the bug got > introduced afaict. ... sorry about being needlessly harsh. If it's any excuse: in all such cases I make a fully committed, honest effort to dig down to the "roots" of the code, and the more I struggle to form a mental image, the more annoyed/stressed I get. Comments and diagrams would definitely help with my efforts, but just because I get annoyed during first analysis, that is not sufficient reason to let that *leak* to the list. It's a personality defect on my end. I'll keep working on it. Laszlo -=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 (#113881): https://edk2.groups.io/g/devel/message/113881 Mute This Topic: https://groups.io/mt/103680930/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-