public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Ray Ni <ray.ni@intel.com>, Oliver Steffen <osteffen@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Rahul Kumar <rahul1.kumar@intel.com>,
	Pawel Polawski <ppolawsk@redhat.com>,
	Eric Dong <eric.dong@intel.com>
Subject: [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for obsolete processors
Date: Fri, 10 Mar 2023 13:48:48 +0100	[thread overview]
Message-ID: <20230310124849.831839-2-kraxel@redhat.com> (raw)
In-Reply-To: <20230310124849.831839-1-kraxel@redhat.com>

It's highly unlikely the code ever runs on processors which are
almost 30 years old.  Drop the code handling them.

Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4345
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
index d2d0950f3b42..55a9f79da8eb 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
@@ -871,24 +871,14 @@ PiCpuSmmEntry (
     //
     DEBUG ((DEBUG_INFO, "PiCpuSmmEntry: gSmmBaseHobGuid not found!\n"));
     //
+    // very old processors (i486 + pentium) need 32k not 4k alignment, exclude them.
+    //
+    ASSERT (FamilyId >= 6);
+    //
     // Allocate buffer for all of the tiles.
     //
-    // Intel(R) 64 and IA-32 Architectures Software Developer's Manual
-    // Volume 3C, Section 34.11 SMBASE Relocation
-    //   For Pentium and Intel486 processors, the SMBASE values must be
-    //   aligned on a 32-KByte boundary or the processor will enter shutdown
-    //   state during the execution of a RSM instruction.
-    //
-    // Intel486 processors: FamilyId is 4
-    // Pentium processors : FamilyId is 5
-    //
     BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));
-    if ((FamilyId == 4) || (FamilyId == 5)) {
-      Buffer = AllocateAlignedCodePages (BufferPages, SIZE_32KB);
-    } else {
-      Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
-    }
-
+    Buffer      = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
     ASSERT (Buffer != NULL);
     DEBUG ((DEBUG_INFO, "New Allcoated SMRAM SaveState Buffer (0x%08x, 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE (BufferPages)));
   }
-- 
2.39.2


  reply	other threads:[~2023-03-10 12:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 12:48 [PATCH 0/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for obsolete processors, fix error handling Gerd Hoffmann
2023-03-10 12:48 ` Gerd Hoffmann [this message]
2023-03-20 10:04   ` [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for obsolete processors Ni, Ray
2023-03-10 12:48 ` [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling Gerd Hoffmann
2023-03-20 10:04   ` Ni, Ray
2023-03-22  1:55   ` Ni, Ray

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=20230310124849.831839-2-kraxel@redhat.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