From nobody Mon Feb 9 14:50:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47934+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47934+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569324942; cv=none; d=zoho.com; s=zohoarc; b=Umcwv67oOJZ1k2lkUdxAlENytb4DjLbfNOPEWyDvVxsQ+FqdVh2pOdZt35LIgNV2eMCF7WX1zaw+wIOkUkMl4ZNEaa3QJm0TTJfoaatsp7vk+y3fC2ROcW0Svi+Vo93+xB6rVryLMOyNLyiU2t1Wbep+m1sr0sFMh/BI62+23Z4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569324942; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=r7t4BtasHgSLLgjgo1ji0ix1hYRTIR+NzB16yy3PHjw=; b=De2j6amaRtlP4t1zYzURAmB1CbyPJLQ2jW+FwlP/c5C1gHqXXtjwL5Pz+2dXTzh0JaR5oNbzia6BDvwqdBFj2bVTvVJFaaWjTBwQyApJwQ7RuXt4VASN1HB3ZEuTbTEVci54XiF0vIhGikbWfjQEnSSGgIsAtPBHPCWgzus68AQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47934+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569324942204442.1387251228631; Tue, 24 Sep 2019 04:35:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FCuvYY1788612xF7b02C261m; Tue, 24 Sep 2019 04:35:41 -0700 X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 24 Sep 2019 04:35:41 -0700 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0335AC057FA6; Tue, 24 Sep 2019 11:35:41 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-118.rdu2.redhat.com [10.10.120.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B494600CC; Tue, 24 Sep 2019 11:35:38 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Boris Ostrovsky , Brijesh Singh , Igor Mammedov , Jiewen Yao , Joao M Martins , Jordan Justen , Jun Nakajima , Michael Kinney , Paolo Bonzini , Phillip Goerl , Yingwen Chen Subject: [edk2-devel] [PATCH wave 1 10/10] OvmfPkg/PlatformPei: detect SMRAM at default SMBASE (for real) Date: Tue, 24 Sep 2019 13:35:05 +0200 Message-Id: <20190924113505.27272-11-lersek@redhat.com> In-Reply-To: <20190924113505.27272-1-lersek@redhat.com> References: <20190924113505.27272-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 24 Sep 2019 11:35:41 +0000 (UTC) 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: jTi8EswaoVD5bX7kqaGfeIBRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569324941; bh=jXPIsr2U1ZA8E7GN+pf8qpdnSJx6yL6GP0R/dKhUd1s=; h=Cc:Date:From:Reply-To:Subject:To; b=LbQtP0BOxnChyAJoi4l7PxBKZE+zxviMX5xZQsmZ0txOfI+qLmOQPwPos1QQ/kvNNN2 oUkfvJiFcUKT7tz0uHIzEvBBfEnPjjLSfeLYypxBPaRHbaZt0E7o0zAlYzqhX6xNIW8R5 4nQyovRp+Wj9+7KRkHNH+sNL6+nsVaGbI0M= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Now that the SMRAM at the default SMBASE is honored everywhere necessary, implement the actual detection. The (simple) steps are described in previous patch "OvmfPkg/IndustryStandard: add MCH_DEFAULT_SMBASE* register macros". Cc: Ard Biesheuvel Cc: Boris Ostrovsky Cc: Brijesh Singh Cc: Igor Mammedov Cc: Jiewen Yao Cc: Joao M Martins Cc: Jordan Justen Cc: Jun Nakajima Cc: Michael Kinney Cc: Paolo Bonzini Cc: Phillip Goerl Cc: Yingwen Chen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1512 Signed-off-by: Laszlo Ersek --- OvmfPkg/PlatformPei/MemDetect.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index 8fdc9c2ed7c9..3364193b4952 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -98,14 +98,23 @@ Q35SmramAtDefaultSmbaseInitialization ( VOID ) { + UINTN CtlReg; + UINT8 CtlRegVal; RETURN_STATUS PcdStatus; =20 ASSERT (mHostBridgeDevId =3D=3D INTEL_Q35_MCH_DEVICE_ID); =20 - mQ35SmramAtDefaultSmbase =3D FALSE; + CtlReg =3D DRAMC_REGISTER_Q35 (MCH_DEFAULT_SMBASE_CTL); + PciWrite8 (CtlReg, MCH_DEFAULT_SMBASE_QUERY); + CtlRegVal =3D PciRead8 (CtlReg); + + mQ35SmramAtDefaultSmbase =3D (BOOLEAN)(CtlRegVal =3D=3D MCH_DEFAULT_SMBA= SE_IN_RAM); PcdStatus =3D PcdSetBoolS (PcdQ35SmramAtDefaultSmbase, mQ35SmramAtDefaultSmbase); ASSERT_RETURN_ERROR (PcdStatus); + if (mQ35SmramAtDefaultSmbase) { + DEBUG ((DEBUG_INFO, "%a: SMRAM at default SMBASE found\n", __FUNCTION_= _)); + } } =20 =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 (#47934): https://edk2.groups.io/g/devel/message/47934 Mute This Topic: https://groups.io/mt/34274946/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-