From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id DDBC0740048 for ; Fri, 10 May 2024 14:35:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5XVjs+N7/o02y4AlxMKdBeQIkiQdRpqGaaDM6M6NC9Q=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1715351725; v=1; b=mYCNbW3//Bxqs+iFZVPGovMEyleqTPRW+F4OBH0TuNHunjtKjLw83xmwlnlHJlmVLLnX4qk0 fJVEhDlA4GkhyLO+dAxx6GAJNKk5asUN1rfYUS7apcR6QQ4zHJHGMswcua4jaP5AyveRiVGdQ5J blRLStym01likm87Wb0Kdom4tcZhPGVvDBeq4k47T8KuqSRucU4OWF3X3w6xmcyjHWOQk6sF3Ig RYapGV8+TlXcALeQ+gnduOwsru5QAG5qpYK1CDfEgEY+/zpWwX5oNHgSdR8LmYVJAZfIM0nLAIC Sc3+zz7k7fFLTT/8+ADdaDghRF7s9BwcyhSwTWf+xpuTA== X-Received: by 127.0.0.2 with SMTP id rLIFYY7687511xC7R55oR3rL; Fri, 10 May 2024 07:35:25 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.14240.1715351724324610970 for ; Fri, 10 May 2024 07:35:24 -0700 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-672-2jR0bhRRN7Kghn-jxjHx5Q-1; Fri, 10 May 2024 10:35:20 -0400 X-MC-Unique: 2jR0bhRRN7Kghn-jxjHx5Q-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 D0F3B857A86; Fri, 10 May 2024 14:35:19 +0000 (UTC) X-Received: from osteffen-laptop.redhat.com (unknown [10.39.193.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B1F91181DD6; Fri, 10 May 2024 14:35:17 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Oliver Steffen , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: [edk2-devel] [PATCH v2 0/1] MdeModulePkg: Warn if out of space when writing variables Date: Fri, 10 May 2024 16:35:14 +0200 Message-ID: <20240510143515.580797-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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 Resent-Date: Fri, 10 May 2024 07:35:24 -0700 Resent-From: osteffen@redhat.com Reply-To: devel@edk2.groups.io,osteffen@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oE9HakkcKsFAUOIAq9kpSZvex7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="mYCNbW3/"; 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 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Emit a DEBUG_ERROR message if there is not enough space left to write/update a variable. This condition is currently not logged appropriately in all cases, given that full variable store can easily render the system unbootable. This new message helps identifying this condition quickly. Background: We had the case where an OVMF based VM ran out of flash space after a large number of reboots and hardware configuration changes. The MAC address of the NIC was changing a lot over the life time of the VM. The variable store was consumed entirely by networking related non-volatile variables, written for each network card/MAC address present during boot. Almost all of those were obsolete, of course, but the error that presented itself at first was a VM that failed to boot the firmware and ended up in an rather cryptic ASSERT message. The hope is that this new message makes it easier for non-experts to diagnose the situation. The root cause is of course not addressed by this, but it might also be hard to solve. One would have to identify obsolete network/hardware settings somehow, but there is no way to tell if a certain NIC/MAC might come back at a later point or not. Launching OVMF with a full variable store then looks like this (Debug Output): [...] CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60 UpdateVariable failed: Out of variable space Select Item: 0xE Select Item: 0x19 RecordVarErrorFlag (0xEF) Timeout:8BE4DF61-93CA-11D2-AA0D-00E098032B8C - 0x00000007 - 0x4E CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60 UpdateVariable failed: Out of variable space PlatformBootManagerBeforeConsole: SetVariable(Timeout, 3): Out of Resources RecordVarErrorFlag (0xEF) BootOrder:8BE4DF61-93CA-11D2-AA0D-00E098032B8C - 0x00000007 - 0x52 CommonVariableSpace = 0x3FF9C - CommonVariableTotalSize = 0x3FF60 UpdateVariable failed: Out of variable space ASSERT_EFI_ERROR (Status = Out of Resources) ASSERT OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c(361): !(((INTN)(RETURN_STATUS)(Status)) < 0) PR: https://github.com/tianocore/edk2/pull/5435 Changes since v1: - Mention "variable space" instead of "flash space" - Emit DEBUG_ERROR instead of DEBUG_WARN Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Oliver Steffen (1): MdeModulePkg: Warn if out of space when writing variables MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.44.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118819): https://edk2.groups.io/g/devel/message/118819 Mute This Topic: https://groups.io/mt/106017604/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-