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.133.124]) by mx.groups.io with SMTP id smtpd.web11.74533.1669986633407771711 for ; Fri, 02 Dec 2022 05:10:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NfsFAtiu; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669986632; 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=A3isFeqyF7npr1y46GFmF9tyXyyshwEs6uiBBsvuAg8=; b=NfsFAtiuJuG1hxZwMiC4Ap+mg+tMBBDPgh2j3ryqBqyglFHEiqQDUkfnAsa8WuoRKaKrRD is1gbr6oKfcDfdmN81bqzld+Ux7zxsFnmdpNDBwwdwEEzbbQIZ4voIUmqiPONEa0j+VTcB ecbKubG+bywWy+6ZQxbpMi9DvChoTko= 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-628-L1D5Ad5DPMqmsYmt7D8YPA-1; Fri, 02 Dec 2022 08:10:29 -0500 X-MC-Unique: L1D5Ad5DPMqmsYmt7D8YPA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB081101A528; Fri, 2 Dec 2022 13:10:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96BF82028CE4; Fri, 2 Dec 2022 13:10:28 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id ED670180155F; Fri, 2 Dec 2022 14:10:09 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Bob Feng , Yuwei Chen , Erdem Aktas , Jordan Justen , Peter Grehan , Rebecca Cran , Liming Gao , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Min Xu , Brijesh Singh , Oliver Steffen , Pawel Polawski , Tom Lendacky , James Bottomley Subject: [PATCH 09/14] OvmfPkg/PlatformPei: Verification: stop using mPlatformInfoHob Date: Fri, 2 Dec 2022 14:10:04 +0100 Message-Id: <20221202131009.3190040-10-kraxel@redhat.com> In-Reply-To: <20221202131009.3190040-1-kraxel@redhat.com> References: <20221202131009.3190040-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Stop using the mPlatformInfoHob global variable in S3Verification() and Q35BoardVerification() functions. Pass a pointer to the PlatformInfoHob instead. Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/Platform.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 7f3a26092626..d8c4499804fb 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -231,13 +231,14 @@ ReserveEmuVariableNvStore ( ASSERT_RETURN_ERROR (PcdStatus); } +STATIC VOID S3Verification ( - VOID + IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { #if defined (MDE_CPU_X64) - if (mPlatformInfoHob.SmmSmramRequire && mPlatformInfoHob.S3Supported) { + if (PlatformInfoHob->SmmSmramRequire && PlatformInfoHob->S3Supported) { DEBUG (( DEBUG_ERROR, "%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n", @@ -260,12 +261,13 @@ S3Verification ( #endif } +STATIC VOID Q35BoardVerification ( - VOID + IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - if (mPlatformInfoHob.HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) { + if (PlatformInfoHob->HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) { return; } @@ -274,7 +276,7 @@ Q35BoardVerification ( "%a: no TSEG (SMRAM) on host bridge DID=0x%04x; " "only DID=0x%04x (Q35) is supported\n", __FUNCTION__, - mPlatformInfoHob.HostBridgeDevId, + PlatformInfoHob->HostBridgeDevId, INTEL_Q35_MCH_DEVICE_ID )); ASSERT (FALSE); @@ -345,7 +347,7 @@ InitializePlatform ( ASSERT_EFI_ERROR (Status); } - S3Verification (); + S3Verification (&mPlatformInfoHob); BootModeInitialization (&mPlatformInfoHob); // @@ -357,7 +359,7 @@ InitializePlatform ( MaxCpuCountInitialization (&mPlatformInfoHob); if (mPlatformInfoHob.SmmSmramRequire) { - Q35BoardVerification (); + Q35BoardVerification (&mPlatformInfoHob); Q35TsegMbytesInitialization (&mPlatformInfoHob); Q35SmramAtDefaultSmbaseInitialization (&mPlatformInfoHob); } -- 2.38.1