From nobody Tue Feb 10 00:00:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53536+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53536+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1580334267971951.0929866649313; Wed, 29 Jan 2020 13:44:27 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id R6TtYY1788612xVtdQ7tYxtL; Wed, 29 Jan 2020 13:44:27 -0800 X-Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.612.1580334265699648796 for ; Wed, 29 Jan 2020 13:44:25 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-UX0SOLB4NqqGR-R7iTCR_Q-1; Wed, 29 Jan 2020 16:44:22 -0500 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66D3F18A6EC0; Wed, 29 Jan 2020 21:44:21 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 736535DA75; Wed, 29 Jan 2020 21:44:20 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Jordan Justen Subject: [edk2-devel] [PATCH v2 04/11] OvmfPkg/PlatformPei: factor out Q35BoardVerification() Date: Wed, 29 Jan 2020 22:44:05 +0100 Message-Id: <20200129214412.2361-5-lersek@redhat.com> In-Reply-To: <20200129214412.2361-1-lersek@redhat.com> References: <20200129214412.2361-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: UX0SOLB4NqqGR-R7iTCR_Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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 X-Gm-Message-State: r1xvGBp7FRQd9WhJ2K7Iq7nRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1580334267; bh=eOVx3JuPgmYMOtHfGhyCp8XNTcAfieQU/AJlxlJzt7U=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=l9dK60cziDoamQUhp7Xg2uZOXfV2MyRhDekiY+VMMDlbt7qoS8hmtTo4icZAnwBtY5z s9p+kIvZ1TvAOrrLQ5Exvjc69g6+FTbwK2/iTcUWNXtwDSQqmT0bKsafDYfbIAZjWbbme JJ9qYYGDB3hcaw+qYvddiCNE56qTBaBeMgk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Before adding another SMM-related, and therefore Q35-only, dynamically detectable feature, extract the current board type check from Q35TsegMbytesInitialization() to a standalone function. Cc: Ard Biesheuvel Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1512 Signed-off-by: Laszlo Ersek Reviewed-by: Jiewen Yao --- Notes: v2: - trim Cc list - pick up Jiewen's R-b OvmfPkg/PlatformPei/MemDetect.c | 13 +---------- OvmfPkg/PlatformPei/Platform.c | 23 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index d451989f31c9..58b171fba1c8 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -53,18 +53,7 @@ Q35TsegMbytesInitialization ( UINT16 ExtendedTsegMbytes; RETURN_STATUS PcdStatus; =20 - if (mHostBridgeDevId !=3D INTEL_Q35_MCH_DEVICE_ID) { - DEBUG (( - DEBUG_ERROR, - "%a: no TSEG (SMRAM) on host bridge DID=3D0x%04x; " - "only DID=3D0x%04x (Q35) is supported\n", - __FUNCTION__, - mHostBridgeDevId, - INTEL_Q35_MCH_DEVICE_ID - )); - ASSERT (FALSE); - CpuDeadLoop (); - } + ASSERT (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID); =20 // // Check if QEMU offers an extended TSEG. diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index e5e8581752b5..510d6d7477ec 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -566,6 +566,28 @@ S3Verification ( } =20 =20 +VOID +Q35BoardVerification ( + VOID + ) +{ + if (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID) { + return; + } + + DEBUG (( + DEBUG_ERROR, + "%a: no TSEG (SMRAM) on host bridge DID=3D0x%04x; " + "only DID=3D0x%04x (Q35) is supported\n", + __FUNCTION__, + mHostBridgeDevId, + INTEL_Q35_MCH_DEVICE_ID + )); + ASSERT (FALSE); + CpuDeadLoop (); +} + + /** Fetch the boot CPU count and the possible CPU count from QEMU, and expose them to UefiCpuPkg modules. Set the mMaxCpuCount variable. @@ -768,6 +790,7 @@ InitializePlatform ( MaxCpuCountInitialization (); =20 if (FeaturePcdGet (PcdSmmSmramRequire)) { + Q35BoardVerification (); Q35TsegMbytesInitialization (); } =20 --=20 2.19.1.3.g30247aa5d201 -=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 (#53536): https://edk2.groups.io/g/devel/message/53536 Mute This Topic: https://groups.io/mt/70252353/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-