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 932B6AC0C85 for ; Fri, 10 May 2024 08:58:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nfArlvbl8tGmkFh1I2KLsfTT7VFhwkr/WQfp3vKjx2Y=; 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=1715331528; v=1; b=ShjRTl7jrDTpoNHCSNO0WsAqxg4iBqVviRuEOR2W0J36ChKhO4LgkUWyNUo1byl6VPppS5eV K19gT4TDG+341FfJIj7+hHONkdi/FKw//rGHZoHxCS579LfgPVVVeO+7+NJ83VmCSzzwF3m2ynN wc6A7HsY2lO8gwT6oUmgspsq5Tdyf44kr6dFM77z5fP1asWFCHVDQr+ciUu61S1hEhLFePhNw9v Jr0pxGAxH1nFNK7O7HCp0ktjM7+7bUTedA+o+pFCgmj1Xu48VN8xp8ENYli4AtdWSn/CHVdndZj jRTcr4ZI/PTZdHpN9BKc2nCjxWVPL0blcpBpdu6rokvGA== X-Received: by 127.0.0.2 with SMTP id lAALYY7687511xhgTkMtu9XS; Fri, 10 May 2024 01:58:48 -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.8280.1715331526988844826 for ; Fri, 10 May 2024 01:58:47 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-u6P8mxa4OfWIamzKfo5F7g-1; Fri, 10 May 2024 04:58:42 -0400 X-MC-Unique: u6P8mxa4OfWIamzKfo5F7g-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 6C9BF3C0E448; Fri, 10 May 2024 08:58:42 +0000 (UTC) X-Received: from osteffen-laptop.redhat.com (unknown [10.39.193.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD7856FE41; Fri, 10 May 2024 08:58:39 +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 10:58:36 +0200 Message-ID: <20240510085837.551965-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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 01:58:47 -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: FPVDtKpjKnB5jy0nVfW12UHPx7686176AA= 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=ShjRTl7j; 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 (#118790): https://edk2.groups.io/g/devel/message/118790 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] -=-=-=-=-=-=-=-=-=-=-=-