From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.33386.1599205662306734012 for ; Fri, 04 Sep 2020 00:47:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Ddmae6Ot; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: rangasai.v.chaganty@intel.com) IronPort-SDR: 3zG2FnWvtMQru2HHtoNXJTd1iiCXyDlTSI1B/YSFC2s8+QtDgeB30iG8lQ5flEru9oQS4fXvCi nP7aoqXr4Zmw== X-IronPort-AV: E=McAfee;i="6000,8403,9733"; a="175760798" X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="175760798" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 00:47:41 -0700 IronPort-SDR: jQ4Wd+akGX0o90rC8ZOdzMHP8LZMDTCDUdalkJKh3Pd5eJvCeohUi0LTFonE8azmSUZF87wNxW QVtJVvxeWsHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,388,1592895600"; d="scan'208";a="376161579" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga001.jf.intel.com with ESMTP; 04 Sep 2020 00:47:41 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 4 Sep 2020 00:47:40 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 4 Sep 2020 00:47:40 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by ORSMSX151.amr.corp.intel.com (10.22.226.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 4 Sep 2020 00:47:40 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 4 Sep 2020 00:47:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QX80zLoFa6S3JwyZDzl03IZVUpb+xdiaD1JtyQ4a/qYx4Kafju62d/V1Z0QwT3WOwVKyoK8r6iVMe7F6vr6/7m1e6yS46BUxHuNBmdPPLpiGdmt8MIdp46pCeu1t3L0IUks6Xw09xpRHq+u6+cFhgVpap6uQwSZfdpl1TFG+t3z6tdy6OjU1kdCS/9SFu7r3vIkKDlL1fb2wlHELRM9I3Y3EnuR5HU+R4hCoit6kvor9+QTajdj3N8fFyl4M2CtCczcEPrEixWFNMaAx0qIRMCuj6oNN7eJINy6D0N+OoI5YHE5w5NZ6r97hons1xyeKcbKrp/8ixdb3Zc69HO5bbw== 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=iiEEx/cP8NiTtcNth96V7CWwt3en8p8uj5Kkp3pIhqw=; b=c++LydjQby2k2YpPMoJtKd1AT/pa6Py+DBCKWIOle2u5ZP2Fihu2S1wqSwC+Q/lyyZaE4QCPKEQm54aeRTR8wrCUBzIF706QGFz2enkv4ouW065YC/qrjn0Qfq7zrWT/ifQ8o+GLRQ9RsyIaT7TOqwKwQ3UhpJIluujFOzUP2x+h8CBhEdRFbdhw49+pXC0oSzfKchyaC/mkjN6ATql1wWZWng0fnGE+/NDtMgsEL3Kady4UwZxTGec4bJn5ArDWJpgQGjF5RkGvDzZOQLyOxY3M0Tan4u+7KCjAbY0ALo3vjsMvZL5bXIIJvUAcRa5yDNpJgCQ3XWDOy79Cf5+zDA== 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=iiEEx/cP8NiTtcNth96V7CWwt3en8p8uj5Kkp3pIhqw=; b=Ddmae6OtdDaa4J8LnBdubz6PfvJwXgXt3C3aAtUNlFSuyiJcs7G1JtntayEtyrhHrUHB2t0lUPDI2a1z8R4J3nK0aWOAFfTxN1bsDuQ6Fupg25skF9nNgiWbjhB6deyQxeMs4Mt8Odin+NC9/6ueKfTn95BNpWXlcbenabR3sIw= Received: from DM6PR11MB4476.namprd11.prod.outlook.com (2603:10b6:5:201::24) by DM6PR11MB3818.namprd11.prod.outlook.com (2603:10b6:5:145::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Fri, 4 Sep 2020 07:47:39 +0000 Received: from DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::4c12:b421:86bf:9d]) by DM6PR11MB4476.namprd11.prod.outlook.com ([fe80::4c12:b421:86bf:9d%4]) with mapi id 15.20.3326.025; Fri, 4 Sep 2020 07:47:39 +0000 From: "Chaganty, Rangasai V" To: "Sheng, W" , "devel@edk2.groups.io" CC: "Ni, Ray" 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: AQHWf2F8AfBNVKbuB0ywR8A3R2jUN6lYIIQw Date: Fri, 4 Sep 2020 07:47:39 +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-reaction: no-action dlp-version: 11.5.1.3 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: [50.45.159.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 895b9d6e-8941-46bc-5c2f-08d850a6cc63 x-ms-traffictypediagnostic: DM6PR11MB3818: 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: 5njaCaEcB5zsk+ZED+ELic6RH6BV/mKKuddQtNPBcIZoORk1O9rCZWXun5awoNk5ee1xbIdaCqQKozFBBquWMIc8a280PJnqeg7+VTB7ppn+tdHwWgsMt4fJNrnZO8x6S5lLEvQT0rD9u4CEl/Fpth5i2hG5oW0gZ0dzDUmHlrmGHhPXGXsKe3DJjIZ3uBMdviaoChTk3vEGZD+FKf5hQcWjy14fy8IJQwv4i7RBg/UEptpvo+i0efw4wD1DGVlA/sRQANVAHVMH6T6aIJZ9ix2f3WH55vLE+ajXR5P5866wvZ3bmx9jTOUAuY87E6v4Yp8aTqQ6riKABSYIXuLBybT17EqpIly66ndbZtluCo/TlR4hQN2AHoSQz03Z4HbXtFscZU6LccMs6j1eTy4Dgw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4476.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(39860400002)(396003)(376002)(366004)(136003)(346002)(5660300002)(26005)(6506007)(110136005)(966005)(8676002)(107886003)(316002)(52536014)(9686003)(83380400001)(55016002)(478600001)(8936002)(71200400001)(186003)(2906002)(64756008)(4326008)(53546011)(66556008)(66476007)(66446008)(7696005)(76116006)(66946007)(33656002)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: wZBvOUlL2y94LVJJHaMvD/YAkttKJs2yccuJY0sgwwqA/hsQpTodsrg7f6ijNR13Vu3ZA3mbW/q6HwnMQXUsSSdFavMVASG/vRuyFa03XrFZeAes64A6rY+b+Bq3txxi606LHpYthUeheJ+pERmIrnHo2XJAwZGoehQPPtzZXHWFF6mOWJTNYInH99gBh/tPKxlYRNIb3uzaYODSp5KKYPXgeIdas9QmaBF4gs6peK1JPEOzfreI7BkAKxIu6ZHXc+9PyMbpRP8hpdRDQ1gkaRHmXAsqpdUFbW7R7EfOVj5wr+q+u3SHNIgqbYQveC4KP1dRR5jxCHd8GOtNiuD3cQU1vjGkuKn2TEQvmPxM3rNqk66qmmgT7Ll4d+9NxFDByl2+OZM+DNB/Ip4aJUvYYasnFyXIM0v89kt2wJgAfHjA+WeVGGc2+QUbysU82wnnpIK74fzoz3fr5zWThUV3jjwchIRlgCIPb5cNDxuAkt85tiNrwEu7GrwdmFIrlk0PjnR0R8dcFAWwKhF6q643Lb6TMiqqvg/hAM3Q5z7cl92fF1gXvvn3mrYx6x53dEP2sOJ9XWR+OwQdguUwd7wseTuL4Tbc1e5kYFOkouHZ1NNtmh6I6vP6YtuDG/ORVoAXKnxI7Z1lQKLk4JL9/yRtMQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4476.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 895b9d6e-8941-46bc-5c2f-08d850a6cc63 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2020 07:47:39.5942 (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: hazYT9mzb7yif3hOxfuYQAY85WzU0nY5ZLoDwpZO64euUYsn/iSiNVWHi6/rTNXzOXfKIBWQ13CIsnfumuh3g9qnyQ869s6wuieK+q5gXOQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3818 Return-Path: rangasai.v.chaganty@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Sai Chaganty -----Original Message----- From: Sheng, W =20 Sent: Sunday, August 30, 2020 11:38 PM To: devel@edk2.groups.io Cc: Ni, Ray ; Chaganty, Rangasai V Subject: [PATCH v3 3/3] IntelSiliconPkg/PlatformVTdInfoSamplePei: Install N= ull Root Entry Table BIOS uses TE with a null root entry table to block VT-d engine access to bl= ock any DMA traffic in pre-memory phase. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2867 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(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSampl= ePei/PlatformVTdInfoSamplePei.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd= /PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c index 6f6c14f7..616a96ce 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/Pl= atformVTdInfoSamplePei.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 mPlatformVTdNoIgdInfoSampleDesc= =3D { &mPlatformVTdNoIgdSample }; =20 +// BIOS uses TE with a null root entry table to block VT-d engine access t= o 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/PlatformVTdInfoSamplePei= /PlatformVTdInfoSamplePei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/P= latformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf index dacfdf5e..b35853b6 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/Pl= atformVTdInfoSamplePei.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