public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Jeff Fan <jeff.fan@intel.com>
Subject: [Patch 2/4] UefiCpuPkg RegisterCpuFeaturesLib: Add error handling.
Date: Fri, 14 Jul 2017 10:49:12 +0800	[thread overview]
Message-ID: <1500000554-21960-3-git-send-email-eric.dong@intel.com> (raw)
In-Reply-To: <1500000554-21960-1-git-send-email-eric.dong@intel.com>

Disable CPU feature may return error, add error handling
code to handle it instead of assert it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
---
 .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index e91a438..7a76730 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -536,7 +536,14 @@ AnalysisProcessorFeatures (
         }
       } else {
         Status = CpuFeatureInOrder->InitializeFunc (ProcessorNumber, CpuInfo, CpuFeatureInOrder->ConfigData, FALSE);
-        ASSERT_EFI_ERROR (Status);
+        if (EFI_ERROR (Status)) {
+          if (CpuFeatureInOrder->FeatureName != NULL) {
+            DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Name = %a.\n", CpuFeatureInOrder->FeatureName));
+          } else {
+            DEBUG ((DEBUG_WARN, "Warning :: Failed to enable Feature Mask = "));
+            DumpCpuFeatureMask (CpuFeatureInOrder->FeatureMask);
+          }
+        }
       }
       Entry = Entry->ForwardLink;
     }
-- 
2.7.0.windows.1



  parent reply	other threads:[~2017-07-14  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14  2:49 [Patch 0/4] Enable PPIN Cpu feature Eric Dong
2017-07-14  2:49 ` [Patch 1/4] UefiCpuPkg: Add PPIN related MSR for Xeon E5 Eric Dong
2017-07-14  2:49 ` Eric Dong [this message]
2017-07-14  2:49 ` [Patch 3/4] UefiCpuPkg: Add feature definition for PPIN Eric Dong
2017-07-14  2:49 ` [Patch 4/4] UefiCpuPkg CpuCommonFeaturesLib: Enable Ppin feature Eric Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500000554-21960-3-git-send-email-eric.dong@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox