From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.7122.1654752014594315304 for ; Wed, 08 Jun 2022 22:20:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DGUl/iL7; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: jenny.huang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654752014; x=1686288014; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8oZQp7S79Kcde9++qF3etf5F5HSonTMPFoj2EHOh+nY=; b=DGUl/iL70AUqQKsUvO9e6Z1lyb6iZ/BTmN+LrE5neTsYQXnTkdB0CxO1 4ZC2CfMRny43SHdqN6CX2CT2BWrTH5BOdDbRsHQPUPziSPGycMg46pesa jYryVYJHmQOhDyi88sttKEZQfU1iZ2E2M6pdJww8gnr9FM3aac3aCNXr4 D1TwPVuhIbdUS6W8eO7hnPxSVRrkA/52j/Oxwr8pPTaRWlffSnUiEaI/g Y2jYAVrfALIPjYI7zg2X7UdjKnT5o2ZUO+l9ubpr0HZeO0GOPjSsuNlmF k68YjingMbv4OsFN/iyX25drFhuJV07DBRgGhcJRoOJKOzUQsCYk7O8GK w==; X-IronPort-AV: E=McAfee;i="6400,9594,10372"; a="257581187" X-IronPort-AV: E=Sophos;i="5.91,287,1647327600"; d="scan'208";a="257581187" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2022 22:20:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,287,1647327600"; d="scan'208";a="670970900" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 08 Jun 2022 22:20:13 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 8 Jun 2022 22:20:13 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 8 Jun 2022 22:20:13 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 8 Jun 2022 22:20:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/a6kM5JVp/YUXy9C5DwTgSnCRb9VmrDlFyYTzpZe9VdSJzeKMj8VOGD1lXq8aQhkFR+30KTCSWPgmFwYeb29BVFBX4EZKhUBbD/flNgXspk/W2ko4VOpNn0cF8QFPplqEGVpdmXX6XVNhc4RlBob7wcP/lwLRyqZS0cNUp5kopkwp2zbbaFmT2Vrsmp23USyAP8SQJj8pG0JtmbHRqg9W9lq/D3CqYF/Vt5s1/tT3A7VJnM791Mubfv2/YoD1IeXXg9OrodJa0pP84SE02zowJ4LJ8WO0zYMKcAb8ExHm6CYleesFp8QQGxGgBo13q+znhN22+lxwbFOPtaeS1Y7g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=seD4dzFqHkDUwW8PJRbMwc56+crbhWWs2Tao0PIh4Ek=; b=Ln7EtrDhDFaj4hciq1ux/57q6NONnM9/XkGnndGzS+7ml1Xrhpc0klXL8Zo11rgVUpecLm6cQ++MmyW7nsZleKTi48mC2tY/wuQF8dT31A/LQs9oDb2nwc8T+3cjn5AyHUp3IVV4zm+KBstnZaLRs1Y3mSfvE78SXjBi4SLXb7XJ7vZsGB+8syKJOJsUn+hfVAm8qooPtb8psSkFlSQmI2yNeiRm1QYCnZA0lt7kVbQnhpejoTLDi9qTBQcv6sY15jkJ2S/p9K6amC12EBn6Sg928ulPbyTKstAv9En//3DXDtf8fqKcMH/slIRmr3PwxOa+3VhoHj6+aQaC4IkBZw== 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 Received: from DM6PR11MB4627.namprd11.prod.outlook.com (2603:10b6:5:2a2::19) by DM6PR11MB4412.namprd11.prod.outlook.com (2603:10b6:5:14e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Thu, 9 Jun 2022 05:20:11 +0000 Received: from DM6PR11MB4627.namprd11.prod.outlook.com ([fe80::8d19:283e:1b3e:afdc]) by DM6PR11MB4627.namprd11.prod.outlook.com ([fe80::8d19:283e:1b3e:afdc%7]) with mapi id 15.20.5314.019; Thu, 9 Jun 2022 05:20:11 +0000 From: "Huang, Jenny" To: "Sheng, W" , "devel@edk2.groups.io" CC: "Kowalewski, Robert" , "Ni, Ray" , "Chaganty, Rangasai V" Subject: Re: [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support Thread-Topic: [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Support Thread-Index: AQHYe79TX9ezaHzedECCP2tp7qRTU61GiUeQ Date: Thu, 9 Jun 2022 05:20:11 +0000 Message-ID: References: <20220609051053.2063-1-w.sheng@intel.com> In-Reply-To: <20220609051053.2063-1-w.sheng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 32a1439d-1872-4f8a-4f3a-08da49d7ba15 x-ms-traffictypediagnostic: DM6PR11MB4412:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hmAjB52WXSgX+69D+gYmCeM12ekaZG+/yGUWHFMUul8N19wQidn1ymRIzzxfxkoJJIJitVdU0pvk7nNM4nmCs63m90JBTDNbsuh9zWVSw4L/xbM5xcTIIh8B09owdP4IXNj/H6jnzY+icwP0f+mIlqKrF6RJQaFmM5QYDLGke1QkAcVINawDhFVRqGfvKscPGIcTMeRtQyhJ4AF/qzENAzrGZrYD7aFJL7/4Efpi7gJvPrSzYoK8Wz/TNAcHAktL/+FFBWAvJRlHN/Mc3QRP7t9MjtUGZvEnQWPaMRq4hfJiBjDHRJhBWzlsnTBG7dJKJUYVBM44d+i0Op2mC3nUQuz5SlPFL2rigaWoCdjTYmj5+sLe7qQWlKCv68JAK6yUnRAswiRC5tFbanuUptu6ozCbq4QqRS9nrm2HPFq8EY15pCOwOYlz8te6F4kw+jstg0FYRIPdyTIb7Pwff6/jR5XPGahTBf/aKuv7pmvXYEkNJ3dHKaXmP6mDKUL133sxS0obL4axNn6ZmYwztk/u447r6Uq4529tMMCYN1qb3sANe9orP3WQRYz8Gz1vj5fBTTt3T2+fYie/XFhlcat2M2eyqwWiAZ83hTFBuhv6f4hRsQIAqWQMYGWRmI9VB5jOMdvHUlbngfxcuJNmSa99Ci2gz2xGt3qDdF8gQhQWauPDQSzFp0FJyP7zg7zJeqvs5hd2g0Z1QhHOp60Heb7MexWAqH2rwy5H+R0JVeTa2tjqeWgLD7zcsuC6GtsUs0x5 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4627.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(82960400001)(186003)(55016003)(107886003)(38070700005)(76116006)(8936002)(26005)(6506007)(9686003)(508600001)(53546011)(7696005)(83380400001)(33656002)(54906003)(5660300002)(122000001)(38100700002)(66946007)(52536014)(71200400001)(316002)(8676002)(4326008)(66556008)(66476007)(66446008)(64756008)(2906002)(86362001)(110136005)(14943795004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dieEL5OO0w08au5/NcZPNOmP8sDEzHh4S7TV8zwYmdc5FoSfQoZZD+tcS1kR?= =?us-ascii?Q?OAJgMknunfFRj40UnytLRcEMolAA+1amDN/OPEMq5SpNdQxK3SIxeeT3rrjK?= =?us-ascii?Q?AN5Z83GKJ1WcFFIJgRFsmNoJhWwFMLl/qIhGzFnJIMAnzllfI3BEOCzWPX1M?= =?us-ascii?Q?cuejEMdYIrhYXB+LhMNlDXr3JWyK3dmMo74XMZeZA3zGBqv53mKng0w/vJzk?= =?us-ascii?Q?KJmGddPOuYkQFRXYZyjgYx9qIOBQgtrvUPgT/hPEnBpP3PfCt67nT+KV+Rog?= =?us-ascii?Q?O3pSgJ+PxeRBGnqd030XFQUizl9u55icZvdU3D5n4SdeQjyqsWUSzNr3HBVk?= =?us-ascii?Q?tODhbTnYEG7SjuHWs9YqrPYyoiMbn3iwj4eChAa3szAigzEKHKqynFM4Witr?= =?us-ascii?Q?9S3byh+pPD4O1PlvZiKtwSHBMxoi++8815jqoYtRJDZczp6immmpCMQBKmYA?= =?us-ascii?Q?bByB7hjkSyR7IfpdPLXNQLsLgi5XUpQnYfw0tBaBi1jWELbq66k20e2YsLTN?= =?us-ascii?Q?M07aT+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bQzjT0CN?= =?us-ascii?Q?hM6NZlfODo0zGZTro1qeJJ1EvMz/xzzBx4irVwGvNVQaZLZy6srt0s8wRVCa?= =?us-ascii?Q?EGpyNtiJERsuwETh2enwKSUl75I8r2pXPy9TeWu0tpetdmLWX6N3iaHrCyLy?= =?us-ascii?Q?i2vF5mRjfAMTJU62foL0nR+XfJegzZh8X0LtuS9v6nRoPrn/AvNAPHWmV9Dq?= =?us-ascii?Q?oElbGsImRVY93wAADm0E0eU26ukmRV3/C52JhfBV/gYzoxdOa6bFoZVXotvu?= =?us-ascii?Q?kvH2a1/lh826IuRDMY/ZkephsUY6DNGDPpeUxNoALPzUre/uh4KGNQranCCt?= =?us-ascii?Q?Ika9etMOug=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4627.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32a1439d-1872-4f8a-4f3a-08da49d7ba15 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2022 05:20:11.4789 (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: +BP+66fJPtOSyjqH6yyj3+VQ8jgmkkjBGQMusxvp2m2BSReFdD0J/ljFkv3IfIW8XHKRrRvRcmHFu/jt9nsrfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4412 Return-Path: jenny.huang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jenny Huang -----Original Message----- From: Sheng, W =20 Sent: Wednesday, June 8, 2022 10:11 PM To: devel@edk2.groups.io Cc: Kowalewski, Robert ; Ni, Ray ; Chaganty, Rangasai V ; Huang, Jenny <= jenny.huang@intel.com> Subject: [PATCH v3] IntelSiliconPkg/VTd: Add PCD for VTd Abort DMA Mode Sup= port PcdVTdSupportAbortDmaMode is used to enable/disable using VTd Abort DMA Mod= e. Signed-off-by: Sheng Wei Reviewed-by: Robert Kowalewski Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Jenny Huang Change-Id: If999d2f4906bda887dffe8574ec17cb90346b710 --- .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmar.c | 9 ++++++--- .../Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf | 3 ++- Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmar.c b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmar.c index b4c44d87..0d372f6c 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= r.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= r.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -570,10 +570,12 @@ EnableVTdTranslationProtectionBlockDma ( =20 DEBUG ((DEBUG_INFO, "EnableVTdTranslationProtectionBlockDma - 0x%08x\n",= VtdUnitBaseAddress)); =20 + DEBUG ((DEBUG_INFO, "PcdVTdSupportAbortDmaMode : %d\n", FixedPcdGetBool = (PcdVTdSupportAbortDmaMode))); + ECapReg.Uint64 =3D MmioRead64 (VtdUnitBaseAddress + R_ECAP_REG); - DEBUG ((DEBUG_INFO, "ECapReg : 0%016lx\n", ECapReg.Uint64)); + DEBUG ((DEBUG_INFO, "ECapReg.ADMS : %d\n", ECapReg.Bits.ADMS)); =20 - if (ECapReg.Bits.ADMS =3D=3D 1) { + if ((ECapReg.Bits.ADMS =3D=3D 1) && FixedPcdGetBool (PcdVTdSupportAbortD= maMode)) { // // Use Abort DMA Mode // @@ -594,6 +596,7 @@ EnableVTdTranslationProtectionBlockDma ( ASSERT (FALSE); return EFI_DEVICE_ERROR; } + DEBUG ((DEBUG_INFO, "Block All DMA by TE.\n")); Status =3D EnableDmarPreMem (VtdUnitBaseAddress, (UINT64) (*RootEntryT= able)); } =20 diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/Inte= lVTdDmarPei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei= /IntelVTdDmarPei.inf index b97ff900..473665e9 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= rPei.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDma= rPei.inf @@ -4,7 +4,7 @@ # This driver initializes VTd engine based upon EDKII_VTD_INFO_PPI # and provide DMA protection in PEI. # -# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2022, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -55,6 +55,7 @@ gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask ## CONSUMES gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSize ## CONSUMES gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3 ## CONSUMES + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode ## CONSUMES =20 [Depex] gEfiPeiMasterBootModePpiGuid AND diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index e5b785ae..c36d130a 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -135,6 +135,12 @@ gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize|0x000A0000|UINT32= |0x0000000A gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset|0x00660000|UINT= 32|0x0000000B =20 + ## Indicates if VTd Abort DMA Mode is supported.

+ # TRUE - Support VTd abort DMA mode. + # FALSE - Not support VTd abort DMA mode. + # @Prompt VTd abort DMA mode support. + gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode|FALSE|BOOLEAN|0= x0000000C + [PcdsFixedAtBuild, PcdsPatchableInModule] ## Error code for VTd error.

# EDKII_ERROR_CODE_VTD_ERROR =3D (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPE= CIFIC | 0x00000000)) =3D 0x02008000
--=20 2.26.2.windows.1