From nobody Sat Feb 7 09:46:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+58033+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58033+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587714850; cv=none; d=zohomail.com; s=zohoarc; b=i8Q+M5dJB+H6bAt/j/qPSoCU5CSZAX3ygIYkX0Rc+sKs30UvnwiG6tLw/OKOJdCmn3FiH4h1byZAtAxtSOtLSscc3AChfLUULhPMyYAJzL66en1b68Ef9DLjCDINlPLKX0Tj5/woON4SNhLKdtgsbi6VJw9i/CnMf6FPmDwmSBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587714850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=cP5tle3WQ05kxBa3xtxwso+yctmAIu8bE5ILgmAwRGk=; b=TkdZsfPDM2CYdJmu8cf4jkL3lVEsXKwahdROO3K/yyCa0l5+4M5Dl7VD0gvf7PLV6PD++ckdL/zsAZaHYKRUiyxH5b3H5GIEPxs6U6mAv+1/qMOrYYKWMmuOt7pbsBDiB4PWnUNMq5qLGHPlaej0x5ursr5T0Dtl3N+am6Mco6k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58033+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587714850838714.4805665068559; Fri, 24 Apr 2020 00:54:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id kI1pYY1788612xalb9AYIvDi; Fri, 24 Apr 2020 00:54:10 -0700 X-Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web12.1578.1587714849929493747 for ; Fri, 24 Apr 2020 00:54:10 -0700 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-rz-nZFmQOnWqDmRgu_cTOQ-1; Fri, 24 Apr 2020 03:54:05 -0400 X-MC-Unique: rz-nZFmQOnWqDmRgu_cTOQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76666800580; Fri, 24 Apr 2020 07:54:04 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-159.ams2.redhat.com [10.36.113.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34BE010016DA; Fri, 24 Apr 2020 07:54:03 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Jordan Justen , Per Sundstrom , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 3/7] OvmfPkg/PlatformPei: use QemuFwCfgParseBool in UPDATE_BOOLEAN_PCD_FROM_... Date: Fri, 24 Apr 2020 09:53:49 +0200 Message-Id: <20200424075353.8489-4-lersek@redhat.com> In-Reply-To: <20200424075353.8489-1-lersek@redhat.com> References: <20200424075353.8489-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: ebSJQiRjENLElalLSy94jJuOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587714850; bh=cP5tle3WQ05kxBa3xtxwso+yctmAIu8bE5ILgmAwRGk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XdwC1IDR7pRUeioBI1ZmzeJo4FHaMcvv0q/oz8z8hnunk1vJDIfpmstFFrvo2OBwqD3 tUIdFpZ9AMzEfLzwAfg7sxIfMZJS4sM70EktRSdM4FUcvWFK6Z/ye8/Eb6/qTiPpWq2Gg ZBVEXviOFjv46jOU2oY10sYYTftJWTbqI6A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The UPDATE_BOOLEAN_PCD_FROM_FW_CFG() macro currently calls the module-private helper function GetNamedFwCfgBoolean(). Replace the latter with QemuFwCfgParseBool() from QemuFwCfgSimpleParserLib. This change is compatible with valid strings accepted previously. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Per Sundstrom Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2681 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- OvmfPkg/PlatformPei/Platform.c | 47 +------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 088e616a980c..3b850c2c2626 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -254,56 +255,12 @@ MemMapInitialization ( ASSERT_RETURN_ERROR (PcdStatus); } =20 -EFI_STATUS -GetNamedFwCfgBoolean ( - IN CHAR8 *FwCfgFileName, - OUT BOOLEAN *Setting - ) -{ - EFI_STATUS Status; - FIRMWARE_CONFIG_ITEM FwCfgItem; - UINTN FwCfgSize; - UINT8 Value[3]; - - Status =3D QemuFwCfgFindFile (FwCfgFileName, &FwCfgItem, &FwCfgSize); - if (EFI_ERROR (Status)) { - return Status; - } - if (FwCfgSize > sizeof Value) { - return EFI_BAD_BUFFER_SIZE; - } - QemuFwCfgSelectItem (FwCfgItem); - QemuFwCfgReadBytes (FwCfgSize, Value); - - if ((FwCfgSize =3D=3D 1) || - (FwCfgSize =3D=3D 2 && Value[1] =3D=3D '\n') || - (FwCfgSize =3D=3D 3 && Value[1] =3D=3D '\r' && Value[2] =3D=3D '\n')= ) { - switch (Value[0]) { - case '0': - case 'n': - case 'N': - *Setting =3D FALSE; - return EFI_SUCCESS; - - case '1': - case 'y': - case 'Y': - *Setting =3D TRUE; - return EFI_SUCCESS; - - default: - break; - } - } - return EFI_PROTOCOL_ERROR; -} - #define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName) \ do { \ BOOLEAN Setting; \ RETURN_STATUS PcdStatus; \ \ - if (!EFI_ERROR (GetNamedFwCfgBoolean ( \ + if (!RETURN_ERROR (QemuFwCfgParseBool ( \ "opt/ovmf/" #TokenName, &Setting))) { \ PcdStatus =3D PcdSetBoolS (TokenName, Setting); \ ASSERT_RETURN_ERROR (PcdStatus); \ --=20 2.19.1.3.g30247aa5d201 -=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 (#58033): https://edk2.groups.io/g/devel/message/58033 Mute This Topic: https://groups.io/mt/73236894/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-