From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.11803.1599011032721088739 for ; Tue, 01 Sep 2020 18:43:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=LKKE6/qC; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: ray.ni@intel.com) IronPort-SDR: UBYY4SUrUJRfVTtn8VGgXMIImyVqY8GLaY7V4CZVUFpDKE2plOGWnkKASq4sS3aZFmdYuret6g +H3EUVAGoFRQ== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="145037033" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="145037033" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2020 18:43:45 -0700 IronPort-SDR: sg0AV+YU6b9WJ3Z9r2dUyRD4RjRV3eGXUAiF+OaBOe1C116+WWvH9ENiDmsmePW8N5wqTCgUjP FImPYGqCeuqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="297514504" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 01 Sep 2020 18:43:45 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 1 Sep 2020 18:43:44 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 1 Sep 2020 18:43:44 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 1 Sep 2020 18:43:43 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.43) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 1 Sep 2020 18:43:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k24DIlk2cSPBXhwZOV87moryA2UpXtjmWY9d2KBIql3LwMIETGeVlQNING881ftHa1A/yaq0RBGr1aZ57RcjgZgQVMUl81J38bsvrWVTEUP0DaPNa372LIFwxRFCZQYsJ1oBUqGSrn89njQslkHLJIpUq1x8SFXBie4/JvcH0jgoW+LqdmLlyGrlUQDGTQgW2D1zyRA3L8WBuWBS3++Kc3zo4T6fThoA2rweis12ndOClSVySz75s+fPY0W+kbjL5cRLhEzHDQtWphokPhi8ueqPKouhoTm0jLTEFP2R5gKFmbL1ITrDnFPph+g2TZMS00CXJ2REK7L564p8eyBUXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=68S4BIaGcu/MurX2e0Qn15c3AOAoNThzuq72nw0hgrU=; b=Glyiq0DnXVR5i6sg22WZHAZeJXJ87w9Wk6TjvdvhqnXS3igAY/mIl0KPftBoGKaZZBEvfL2612Fb2R0190ocwkjhl4tgxdk9AilaGKkWkXBDQ286FtMyon4A+J/sdKad0mUyKfAtIhp2XazCjRIiOWpfYbClHBJAKUJ1ip2jARaCH/Y9Sq5x41i7si1YCz1m3eB3Y8qN7onZODOHhKS1nrHUGnlQj0lodghfTiARhtL74I8nq/Qh2COGdc1DLYkk8l8utpHN54dHM/jJTmJXsZxHi0pOal9mVXJSXUqJy1Fx+2/6nr92UrJUTKS6LMBp0DUuHK8Jc/BPh4rWSHVqGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=68S4BIaGcu/MurX2e0Qn15c3AOAoNThzuq72nw0hgrU=; b=LKKE6/qCXXNGbKeRfU6nuGZpugLtUq1UHIPUQMRrHz1aIISwTwTrqTzwwuvzYyP+aRNeUs5WDXe3KpVMuZNNRcF14BVcLEYJb0ZtMyXCOfgSB4h0hMD1Byig9Ekv47IPvMcG7gH/sdrTODbCMfnL9+qvvMcOYwfwEWeRYP1oNII= Received: from BY5PR11MB4007.namprd11.prod.outlook.com (2603:10b6:a03:189::28) by BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Wed, 2 Sep 2020 01:43:41 +0000 Received: from BY5PR11MB4007.namprd11.prod.outlook.com ([fe80::889e:ec52:bb02:db78]) by BY5PR11MB4007.namprd11.prod.outlook.com ([fe80::889e:ec52:bb02:db78%3]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 01:43:41 +0000 From: "Ni, Ray" To: "Sheng, W" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [PATCH v3 3/3] IntelSiliconPkg/PlatformVTdInfoSamplePei: Install Null Root Entry Table Thread-Topic: [PATCH v3 3/3] IntelSiliconPkg/PlatformVTdInfoSamplePei: Install Null Root Entry Table Thread-Index: AQHWf2F85ci/Y6ms6ki6yAkvDiV/W6lUleLQ Date: Wed, 2 Sep 2020 01:43:32 +0000 Deferred-Delivery: Wed, 2 Sep 2020 01:43:00 +0000 Message-ID: References: <20200831063804.8208-1-w.sheng@intel.com> <20200831063804.8208-4-w.sheng@intel.com> In-Reply-To: <20200831063804.8208-4-w.sheng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [180.171.153.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d19b9282-6c70-4ba2-14a3-08d84ee19ed3 x-ms-traffictypediagnostic: BYAPR11MB3622: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e5w3MnlOKMEE09mjCoSGBte6tR+mMTcS/HAQNpcWo0U7pv19Mcqo77RO/644foihgQy8dxjv9IVcky3YWfMwCjVp2vXnLpKMmiBY91xJ1olZfyn7jBWMXASnmrSdy+3q4lj7FmS9UP/KoCKOzLbeG4WnfcQQPP2HzlcpKGTx8lkoXCQIJQuLFH02/6iJSHmpqSKhDZYLZxaCLPufnC1kxH3kL0EkOVSVP+MHj6/FKQiO7D8jy2aYAaY4Ja3yOqY3lSqCsWb+XgIw3xXPYqaYWI0PF6my/B66n3EIIVs7EllQRuCnAdks+vXD1g4xbs7ZG05jmpcyHmwtZ3Eowam6m2/BH6TWnJiwwjQjS5hY9ioZkl3bnJMxjZTTWrDXp8ij9cc7x97BwJBgw4vWLQBabw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB4007.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(136003)(376002)(366004)(346002)(39860400002)(396003)(26005)(8676002)(52536014)(9686003)(8936002)(107886003)(6506007)(110136005)(33656002)(53546011)(71200400001)(7696005)(86362001)(66946007)(2906002)(966005)(5660300002)(478600001)(66446008)(76116006)(66476007)(66556008)(4326008)(64756008)(316002)(186003)(83380400001)(55016002)(6666004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: J2/FS96j2dGvGlxiZIXLJRyZ6c/JCAG4v4MwsSWjLzo037SsvcQFMpHmuqHAQBB+ZYVBbHPFGoHNfJDilC+x3KbKBteS1+8oIp4gH8LmP2VqAcTSqrz7i4PBlUVBeTYVRoEIlJ3s1kXJ38ZC0rDUMombKbI832zyt/Uzumbq80fwv3UrFFnBq2+EKa+MdvgQmkkyMm6hABOEdJje7vkJG+OHPPlw+cYjc19CS3mw18qCmV/p4qqEs2fwlfnKWYpRlxHsCEOem7RBPt47K+3Ua0p2dg/DH4J21nNUEGOrx67doCeAs4Y3XFtzFVPen5tenjoXEd5gKWpRaQ5jzlHr9BT6d9Y0tqq/2j+Jyo2eFC7IIJ8WnOsPspgWgSI3kfzK80XnpORPGLf+4dUaW6oSuVkmSIiX0m8QTX7MZl1TFqZi+KN21ywzCxSIkXr0ap/feOLEcKKzeCkNiM3VfJpBuk2sgvYofzaxL39vcVzywhigyi4nGrsTgoP6bwyIFyRZOD1jOrc/3xHb7m9VpvQdvUMTWnsh8qSDwG5A49HKNKT8DNRfgqeaUJl0svnqtddVzfS07CtyMvzFNIaRRveLF3dl0y4Ko7Z/COEPZF0TZsFGwt7AbnaxjwMidNevWRVKThYhdIfKsQZocfZ1swS6DQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4007.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d19b9282-6c70-4ba2-14a3-08d84ee19ed3 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2020 01:43:41.1267 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +RQjqo1rkczLmysGAn2YN5n9G0bdJyTmiloDPqx4F3jhyWpUwESqgrOJFnXcqiPPm2o7sqkXNDJ6SNiC6s/hXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3622 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Sheng, W > Sent: Monday, August 31, 2020 2:38 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Chaganty, Rangasai V > Subject: [PATCH v3 3/3] IntelSiliconPkg/PlatformVTdInfoSamplePei: Install= Null Root Entry Table >=20 > BIOS uses TE with a null root entry table to block VT-d engine access > to block any DMA traffic in pre-memory phase. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2867 >=20 > Change-Id: I6c086c1f26e60f781de79cc37677cc5717c5edec > Cc: Ray Ni > Cc: Rangasai V Chaganty > Signed-off-by: Sheng Wei > --- > .../PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c | 16 ++++++++++= ++++++ > .../PlatformVTdInfoSamplePei.inf | 3 ++- > 2 files changed, 18 insertions(+), 1 deletion(-) >=20 > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSam= plePei/PlatformVTdInfoSamplePei.c > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/Plat= formVTdInfoSamplePei.c > index 6f6c14f7..616a96ce 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/= PlatformVTdInfoSamplePei.c > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/= PlatformVTdInfoSamplePei.c > @@ -9,6 +9,7 @@ > #include >=20 > #include > +#include >=20 > #include > #include > @@ -164,6 +165,15 @@ EFI_PEI_PPI_DESCRIPTOR mPlatformVTdNoIgdInfoSampleDe= sc =3D { > &mPlatformVTdNoIgdSample > }; >=20 > +// BIOS uses TE with a null root entry table to block VT-d engine access= to block any DMA traffic in pre-memory phase. > +EDKII_VTD_NULL_ROOT_ENTRY_TABLE_PPI mNullRootEntryTable =3D 0xFED20000; > + > +EFI_PEI_PPI_DESCRIPTOR mPlatformNullRootEntryTableDesc =3D { > + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), > + &gEdkiiVTdNullRootEntryTableGuid, > + &mNullRootEntryTable > +}; > + > /** > Initialize VTd register. > Initialize the VTd hardware unit which has INCLUDE_PCI_ALL set > @@ -344,6 +354,12 @@ PlatformVTdInfoSampleInitialize ( > if (!EFI_ERROR(Status)) { > SiliconInitialized =3D TRUE; > } > + > + Status =3D PeiServicesInstallPpi (&mPlatformNullRootEntryTableDesc); > + if (EFI_ERROR (Status)) { > + ASSERT_EFI_ERROR (Status); > + } > + > DEBUG ((DEBUG_INFO, "SiliconInitialized - %x\n", SiliconInitialized)); > if (!SiliconInitialized) { > Status =3D PeiServicesNotifyPpi (&mSiliconInitializedNotifyList); > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSam= plePei/PlatformVTdInfoSamplePei.inf > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/Plat= formVTdInfoSamplePei.inf > index dacfdf5e..b35853b6 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/= PlatformVTdInfoSamplePei.inf > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/= PlatformVTdInfoSamplePei.inf > @@ -38,7 +38,8 @@ > IoLib >=20 > [Ppis] > - gEdkiiVTdInfoPpiGuid ## PRODUCES > + gEdkiiVTdInfoPpiGuid ## PRODUCES > + gEdkiiVTdNullRootEntryTableGuid ## PRODUCES >=20 > [Depex] > gEfiPeiMasterBootModePpiGuid > -- > 2.16.2.windows.1