From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.18151.1678452535604830889 for ; Fri, 10 Mar 2023 04:48:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gITMCQ25; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678452534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ECqNc7d3aSs54xVJnuiVJvlyjNzO0n/dYFzBdg9DHfQ=; b=gITMCQ25KhJ/fhkGIyx+lk7CqKlfg+QVL2xgTRCz1I/8hA/Kn5lP3QF2dzN6P0R9TeDBcJ ek2MC+JaHgNE/hfLQWATGEZH7Bn/3mSnPcnY/oWkYFvcUqdqIkl1aYoiZDBk/btsPj9B6B jOS2ScRufFm1shsJfLcc1cCkt/XK3hs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-8JQmEPNXOni_LTY-aIjaCw-1; Fri, 10 Mar 2023 07:48:51 -0500 X-MC-Unique: 8JQmEPNXOni_LTY-aIjaCw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F4D880D0F9; Fri, 10 Mar 2023 12:48:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D89FD2166B26; Fri, 10 Mar 2023 12:48:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 83B3F1800986; Fri, 10 Mar 2023 13:48:49 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Ray Ni , Oliver Steffen , Gerd Hoffmann , Rahul Kumar , Pawel Polawski , Eric Dong Subject: [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for obsolete processors Date: Fri, 10 Mar 2023 13:48:48 +0100 Message-Id: <20230310124849.831839-2-kraxel@redhat.com> In-Reply-To: <20230310124849.831839-1-kraxel@redhat.com> References: <20230310124849.831839-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 --- 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