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.web11.13444.1674043345012425345 for ; Wed, 18 Jan 2023 04:02:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ORhnl11U; 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=1674043344; 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: in-reply-to:in-reply-to:references:references; bh=cdOHCxUHTZN3Dg0DBUqso8X/Ng+P2Z/qxr9uSe1qw6U=; b=ORhnl11UNEAooBHJMIywBACba+Dr5luBzhSM1d2AZK7rfuuJu5EHrPpR5pnKjuhulXf9sz L5zaOt/4bwm7CXvj0W9T7+cG9K4SbGEpGm3SVwpotuKcNGQbGTLI2j2NgxyueIN1i8NMKV N2VttpdLqVnxP4J15I1iWqwUa9Jf0RQ= 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-59-UL4_dCb2MHi6qm2x4pZXig-1; Wed, 18 Jan 2023 07:02:22 -0500 X-MC-Unique: UL4_dCb2MHi6qm2x4pZXig-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9FA05101A52E; Wed, 18 Jan 2023 12:02:21 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EC74C15BAD; Wed, 18 Jan 2023 12:02:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 56EED1800091; Wed, 18 Jan 2023 13:02:18 +0100 (CET) Date: Wed, 18 Jan 2023 13:02:18 +0100 From: "Gerd Hoffmann" To: Jiaxin Wu Cc: devel@edk2.groups.io, Eric Dong , Ray Ni , Zeng Star , Laszlo Ersek , Rahul Kumar Subject: Re: [PATCH v3 3/5] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info Message-ID: <20230118120218.7elnglgn3k7dd2bf@sirius.home.kraxel.org> References: <20230118095620.9860-1-jiaxin.wu@intel.com> <20230118095620.9860-4-jiaxin.wu@intel.com> MIME-Version: 1.0 In-Reply-To: <20230118095620.9860-4-jiaxin.wu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > index f723b1d253..a39d8528db 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > @@ -57,11 +57,10 @@ SMM_CPU_PRIVATE_DATA *gSmmCpuPrivate = &mSmmCpuPrivateData; > > // > // SMM Relocation variables > // > volatile BOOLEAN *mRebased; > -volatile BOOLEAN mIsBsp; > +UINT32 mBspApicId = 0; This should be moved to a separate patch with commit message explaining the reasons for the change. My guess would be this is required to allow processors running SmmInitHandler in parallel. Why mIsBsp is removed but mRebased is not? > - // Allocate buffer for all of the tiles. > + // Check whether the Required TileSize is enough. > // > - // 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. > + if (TileSize > SIZE_8KB) { > + DEBUG ((DEBUG_ERROR, "The Range of Smbase in SMRAM is not enough -- Required TileSize = 0x%08x, Actual TileSize = 0x%08x\n", TileSize, SIZE_8KB)); > + CpuDeadLoop (); > + return RETURN_BUFFER_TOO_SMALL; > + } Where does the 8K come from? This change is not mentioned in the commit message and most likely should be a separate patch. take care, Gerd