From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mx.groups.io with SMTP id smtpd.web11.188.1678317536431357158 for ; Wed, 08 Mar 2023 15:18:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VHS03Rb6; spf=pass (domain: gmail.com, ip: 209.85.208.176, mailfrom: mike.maslenkin@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id h3so15862lja.12 for ; Wed, 08 Mar 2023 15:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678317534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JiSaIjGFRZ33PfMP7/w/i0epkyUG9X0NgOMODCHaMrY=; b=VHS03Rb6X0cOw0esnF0w+sCuj/FTofiRPFtfk84b4140Zs8YxoBgtUUQJzs51rKcD/ WdUIXKb6NQ3i2vWpeHX/Wa2TLdvjAt8JLbnsgKqJXV19niejDrGGB7OLs2I5JoveBvLM vK9casc37dBnAwhnS/JEuZ6jZqtej3Z5Ncasi5+gegmfZc6ptr00uW98IOyLvryZz+jz MiGFWhdg8s5bXVjeAqpyNLCRGjBbFb7E23PLvWNmOlOdnhoBS/QoSdA5zvV+g6chJr2n YqSP84nn7cpktsxvnYA/umwhtbo0kM/JkzsAiq+zDM5s9QfHyR6Szq/AbDP6GUSy+l9q hWTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678317534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JiSaIjGFRZ33PfMP7/w/i0epkyUG9X0NgOMODCHaMrY=; b=SBpwr8qCkW6r90pKb1fkhrm3/hCHrFxYaXYK4TaF+P+VhSavc/OplJumaMT2K5XZ0z q0dhnVg+K52oTPHgX1QCRwK8ba0XQxxGIYyZAMwRd2WaKPESbbVp8uS2NSnuwPw3h9Dv eqEr/Y4TtwEeHuFD5eZ0z9jfkWjvD16mT4AlY2A1PQ9lMrxHAEqGvBq1uD9MKlSYUeAZ FkNLHztsv3VkW3QixeXXAHDzg7miW7mt+AQ89ppyA1paoF8XGgM305kK1C/s1ntf8CZp Pd0xN4GOqHeEeFNrKQYs1U6dL4ee6lDfeu/LWemFCwIiKhj4pCZuKXdQHz89Lg83fUEy 3cCA== X-Gm-Message-State: AO0yUKUOoMuInm/TSMMoG/cXgKMg1i/T1k4RIv7f9Rp+DsVLaF2ukwY0 4WUyLPdi7Gy0LBLizUdPEreZDaLqapZgLRPBfgo= X-Google-Smtp-Source: AK7set+IoC7i3L0yzljS/1hvs9qnMXFkhWFflJ3sMrHH6WJzCdl9atCDuzsWjDvtM2xvbhiPjKkWFA== X-Received: by 2002:a2e:b006:0:b0:295:b0cd:519 with SMTP id y6-20020a2eb006000000b00295b0cd0519mr6547893ljk.3.1678317534578; Wed, 08 Mar 2023 15:18:54 -0800 (PST) Return-Path: Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id w11-20020a05651c102b00b00293526a0c87sm2726630ljm.41.2023.03.08.15.18.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 15:18:54 -0800 (PST) From: "Mike Maslenkin" To: Cc: devel@edk2.groups.io, Mike Maslenkin , Isaac Oram , Nate DeSimone , Liming Gao Subject: [PATCH edk2-platforms v2 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response parsing Date: Thu, 9 Mar 2023 02:18:43 +0300 Message-Id: <20230308231845.10895-2-mike.maslenkin@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230308231845.10895-1-mike.maslenkin@gmail.com> References: <20230308231845.10895-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Nate DeSimone Cc: Liming Gao --- .../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.=0D // Additional Cases are device specific test results.=0D //=0D - switch (IpmiInstance->TempData[0]) {=0D + switch (IpmiInstance->TempData[1]) {=0D case IPMI_APP_SELFTEST_NO_ERROR:=0D case IPMI_APP_SELFTEST_NOT_IMPLEMENTED:=0D IpmiInstance->BmcStatus =3D BMC_OK;=0D @@ -173,7 +173,7 @@ Returns: // BootBlock Firmware corruption, and Operational Firmware Corrupt= ion. All=0D // other errors are BMC soft failures.=0D //=0D - if ((IpmiInstance->TempData[1] & (IPMI_APP_SELFTEST_FRU_CORRUPT | = IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != =3D 0) {=0D + if ((IpmiInstance->TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | = IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != =3D 0) {=0D IpmiInstance->BmcStatus =3D BMC_HARDFAIL;=0D } else {=0D IpmiInstance->BmcStatus =3D BMC_SOFTFAIL;=0D @@ -181,7 +181,7 @@ Returns: //=0D // Check if SDR repository is empty and report it if it is.=0D //=0D - if ((IpmiInstance->TempData[1] & IPMI_APP_SELFTEST_SDR_REPOSITORY_= EMPTY) !=3D 0) {=0D + if ((IpmiInstance->TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_= EMPTY) !=3D 0) {=0D if (*ErrorCount < MAX_SOFT_COUNT) {=0D StatusCodeValue[*ErrorCount] =3D EFI_COMPUTING_UNIT_FIRMWARE_P= ROCESSOR | CU_FP_EC_SDR_EMPTY;=0D (*ErrorCount)++;=0D --=20 2.35.3