From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3B6BED81195 for ; Mon, 13 Nov 2023 14:34:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nbxnm0OS936HKuvJWS4/XlsIc2YlK7tFF7uipPkWiK0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699886057; v=1; b=kbPrnd6Up/EuYJL3+h2i38SgvI2AFnAZCVV4j6TLmDvSlujK1XFM9E/sIvLg4h6+xrXzA+Dt nWVigJDG0ogb8bQF4soXWXGT678d9MNiOvjdANB4fzJraQ5xVaAsLCbUl9jvkdUJ2wGGjXezo8S cqkkx+Sa66IyLNn/oK3TAbMk= X-Received: by 127.0.0.2 with SMTP id p1OdYY7687511xgKEDm1SGqK; Mon, 13 Nov 2023 06:34:17 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.38111.1699886057169037902 for ; Mon, 13 Nov 2023 06:34:17 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-520-PTwfU-nRNgqFfNU-sFwLJQ-1; Mon, 13 Nov 2023 09:33:14 -0500 X-MC-Unique: PTwfU-nRNgqFfNU-sFwLJQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C49B185A785; Mon, 13 Nov 2023 14:33:14 +0000 (UTC) X-Received: from [10.39.192.220] (unknown [10.39.192.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23455502C; Mon, 13 Nov 2023 14:33:13 +0000 (UTC) Message-ID: <97208ec6-b559-4134-f76e-9f6b446edc03@redhat.com> Date: Mon, 13 Nov 2023 15:33:12 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 0/3] Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg. To: devel@edk2.groups.io, dun.tan@intel.com References: <20231109025107.1787-1-dun.tan@intel.com> From: "Laszlo Ersek" In-Reply-To: <20231109025107.1787-1-dun.tan@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1XPOe664SPAfU0YAEFFbKBbOx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=kbPrnd6U; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 11/9/23 03:51, duntan wrote: > Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg. >=20 > Previously, the HOB is defined, created and consumed only in StandaloneMm= Pkg. The HOB contains the number > of processors and EFI_PROCESSOR_INFORMATION structure. This is the same a= s the information that PiSmmCpuDxeSmm > uses EfiMpServiceProtocolGuid to get. >=20 > The incoming plan is to create gMpInformationHobGuid for both StandaloneM= m and legacy DXE_SMM in early > phase(for example in CpuMpPei). Then PiSmmCpuDxeSmm can consume the hob, = which can simplify code logic > in PiSmmCpuDxeSmm driver. >=20 > So move this HOB definition to UefiCpuPkg in this patch series. >=20 > Dun Tan (3): > UefiCpuPkg: Create MpInformation.h in UefiCpuPkg > StandaloneMmPkg:Add UefiCpuPkg.dec in DependencyCheck > StandaloneMmPkg:Remove MpInformation.h >=20 > StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf = | 1 + > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntry= Point.inf | 1 + > StandaloneMmPkg/StandaloneMmPkg.ci.yaml = | 3 ++- > StandaloneMmPkg/StandaloneMmPkg.dec = | 1 - > {StandaloneMmPkg =3D> UefiCpuPkg}/Include/Guid/MpInformation.h = | 2 +- > UefiCpuPkg/UefiCpuPkg.dec = | 3 +++ > 6 files changed, 8 insertions(+), 3 deletions(-) > rename {StandaloneMmPkg =3D> UefiCpuPkg}/Include/Guid/MpInformation.h (8= 8%) >=20 >From a quick skim, the series looks OK to me, and I also agree that the above two MP services calls (GetNumberOfProcessors, GetProcessorInfo) seem to be the only ones in PiSmmCpuDxeSmm. However, what about the following scenario: - in the PI phase (or HOB producer phase), the HOB is produced - in the DXE phase, a platform DXE driver uses EFI_MP_SERVICES_PROTOCOL to change some aspect of the processors in the system. For example, it calls SwitchBSP, or calls EnableDisableAP. - Then the information in the HOB will be stale, once PiSmmCpuDxeSmm consumes it. The EFI_PROCESSOR_INFORMATION.StatusFlag field carries information both about the CPU in question being BSP vs. AP, and about the CPU being enabled or disabled. So either of SwitchBSP() and EnableDisableAP() can invalidate the StatusFlag field for a given ProcessorId. I don't know how StandaloneMmPkg currently deals with this scenario, and I also don't know whether StatusFlag actually matters to PiSmmCpuSmmDxe. Apparently, it doesn't. So technically, the replacement of the protocol with the HOB should be fine, but for the general case, we should document somehow that specific fields of the HOB may be invalidated between HOB production and HOB consumption. If platform code is required to prevent that (i.e., the platform is responsible for not calling SwitchBSP() or EnableDisableAP()), then that requirement should also be documented. Acked-by: Laszlo Ersek Thanks Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111155): https://edk2.groups.io/g/devel/message/111155 Mute This Topic: https://groups.io/mt/102479007/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-