From nobody Mon Feb 9 08:57:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100525+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100525+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677540636; cv=none; d=zohomail.com; s=zohoarc; b=NDWFAlyXDZ9hXAtXATlTPQutaIyDwyGf3OQKDyTVK4qpHVaY6L3+6GaDQ8JhoOzWZhhEm2e1yA4U7Ws+k2aetH8F9JIZRZyo2ITDCjOYiH/umRGbqsMZkw6HpiyclZxp2xfkIcrTi88vtNyy6ac8oF6UvHHHrEOSC05lnltOkPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677540636; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=N/FKMlQRpaeM7jJZnl9jxSYHlbRPQRsgnOmLM0GVKl8=; b=a3qmbgYp+aBLmhjetXwX3Sj3O25A78WEUtiHcx/6K3iWf6F9REUQ0xWkIt6bidIOsi6zgKmDoJaNDWJV3+4mAM5TXwq3ELCEt/lkJmfrYH02ObyF4DJRVQHhvVt1y18Pz/WHmYBudU9hgEfhtOGSINWihgArS56MQIuRBToa6x4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100525+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1677540636163304.42518091870056; Mon, 27 Feb 2023 15:30:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id UPmBYY1788612xIO8h3ImMTW; Mon, 27 Feb 2023 15:30:35 -0800 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web10.10602.1677540635031591935 for ; Mon, 27 Feb 2023 15:30:35 -0800 X-Received: by mail-lj1-f177.google.com with SMTP id by8so8277953ljb.7 for ; Mon, 27 Feb 2023 15:30:34 -0800 (PST) X-Gm-Message-State: sd07CKOOlH5MLy9gvVSlskwbx1787277AA= X-Google-Smtp-Source: AK7set/B34Y3XHTPNO8CDIGEwR/FV+Z0I6DeCITMETWOdh0ECvTY+slsANBVbKV0J9u3qozck7gPqw== X-Received: by 2002:a2e:8687:0:b0:295:9f20:bcdf with SMTP id l7-20020a2e8687000000b002959f20bcdfmr203083lji.9.1677540633084; Mon, 27 Feb 2023 15:30:33 -0800 (PST) X-Received: from localhost.localdomain ([195.91.209.163]) by smtp.gmail.com with ESMTPSA id r8-20020a2eb608000000b002935006e487sm908453ljn.122.2023.02.27.15.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 15:30:32 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: Mike Maslenkin , Isaac Oram , Nate DeSimone , Liming Gao Subject: [edk2-devel] [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response parsing Date: Tue, 28 Feb 2023 02:27:55 +0300 Message-Id: <20230227232757.9312-2-mike.maslenkin@gmail.com> In-Reply-To: <20230227232757.9312-1-mike.maslenkin@gmail.com> References: <20230227232757.9312-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mike.maslenkin@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1677540635; bh=IxfqInpOwKsSUTbvOYDFXwb6IdEd7AQ5d4TuIZtppKg=; h=Cc:Date:From:Reply-To:Subject:To; b=BfI8ZT7UaJKCRKINjgGw4qx7jwx8hbSXrucw00obbCpNPzkErLc5NjrGpyCHMNdhK2f UVMyuJExPfmfghdd4BJQZQ89fXjN4XIOJTt0HOeiNizCNYbYmQ6BVztcbU+YvlvlaGCus qR504iLthJG7Wdrcvhu0TSUF/SvPf8X2seA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1677540637552100003 Content-Type: text/plain; charset="utf-8" Byte 0 of a response contains completion code for the command. So, the examined data starts from byte 1. It's easy to make a mistake here since specification counts response data from 1. For the "Get Self Test Results" command Intelligent Platform Management Interface Specification v2.0 rev 1.1 paragraph 20.4 defines response as: +-----+---------------------------------------------------------------+ |byte | data field | +-----+---------------------------------------------------------------+ | 1 | Completion Code | | | | | 2 | 55h =3D No error. All Self Tests Passed. | | | 56h =3D Self Test function not implemented in this controller. | | | 57h =3D Corrupted or inaccessible data or devices | | | 58h =3D Fatal hardware error | | | | | 3 | For byte 2 =3D 55h, 56h, FFh: 00h | | | For byte 2 =3D 58h, all other: Device-specific | | | For byte 2 =3D 57h: self-test error bitfield. | +-----+---------------------------------------------------------------+ Signed-off-by: Mike Maslenkin Reviewed-by: Isaac Oram --- .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/= Dxe/IpmiInit.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericI= pmi/Dxe/IpmiInit.c index d788b4886723..aeaefaad642e 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/Ipm= iInit.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/Ipm= iInit.c @@ -161,7 +161,7 @@ Returns: // Check the IPMI defined self test results. // Additional Cases are device specific test results. // - switch (IpmiInstance->TempData[0]) { + switch (IpmiInstance->TempData[1]) { case IPMI_APP_SELFTEST_NO_ERROR: case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: IpmiInstance->BmcStatus =3D BMC_OK; @@ -173,7 +173,7 @@ Returns: // BootBlock Firmware corruption, and Operational Firmware Corrupt= ion. All // other errors are BMC soft failures. // - if ((IpmiInstance->TempData[1] & (IPMI_APP_SELFTEST_FRU_CORRUPT | = IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != =3D 0) { + if ((IpmiInstance->TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | = IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != =3D 0) { IpmiInstance->BmcStatus =3D BMC_HARDFAIL; } else { IpmiInstance->BmcStatus =3D BMC_SOFTFAIL; @@ -181,7 +181,7 @@ Returns: // // Check if SDR repository is empty and report it if it is. // - if ((IpmiInstance->TempData[1] & IPMI_APP_SELFTEST_SDR_REPOSITORY_= EMPTY) !=3D 0) { + if ((IpmiInstance->TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_= EMPTY) !=3D 0) { if (*ErrorCount < MAX_SOFT_COUNT) { StatusCodeValue[*ErrorCount] =3D EFI_COMPUTING_UNIT_FIRMWARE_P= ROCESSOR | CU_FP_EC_SDR_EMPTY; (*ErrorCount)++; --=20 2.35.3 -=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 (#100525): https://edk2.groups.io/g/devel/message/100525 Mute This Topic: https://groups.io/mt/97279448/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-