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.9371.1607052788592724634 for ; Thu, 03 Dec 2020 19:33:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=hstGEnFZ; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: jenny.huang@intel.com) IronPort-SDR: W+Iet85FeQ50Exi1AIDW9xzazex0Nbix3JAH4z83deXHEwB2q8CFA09jK+vtqNCkXSnv/Y1hpJ /wbF6MF0t2Vw== X-IronPort-AV: E=McAfee;i="6000,8403,9824"; a="153146074" X-IronPort-AV: E=Sophos;i="5.78,391,1599548400"; d="scan'208";a="153146074" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2020 19:33:05 -0800 IronPort-SDR: 9p4lkmyXglu3FcRvpU6rah22tUJJXUXmQoqonMfpys/Jl8N606YW9mJOmUrgCtvA6o33ZIAdsW yITbY7PvZRIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,391,1599548400"; d="scan'208";a="362036301" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 03 Dec 2020 19:33:04 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.1713.5; Thu, 3 Dec 2020 19:33:04 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 3 Dec 2020 19:33:04 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 3 Dec 2020 19:33:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C27LsETShlwd9KM8VRavXB2MmV7qU58f3pc6jvsM9/asBBcZ3BBil+0qWogpcuopJ91SF9VPzg0VG30SXezTk9g5IACcJ3MkMwu0QvyRH0T1YPHDhNsqkIzxSz17xTZBP5CQHv7q7dmGTfSRuO4dZnctOC6scBLUa9fPR0RTkJUQD8Riy2FDPZNiwFaQ7lf8WpBxLkUs+hoXke1To/El3TqaAUu4QWsKIW2kEn/Nyr51CKFFiybHDkKObBdGvPbcvIyXOHSXywmFXRSLqJoNUcOC+/oknr2HVh4GtqdEgJ0DwIQLGx06Ha9YuChOQdIy6iloUQXU2pix07zM615QNA== 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=GqbrgwvQ3hspviStE1amAgR/Y7by8VXMk/qs4p0gV+Q=; b=bODFZS9q1KJb5y2p8E179NuvHORYMyYkkmzi7YU23FNJtN6EEpy72s80MtumhYUG6R5OlG1RC+EpOXjRaZ6FFiws9eLFMLN0J46MD7NJmXMdOIPXUVYL8hX+k3WjUFt96xLYnf4yZWxaTKIEVdkd7/7EFQYt4qudHx+CagJGY1XMsqRbfQJVWz8BsJ0/yUogtouslA4JQm15qSmlKegs9IvxI67T0lQzyF8rh9/CftGncFAxDdE6RkaafxibCeJkEt6uyWkkLr1yVhCti9SttAgbqT3ESJqGfjDK2R9l9ydHLg4QCvOE1FTNsLVNW/kSgKWp/jVuN6U4u46VGteQ8g== 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=GqbrgwvQ3hspviStE1amAgR/Y7by8VXMk/qs4p0gV+Q=; b=hstGEnFZF3Bi59bluZX4oHhtjTE5cH2KLYUxwZ6wYr7I2fIH8T/4AY4BkCx/gfyonJjeeUr7nGtMkUW6QqVGLlGtJnyc3NxcfUQbZZiRslmJz87VI9yaCWneti7fIMn1K5mjte4rpO1pzLwMUavckAmazj8xuiS6L6rEzg+8L0s= Received: from DM6PR11MB4627.namprd11.prod.outlook.com (2603:10b6:5:2a2::19) by DM6PR11MB4204.namprd11.prod.outlook.com (2603:10b6:5:206::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Fri, 4 Dec 2020 03:32:58 +0000 Received: from DM6PR11MB4627.namprd11.prod.outlook.com ([fe80::a6:4d9a:ae33:79dc]) by DM6PR11MB4627.namprd11.prod.outlook.com ([fe80::a6:4d9a:ae33:79dc%6]) with mapi id 15.20.3632.021; Fri, 4 Dec 2020 03:32:58 +0000 From: "Huang, Jenny" To: "Sheng, W" , "Yao, Jiewen" , "devel@edk2.groups.io" CC: "Ni, Ray" , "Chaganty, Rangasai V" , "Feng, Roger" Subject: Re: [PATCH v5] IntelSiliconPkg/VTd: Add iommu 5 level paging support Thread-Topic: [PATCH v5] IntelSiliconPkg/VTd: Add iommu 5 level paging support Thread-Index: AdbIV1Dp48imUm//Twe8QHBSqTQuoABlJhSA Date: Fri, 4 Dec 2020 03:32:57 +0000 Message-ID: References: In-Reply-To: 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: [71.236.203.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 773e4c7f-a69f-416e-e480-08d898054b81 x-ms-traffictypediagnostic: DM6PR11MB4204: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PiddMa8WG/t0VPEtPGl69VzD/BF2bsdQ9HUyN8KqOts6umUt/u5OnLRdZ6dUxw6xNmBMbRNXbmTBk1B4uvbtzUnRl57RpWS8mrRurLPwchUz8Af7CHlvkcaxwSIlveNO3ZkmKQ4wxp1cyFtFkqKf+/xXEsTIYoIaoBHm0HzAkwsItiqGtjYv9KZlzggDh1nG+NUtK0O7tig7n9tkIm3qkcCMY74cP+MuyB78dX1pm0beSGOGIaIm8VBKKO+GDuBL1d6L184oytGwkNN5aQFgkUB8prLlOWBw9aPxEOWNHALKb0xsohevIBuOId/Oe1UDG8f70txL34V1Wb0Sr6vsvNShTCsZsapMNnaX0p63yLXFYNp4UHFRSB+4xDucpx8JQ3n6N6mb68aQ1zl+YYHsXA== 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:(4636009)(136003)(396003)(39860400002)(376002)(366004)(346002)(86362001)(71200400001)(8936002)(316002)(2906002)(107886003)(6506007)(55016002)(53546011)(4326008)(7696005)(9686003)(110136005)(76116006)(54906003)(66446008)(66476007)(52536014)(66946007)(83380400001)(66556008)(64756008)(33656002)(26005)(5660300002)(8676002)(186003)(966005)(478600001)(30864003)(579004)(559001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-2022-jp?B?Qm4zejVVb0k5QUk1eXdqdmo4NTNWSjdXSU5lOVB2cnQxdWFxZXVvY1dR?= =?iso-2022-jp?B?ckVLYVRkSG12SmxnME5yWGFGaGRvM21MZ1JJUkgwUU1HdTViTFdpK3Bu?= =?iso-2022-jp?B?c1Z6TVpmaDAvQVhXZGJKbkpkRXdkR0RwWkUrUzhYY3VZcERxeU1rc0xX?= =?iso-2022-jp?B?SDJERTd3UVZ5TFlWZFNMeHVEZ1VVWitQQ2tjZ1Z6REtrRGE4VnhIRmZV?= =?iso-2022-jp?B?RVdpdGFnUEpHSjZ5UWNsUTZaRERwS2dVTGRTWm1PS1NUWmZZbHBrck40?= =?iso-2022-jp?B?a1B6bEEwbE9qc3pEa1R4N2p4UERjWUV1MDRuSmlVOWtzaE43Ylk4dllh?= =?iso-2022-jp?B?S01pWGNXbnVJMDI0V2JTNkM1Unl6MzZmMDlvSllZalRWellad0VnQ3Rz?= =?iso-2022-jp?B?WUhvOHBVNWVuejJUalBKaGVTQ2ZlaDM5V3RhYVliMnU1SGxIYTBFczNJ?= =?iso-2022-jp?B?a0U5SXlxNTVoYTdoN29Za1ZtSThKc0NRdjdNQlE4N2d5Snlzd1p0QzJI?= =?iso-2022-jp?B?UWFzZ09OQ1pOTHRsNWdDUDQyb0M3QVhHci9KbGVOam5vWGpuaFNzamFC?= =?iso-2022-jp?B?bmlndjlJNHp1ZGsvMDdNWGU5Rk5JdEdOaWM4TFg0Q1ExSlBGc01qUlJI?= =?iso-2022-jp?B?QUJKU1VUZDZjM1BBb1ZPS2pnUGdjQlhET1kxemdIdGlqaVZlZW5ENk9Q?= =?iso-2022-jp?B?aDcxTG5VOUxWMXdvN0t0VzNhMDlPL3ZoSE9rWUdYYXplSlZraThGMFRF?= =?iso-2022-jp?B?ME1XUTZrUEsvODhlQmhLdjZmL2lhSTJDQkdQTjIrYjJFeiszQWdZQkpI?= =?iso-2022-jp?B?Qjdlelpwa3NkQVFYRlJpbCtPc0R6ZTcvOWorWXZLYlUxVDRpSEJtdE92?= =?iso-2022-jp?B?KzIzYkt3UVROcmdDMmxCUlhBejFuZUJLQTJ3aFBJbm5yQ00wMzJFcTlO?= =?iso-2022-jp?B?a3ZTMWhkcTRhekdKNkxCcSs1eEkzVTR5WDE0NDVuejdpYnp1Q0VZZDhF?= =?iso-2022-jp?B?bFF6ZFNaWGdhOTZ1U0FhalJadHNQbkE4emdUVVJrdDRTUytmNXE5NkVK?= =?iso-2022-jp?B?KzlPOEk2QTR2a0k4UlNUeXBhYmJkekd1anhFNjZ3TElxY25iNXk2dm5S?= =?iso-2022-jp?B?MjFOTVFoWk50ZUR4a0ZoT2tSOVB1bXdZRGt0U0g0WkY5clNHdHlMYllN?= =?iso-2022-jp?B?Zm1rZnVGWmtvTjM5V1orTFIxb2YybTR1dVpxY2RzeG1DMW9zRDl5cnZV?= =?iso-2022-jp?B?aHRTajlrenVlV1FHano2YzkxQzAwN0pldU5QYTkvbkNydHRyREx1czBE?= =?iso-2022-jp?B?Sy9FTzMzYWszS2ZjUUdOTmdSZEFXeUllZnhDdm1MSCt6QWlOSDhTMEFE?= =?iso-2022-jp?B?bTBybWw3U2ZtTEdJa2VkdCsvM3V6cFdaUkNiYWFXZXdXamxYcz0=?= 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: 773e4c7f-a69f-416e-e480-08d898054b81 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2020 03:32:58.0145 (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: /WRWN1tiJToIWREKNFwDd247Kb8FSOyrl2hJJBfDltzg7UkN6dyHUeNwHQvFYOEZAvh5B4m1OgxV0yRag4Zg3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4204 Return-Path: jenny.huang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jenny Huang < jenny.huang@intel.com>=20 -----Original Message----- From: Sheng, W =20 Sent: Tuesday, December 1, 2020 7:03 PM To: Yao, Jiewen ; devel@edk2.groups.io Cc: Ni, Ray ; Chaganty, Rangasai V ; Huang, Jenny ; Feng, Roger Subject: [PATCH v5] IntelSiliconPkg/VTd: Add iommu 5 level paging support Hi Jiewen, About the patch of support 5 level paging iommu. Thank you for giving the review comments. I have done all the update.=20 Could you give "review by" on this patch ? Thank you. BR Sheng Wei > -----Original Message----- > From: Sheng, W > Sent: 2020=1B$BG/=1B(B11=1B$B7n=1B(B24=1B$BF|=1B(B 13:44 > To: Yao, Jiewen ; devel@edk2.groups.io > Cc: Ni, Ray ; Chaganty, Rangasai V=20 > ; Huang, Jenny > Subject: RE: [PATCH v4] IntelSiliconPkg/VTd: Add iommu 5 level paging=20 > support >=20 > Hi Jiewen, All, > Thank you for the review. I just check and update the patch. > https://edk2.groups.io/g/devel/message/67865?p=3D,,,20,0,0,0::relevance, > ,posteri > d%3A2558558,20,2,0,78471874 > Could we continue the patch review ? > BR > Sheng Wei >=20 > > -----Original Message----- > > From: Yao, Jiewen > > Sent: 2020=1B$BG/=1B(B11=1B$B7n=1B(B23=1B$BF|=1B(B 16:44 > > To: Sheng, W ; devel@edk2.groups.io > > Cc: Ni, Ray ; Chaganty, Rangasai V=20 > > ; Huang, Jenny=20 > > > > Subject: RE: [PATCH v4] IntelSiliconPkg/VTd: Add iommu 5 level=20 > > paging support > > > > Thanks. > > > > I only reviewed the policy part. Comment below: > > > > 1) I recommend you can merge below 2 if into one - if > > ((mAcpiDmarTable- > > >HostAddressWidth <=3D 48) && > > (mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) !=3D 0)) {=20 > > You can use 2 lines, but there is no need to use 2 if. > > > > + if (mAcpiDmarTable->HostAddressWidth <=3D 48) { > > + if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) != =3D 0) { > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; > > + } > > + } > > > > 2) I think below code has typo. > > The DEBUG message about 4-level and 5-level should be reversed. > > Also we should use DEBUG_INFO instead of DEBUG_ERROR. > > > > + if (mVtdUnitInformation[VtdIndex].Is5LevelPaging) { > > + ContextEntry->Bits.AddressWidth =3D 0x3; > > + DEBUG((DEBUG_ERROR, "Using 4-level page-table on VTD %d\n", > > VtdIndex)); > > + } else { > > + ContextEntry->Bits.AddressWidth =3D 0x2; > > + DEBUG((DEBUG_ERROR, "Using 5-level page-table on VTD %d\n", > > VtdIndex)); > > + } > > > > > > > > > > > -----Original Message----- > > > From: Sheng, W > > > Sent: Monday, November 23, 2020 4:04 PM > > > To: devel@edk2.groups.io > > > Cc: Ni, Ray ; Chaganty, Rangasai V=20 > > > ; Yao, Jiewen=20 > > > ; Huang, Jenny > > > Subject: [PATCH v4] IntelSiliconPkg/VTd: Add iommu 5 level paging=20 > > > support > > > > > > Support iommu 5 level paging for translation table. > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3067 > > > > > > Signed-off-by: Sheng Wei > > > Cc: Ray Ni > > > Cc: Rangasai V Chaganty > > > Cc: Jiewen Yao > > > Cc: Jenny Huang > > > --- > > > .../Feature/VTd/IntelVTdDxe/DmaProtection.c | 4 +- > > > .../Feature/VTd/IntelVTdDxe/DmaProtection.h | 19 +- > > > .../Feature/VTd/IntelVTdDxe/TranslationTable.c | 281 > +++++++++++++++-- > > > ---- > > > .../Feature/VTd/IntelVTdDxe/TranslationTableEx.c | 31 ++- > > > .../Feature/VTd/IntelVTdDxe/VtdReg.c | 10 +- > > > 5 files changed, 245 insertions(+), 100 deletions(-) > > > > > > diff --git > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > c > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > c > > > index 9b6135ef..628565ee 100644 > > > --- > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > c > > > +++ > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > c > > > @@ -523,10 +523,10 @@ SetupVtd ( > > > for (Index =3D 0; Index < mVtdUnitNumber; Index++) { > > > DEBUG ((DEBUG_INFO,"VTD Unit %d (Segment: %04x)\n", Index,=20 > > > mVtdUnitInformation[Index].Segment)); > > > if (mVtdUnitInformation[Index].ExtRootEntryTable !=3D NULL) { > > > - DumpDmarExtContextEntryTable > > > (mVtdUnitInformation[Index].ExtRootEntryTable); > > > + DumpDmarExtContextEntryTable > > > (mVtdUnitInformation[Index].ExtRootEntryTable, > > > mVtdUnitInformation[Index].Is5LevelPaging); > > > } > > > if (mVtdUnitInformation[Index].RootEntryTable !=3D NULL) { > > > - DumpDmarContextEntryTable > > > (mVtdUnitInformation[Index].RootEntryTable); > > > + DumpDmarContextEntryTable > > > (mVtdUnitInformation[Index].RootEntryTable, > > > mVtdUnitInformation[Index].Is5LevelPaging); > > > } > > > } > > > > > > diff --git > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > h > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > h > > > index a3331db8..f641cea0 100644 > > > --- > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > h > > > +++ > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection= . > > > h > > > @@ -77,6 +77,7 @@ typedef struct { > > > BOOLEAN HasDirtyContext; > > > BOOLEAN HasDirtyPages; > > > PCI_DEVICE_INFORMATION PciDeviceInfo; > > > + BOOLEAN Is5LevelPaging; > > > } VTD_UNIT_INFORMATION; > > > > > > // > > > @@ -375,31 +376,37 @@ ParseDmarAcpiTableRmrr ( > > > /** > > > Dump DMAR context entry table. > > > > > > - @param[in] RootEntry DMAR root entry. > > > + @param[in] RootEntry DMAR root entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpDmarContextEntryTable ( > > > - IN VTD_ROOT_ENTRY *RootEntry > > > + IN VTD_ROOT_ENTRY *RootEntry, > > > + IN BOOLEAN Is5LevelPaging > > > ); > > > > > > /** > > > Dump DMAR extended context entry table. > > > > > > - @param[in] ExtRootEntry DMAR extended root entry. > > > + @param[in] ExtRootEntry DMAR extended root entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpDmarExtContextEntryTable ( > > > - IN VTD_EXT_ROOT_ENTRY *ExtRootEntry > > > + IN VTD_EXT_ROOT_ENTRY *ExtRootEntry, IN BOOLEAN Is5LevelPaging > > > ); > > > > > > /** > > > Dump DMAR second level paging entry. > > > > > > - @param[in] SecondLevelPagingEntry The second level paging entry. > > > + @param[in] SecondLevelPagingEntry The second level paging entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpSecondLevelPagingEntry ( > > > - IN VOID *SecondLevelPagingEntry > > > + IN VOID *SecondLevelPagingEntry, IN BOOLEAN Is5LevelPaging > > > ); > > > > > > /** > > > diff --git > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translatio > > > nT > > > ab > > > le.c > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translatio > > > nT > > > ab > > > le.c > > > index 201d663d..6c786b40 100644 > > > --- > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translatio > > > nT > > > ab > > > le.c > > > +++ > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/Translatio > > > nT ab le.c @@ -128,11 +128,26 @@ CreateContextEntry ( > > > > > > DEBUG ((DEBUG_INFO,"Source: S%04x B%02x D%02x F%02x\n",=20 > > > mVtdUnitInformation[VtdIndex].Segment, SourceId.Bits.Bus,=20 > > > SourceId.Bits.Device, SourceId.Bits.Function)); > > > > > > - if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) =3D= =3D 0) { > > > - DEBUG((DEBUG_ERROR, "!!!! 4-level page-table is not supported = on > > > VTD %d !!!!\n", VtdIndex)); > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; > > > + if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT3) != =3D 0) { > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D TRUE; > > > + if (mAcpiDmarTable->HostAddressWidth <=3D 48) { > > > + if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW &=20 > > > + BIT2) !=3D 0) > { > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; > > > + } > > > + } > > > + } else if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & > > > + BIT2) =3D=3D > > > 0) { > > > + DEBUG((DEBUG_ERROR, "!!!! Page-table type is not supported=20 > > > + on > > > VTD %d !!!!\n", VtdIndex)); > > > return EFI_UNSUPPORTED; > > > } > > > - ContextEntry->Bits.AddressWidth =3D 0x2; > > > + > > > + if (mVtdUnitInformation[VtdIndex].Is5LevelPaging) { > > > + ContextEntry->Bits.AddressWidth =3D 0x3; > > > + DEBUG((DEBUG_ERROR, "Using 4-level page-table on VTD %d\n", > > > VtdIndex)); > > > + } else { > > > + ContextEntry->Bits.AddressWidth =3D 0x2; > > > + DEBUG((DEBUG_ERROR, "Using 5-level page-table on VTD %d\n", > > > VtdIndex)); > > > + } > > > } > > > > > > FlushPageTableMemory (VtdIndex,=20 > > > (UINTN)mVtdUnitInformation[VtdIndex].RootEntryTable, > > > EFI_PAGES_TO_SIZE(EntryTablePages)); > > > @@ -148,6 +163,7 @@ CreateContextEntry ( > > > @param[in] MemoryBase The base of the memory. > > > @param[in] MemoryLimit The limit of the memory. > > > @param[in] IoMmuAccess The IOMMU access. > > > + @param[in] Is5LevelPaging If it is the 5 level pagin= g. > > > > > > @return The second level paging entry. > > > **/ > > > @@ -157,16 +173,23 @@ CreateSecondLevelPagingEntryTable ( > > > IN VTD_SECOND_LEVEL_PAGING_ENTRY *SecondLevelPagingEntry, > > > IN UINT64 MemoryBase, > > > IN UINT64 MemoryLimit, > > > - IN UINT64 IoMmuAccess > > > + IN UINT64 IoMmuAccess, > > > + IN BOOLEAN Is5LevelPaging > > > ) > > > { > > > + UINTN Index5; > > > UINTN Index4; > > > UINTN Index3; > > > UINTN Index2; > > > + UINTN Lvl5Start; > > > + UINTN Lvl5End; > > > + UINTN Lvl4PagesStart; > > > + UINTN Lvl4PagesEnd; > > > UINTN Lvl4Start; > > > UINTN Lvl4End; > > > UINTN Lvl3Start; > > > UINTN Lvl3End; > > > + VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl5PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl4PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl3PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl2PtEntry; @@ -184,7 +207,7 > > @@ > > > CreateSecondLevelPagingEntryTable ( > > > if (SecondLevelPagingEntry =3D=3D NULL) { > > > SecondLevelPagingEntry =3D AllocateZeroPages (1); > > > if (SecondLevelPagingEntry =3D=3D NULL) { > > > - DEBUG ((DEBUG_ERROR,"Could not Alloc LVL4 PT. \n")); > > > + DEBUG ((DEBUG_ERROR,"Could not Alloc LVL4 or LVL5 PT.=20 > > > + \n")); > > > return NULL; > > > } > > > FlushPageTableMemory (VtdIndex,=20 > > > (UINTN)SecondLevelPagingEntry, EFI_PAGES_TO_SIZE(1)); @@ -197,66=20 > > > +220,109 @@ CreateSecondLevelPagingEntryTable ( > > > return SecondLevelPagingEntry; > > > } > > > > > > - Lvl4Start =3D RShiftU64 (BaseAddress, 39) & 0x1FF; > > > - Lvl4End =3D RShiftU64 (EndAddress - 1, 39) & 0x1FF; > > > + if (Is5LevelPaging) { > > > + Lvl5Start =3D RShiftU64 (BaseAddress, 48) & 0x1FF; > > > + Lvl5End =3D RShiftU64 (EndAddress - 1, 48) & 0x1FF; > > > + DEBUG ((DEBUG_INFO," Lvl5Start - 0x%x, Lvl5End - 0x%x\n",=20 > > > + Lvl5Start, > > > Lvl5End)); > > > > > > - DEBUG ((DEBUG_INFO," Lvl4Start - 0x%x, Lvl4End - 0x%x\n",=20 > > > Lvl4Start, Lvl4End)); > > > + Lvl4Start =3D RShiftU64 (BaseAddress, 39) & 0x1FF; > > > + Lvl4End =3D RShiftU64 (EndAddress - 1, 39) & 0x1FF; > > > > > > - Lvl4PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY=20 > > > *)SecondLevelPagingEntry; > > > - for (Index4 =3D Lvl4Start; Index4 <=3D Lvl4End; Index4++) { > > > - if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > - Lvl4PtEntry[Index4].Uint64 =3D (UINT64)(UINTN)AllocateZeroPage= s (1); > > > - if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > - DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL4 PAGE FAIL > > > (0x%x)!!!!!!\n", Index4)); > > > - ASSERT(FALSE); > > > - return NULL; > > > - } > > > - FlushPageTableMemory (VtdIndex, (UINTN)Lvl4PtEntry[Index4].Uin= t64, > > > SIZE_4KB); > > > - SetSecondLevelPagingEntryAttribute (&Lvl4PtEntry[Index4], > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > - } > > > + Lvl4PagesStart =3D (Lvl5Start<<9) | Lvl4Start; > > > + Lvl4PagesEnd =3D (Lvl5End<<9) | Lvl4End; > > > + DEBUG ((DEBUG_INFO," Lvl4PagesStart - 0x%x, Lvl4PagesEnd -=20 > > > + 0x%x\n", > > > Lvl4PagesStart, Lvl4PagesEnd)); > > > > > > - Lvl3Start =3D RShiftU64 (BaseAddress, 30) & 0x1FF; > > > - if (ALIGN_VALUE_LOW(BaseAddress + SIZE_1GB, SIZE_1GB) <=3D > > > EndAddress) { > > > - Lvl3End =3D SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY) - 1= ; > > > - } else { > > > - Lvl3End =3D RShiftU64 (EndAddress - 1, 30) & 0x1FF; > > > + Lvl5PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)SecondLevelPagingEntry; > > > + } else { > > > + Lvl5Start =3D RShiftU64 (BaseAddress, 48) & 0x1FF; > > > + Lvl5End =3D Lvl5Start; > > > + > > > + Lvl4Start =3D RShiftU64 (BaseAddress, 39) & 0x1FF; > > > + Lvl4End =3D RShiftU64 (EndAddress - 1, 39) & 0x1FF; > > > + DEBUG ((DEBUG_INFO," Lvl4Start - 0x%x, Lvl4End - 0x%x\n",=20 > > > + Lvl4Start, > > > Lvl4End)); > > > + > > > + Lvl4PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)SecondLevelPagingEntry; > > > + } > > > + > > > + for (Index5 =3D Lvl5Start; Index5 <=3D Lvl5End; Index5++) { > > > + if (Is5LevelPaging) { > > > + if (Lvl5PtEntry[Index5].Uint64 =3D=3D 0) { > > > + Lvl5PtEntry[Index5].Uint64 =3D (UINT64)(UINTN)AllocateZeroPa= ges (1); > > > + if (Lvl5PtEntry[Index5].Uint64 =3D=3D 0) { > > > + DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL4 PAGE FAIL > > > (0x%x)!!!!!!\n", Index5)); > > > + ASSERT(FALSE); > > > + return NULL; > > > + } > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)Lvl5PtEntry[Index5].Uint64, > > > SIZE_4KB); > > > + SetSecondLevelPagingEntryAttribute (&Lvl5PtEntry[Index5], > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > + } > > > + Lvl4Start =3D Lvl4PagesStart & 0x1FF; > > > + if (((Index5+1)<<9) > Lvl4PagesEnd) { > > > + Lvl4End =3D SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY) -= 1;; > > > + Lvl4PagesStart =3D (Index5+1)<<9; > > > + } else { > > > + Lvl4End =3D Lvl4PagesEnd & 0x1FF; > > > + } > > > + DEBUG ((DEBUG_INFO," Lvl5(0x%x): Lvl4Start - 0x%x, Lvl4End=20 > > > + - 0x%x\n", > > > Index5, Lvl4Start, Lvl4End)); > > > + Lvl4PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl5PtEntry[Index5].Bits.AddressLo, > > > Lvl5PtEntry[Index5].Bits.AddressHi); > > > } > > > - DEBUG ((DEBUG_INFO," Lvl4(0x%x): Lvl3Start - 0x%x, Lvl3End - 0x= %x\n", > > > Index4, Lvl3Start, Lvl3End)); > > > > > > - Lvl3PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl4PtEntry[Index4].Bits.AddressLo, > > > Lvl4PtEntry[Index4].Bits.AddressHi); > > > - for (Index3 =3D Lvl3Start; Index3 <=3D Lvl3End; Index3++) { > > > - if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > - Lvl3PtEntry[Index3].Uint64 =3D (UINT64)(UINTN)AllocateZeroPa= ges (1); > > > - if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > - DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL3 PAGE FAIL (0x%x, > > > 0x%x)!!!!!!\n", Index4, Index3)); > > > + for (Index4 =3D Lvl4Start; Index4 <=3D Lvl4End; Index4++) { > > > + if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > + Lvl4PtEntry[Index4].Uint64 =3D (UINT64)(UINTN)AllocateZeroPa= ges (1); > > > + if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > + DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL4 PAGE FAIL > > > (0x%x)!!!!!!\n", Index4)); > > > ASSERT(FALSE); > > > return NULL; > > > } > > > - FlushPageTableMemory (VtdIndex, (UINTN)Lvl3PtEntry[Index3].U= int64, > > > SIZE_4KB); > > > - SetSecondLevelPagingEntryAttribute (&Lvl3PtEntry[Index3], > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)Lvl4PtEntry[Index4].Uint64, > > > SIZE_4KB); > > > + SetSecondLevelPagingEntryAttribute (&Lvl4PtEntry[Index4], > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > + } > > > + > > > + Lvl3Start =3D RShiftU64 (BaseAddress, 30) & 0x1FF; > > > + if (ALIGN_VALUE_LOW(BaseAddress + SIZE_1GB, SIZE_1GB) <=3D > > > EndAddress) { > > > + Lvl3End =3D SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY) -= 1; > > > + } else { > > > + Lvl3End =3D RShiftU64 (EndAddress - 1, 30) & 0x1FF; > > > } > > > + DEBUG ((DEBUG_INFO," Lvl4(0x%x): Lvl3Start - 0x%x, Lvl3End=20 > > > + - 0x%x\n", > > > Index4, Lvl3Start, Lvl3End)); > > > > > > - Lvl2PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl3PtEntry[Index3].Bits.AddressLo, > > > Lvl3PtEntry[Index3].Bits.AddressHi); > > > - for (Index2 =3D 0; Index2 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index2++) { > > > - Lvl2PtEntry[Index2].Uint64 =3D BaseAddress; > > > - SetSecondLevelPagingEntryAttribute (&Lvl2PtEntry[Index2], > > > IoMmuAccess); > > > - Lvl2PtEntry[Index2].Bits.PageSize =3D 1; > > > - BaseAddress +=3D SIZE_2MB; > > > + Lvl3PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl4PtEntry[Index4].Bits.AddressLo, > > > Lvl4PtEntry[Index4].Bits.AddressHi); > > > + for (Index3 =3D Lvl3Start; Index3 <=3D Lvl3End; Index3++) { > > > + if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > + Lvl3PtEntry[Index3].Uint64 =3D (UINT64)(UINTN)AllocateZero= Pages (1); > > > + if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > + DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL3 PAGE FAIL=20 > > > + (0x%x, > > > 0x%x)!!!!!!\n", Index4, Index3)); > > > + ASSERT(FALSE); > > > + return NULL; > > > + } > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)Lvl3PtEntry[Index3].Uint64, > > > SIZE_4KB); > > > + SetSecondLevelPagingEntryAttribute=20 > > > + (&Lvl3PtEntry[Index3], > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > + } > > > + > > > + Lvl2PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl3PtEntry[Index3].Bits.AddressLo, > > > Lvl3PtEntry[Index3].Bits.AddressHi); > > > + for (Index2 =3D 0; Index2 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index2++) { > > > + Lvl2PtEntry[Index2].Uint64 =3D BaseAddress; > > > + SetSecondLevelPagingEntryAttribute=20 > > > + (&Lvl2PtEntry[Index2], > > > IoMmuAccess); > > > + Lvl2PtEntry[Index2].Bits.PageSize =3D 1; > > > + BaseAddress +=3D SIZE_2MB; > > > + if (BaseAddress >=3D MemoryLimit) { > > > + break; > > > + } > > > + } > > > + FlushPageTableMemory (VtdIndex, (UINTN)Lvl2PtEntry,=20 > > > + SIZE_4KB); > > > if (BaseAddress >=3D MemoryLimit) { > > > break; > > > } > > > } > > > - FlushPageTableMemory (VtdIndex, (UINTN)Lvl2PtEntry, SIZE_4KB); > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)&Lvl3PtEntry[Lvl3Start], > > > (UINTN)&Lvl3PtEntry[Lvl3End + 1] - (UINTN)&Lvl3PtEntry[Lvl3Start]); > > > if (BaseAddress >=3D MemoryLimit) { > > > break; > > > } > > > } > > > - FlushPageTableMemory (VtdIndex, (UINTN)&Lvl3PtEntry[Lvl3Start], > > > (UINTN)&Lvl3PtEntry[Lvl3End + 1] - (UINTN)&Lvl3PtEntry[Lvl3Start]); > > > - if (BaseAddress >=3D MemoryLimit) { > > > - break; > > > - } > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)&Lvl4PtEntry[Lvl4Start], > > > (UINTN)&Lvl4PtEntry[Lvl4End + 1] - (UINTN)&Lvl4PtEntry[Lvl4Start]); > > > } > > > - FlushPageTableMemory (VtdIndex, (UINTN)&Lvl4PtEntry[Lvl4Start],=20 > > > (UINTN)&Lvl4PtEntry[Lvl4End + 1] -=20 > > > (UINTN)&Lvl4PtEntry[Lvl4Start]); > > > + FlushPageTableMemory (VtdIndex, (UINTN)&Lvl5PtEntry[Lvl5Start], > > > (UINTN)&Lvl5PtEntry[Lvl5End + 1] -=20 > > > (UINTN)&Lvl5PtEntry[Lvl5Start]); > > > > > > return SecondLevelPagingEntry; > > > } > > > @@ -266,26 +332,28 @@ CreateSecondLevelPagingEntryTable ( > > > > > > @param[in] VtdIndex The index of the VTd engin= e. > > > @param[in] IoMmuAccess The IOMMU access. > > > + @param[in] Is5LevelPaging If it is the 5 level pagin= g. > > > > > > @return The second level paging entry. > > > **/ > > > VTD_SECOND_LEVEL_PAGING_ENTRY * > > > CreateSecondLevelPagingEntry ( > > > IN UINTN VtdIndex, > > > - IN UINT64 IoMmuAccess > > > + IN UINT64 IoMmuAccess, > > > + IN BOOLEAN Is5LevelPaging > > > ) > > > { > > > VTD_SECOND_LEVEL_PAGING_ENTRY *SecondLevelPagingEntry; > > > > > > SecondLevelPagingEntry =3D NULL; > > > - SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable=20 > > > (VtdIndex, SecondLevelPagingEntry, 0, mBelow4GMemoryLimit,=20 > > > IoMmuAccess); > > > + SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable=20 > > > + (VtdIndex, > > > SecondLevelPagingEntry, 0, mBelow4GMemoryLimit, IoMmuAccess,=20 > > > Is5LevelPaging); > > > if (SecondLevelPagingEntry =3D=3D NULL) { > > > return NULL; > > > } > > > > > > if (mAbove4GMemoryLimit !=3D 0) { > > > ASSERT (mAbove4GMemoryLimit > BASE_4GB); > > > - SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable > (VtdIndex, > > > SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, > IoMmuAccess); > > > + SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable=20 > > > + (VtdIndex, > > > SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit,=20 > > > IoMmuAccess, Is5LevelPaging); > > > if (SecondLevelPagingEntry =3D=3D NULL) { > > > return NULL; > > > } > > > @@ -326,11 +394,13 @@ SetupTranslationTable ( > > > /** > > > Dump DMAR context entry table. > > > > > > - @param[in] RootEntry DMAR root entry. > > > + @param[in] RootEntry DMAR root entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpDmarContextEntryTable ( > > > - IN VTD_ROOT_ENTRY *RootEntry > > > + IN VTD_ROOT_ENTRY *RootEntry, > > > + IN BOOLEAN Is5LevelPaging > > > ) > > > { > > > UINTN Index; > > > @@ -359,7 +429,7 @@ DumpDmarContextEntryTable ( > > > if (ContextEntry[Index2].Bits.Present =3D=3D 0) { > > > continue; > > > } > > > - DumpSecondLevelPagingEntry ((VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ContextEntry[Index2].Bits.SecondLevelP > > > ag > > > e > > > TranslationPointerLo, > > > ContextEntry[Index2].Bits.SecondLevelPageTranslationPointerHi)); > > > + DumpSecondLevelPagingEntry ((VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ContextEntry[Index2].Bits.SecondLevelP > > > ag > > > e > > > TranslationPointerLo, > > > ContextEntry[Index2].Bits.SecondLevelPageTranslationPointerHi), > > > Is5LevelPaging); > > > } > > > } > > > DEBUG ((DEBUG_INFO,"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n")); > > > @@ -368,17 +438,22 @@ DumpDmarContextEntryTable ( > > > /** > > > Dump DMAR second level paging entry. > > > > > > - @param[in] SecondLevelPagingEntry The second level paging entry. > > > + @param[in] SecondLevelPagingEntry The second level paging entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpSecondLevelPagingEntry ( > > > - IN VOID *SecondLevelPagingEntry > > > + IN VOID *SecondLevelPagingEntry, IN BOOLEAN Is5LevelPaging > > > ) > > > { > > > + UINTN Index5; > > > UINTN Index4; > > > UINTN Index3; > > > UINTN Index2; > > > UINTN Index1; > > > + UINTN Lvl5IndexEnd; > > > + VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl5PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl4PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl3PtEntry; > > > VTD_SECOND_LEVEL_PAGING_ENTRY *Lvl2PtEntry; @@ -386,38 +461,53 > > @@ > > > DumpSecondLevelPagingEntry ( > > > > > > DEBUG ((DEBUG_VERBOSE,"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D\n")); > > > DEBUG ((DEBUG_VERBOSE,"DMAR Second Level Page Table:\n")); > > > + DEBUG ((DEBUG_VERBOSE,"SecondLevelPagingEntry Base - 0x%x, > > > Is5LevelPaging - %d\n", SecondLevelPagingEntry, Is5LevelPaging)); > > > > > > - DEBUG ((DEBUG_VERBOSE,"SecondLevelPagingEntry Base - 0x%x\n",=20 > > > SecondLevelPagingEntry)); > > > + Lvl5IndexEnd =3D Is5LevelPaging ? > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY) : 1; > > > Lvl4PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY=20 > > > *)SecondLevelPagingEntry; > > > - for (Index4 =3D 0; Index4 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index4++) { > > > - if (Lvl4PtEntry[Index4].Uint64 !=3D 0) { > > > - DEBUG ((DEBUG_VERBOSE," Lvl4Pt Entry(0x%03x) - 0x%016lx\n", > Index4, > > > Lvl4PtEntry[Index4].Uint64)); > > > - } > > > - if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > - continue; > > > - } > > > - Lvl3PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl4PtEntry[Index4].Bits.AddressLo, > > > Lvl4PtEntry[Index4].Bits.AddressHi); > > > - for (Index3 =3D 0; Index3 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index3++) { > > > - if (Lvl3PtEntry[Index3].Uint64 !=3D 0) { > > > - DEBUG ((DEBUG_VERBOSE," Lvl3Pt Entry(0x%03x) - 0x%016lx\n= ", > > > Index3, Lvl3PtEntry[Index3].Uint64)); > > > + Lvl5PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)SecondLevelPagingEntry; > > > + > > > + for (Index5 =3D 0; Index5 < Lvl5IndexEnd; Index5++) { > > > + if (Is5LevelPaging) { > > > + if (Lvl5PtEntry[Index5].Uint64 !=3D 0) { > > > + DEBUG ((DEBUG_VERBOSE," Lvl5Pt Entry(0x%03x) -=20 > > > + 0x%016lx\n", > > > Index5, Lvl5PtEntry[Index5].Uint64)); > > > } > > > - if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > + if (Lvl5PtEntry[Index5].Uint64 =3D=3D 0) { > > > continue; > > > } > > > + Lvl4PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl5PtEntry[Index5].Bits.AddressLo, > > > Lvl5PtEntry[Index5].Bits.AddressHi); > > > + } > > > > > > - Lvl2PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl3PtEntry[Index3].Bits.AddressLo, > > > Lvl3PtEntry[Index3].Bits.AddressHi); > > > - for (Index2 =3D 0; Index2 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index2++) { > > > - if (Lvl2PtEntry[Index2].Uint64 !=3D 0) { > > > - DEBUG ((DEBUG_VERBOSE," Lvl2Pt Entry(0x%03x) - 0x%016= lx\n", > > > Index2, Lvl2PtEntry[Index2].Uint64)); > > > + for (Index4 =3D 0; Index4 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index4++) { > > > + if (Lvl4PtEntry[Index4].Uint64 !=3D 0) { > > > + DEBUG ((DEBUG_VERBOSE," Lvl4Pt Entry(0x%03x) -=20 > > > + 0x%016lx\n", > > > Index4, Lvl4PtEntry[Index4].Uint64)); > > > + } > > > + if (Lvl4PtEntry[Index4].Uint64 =3D=3D 0) { > > > + continue; > > > + } > > > + Lvl3PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl4PtEntry[Index4].Bits.AddressLo, > > > Lvl4PtEntry[Index4].Bits.AddressHi); > > > + for (Index3 =3D 0; Index3 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index3++) { > > > + if (Lvl3PtEntry[Index3].Uint64 !=3D 0) { > > > + DEBUG ((DEBUG_VERBOSE," Lvl3Pt Entry(0x%03x) - 0x%016lx\= n", > > > Index3, Lvl3PtEntry[Index3].Uint64)); > > > } > > > - if (Lvl2PtEntry[Index2].Uint64 =3D=3D 0) { > > > + if (Lvl3PtEntry[Index3].Uint64 =3D=3D 0) { > > > continue; > > > } > > > - if (Lvl2PtEntry[Index2].Bits.PageSize =3D=3D 0) { > > > - Lvl1PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl2PtEntry[Index2].Bits.AddressLo, > > > Lvl2PtEntry[Index2].Bits.AddressHi); > > > - for (Index1 =3D 0; Index1 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index1++) { > > > - if (Lvl1PtEntry[Index1].Uint64 !=3D 0) { > > > - DEBUG ((DEBUG_VERBOSE," Lvl1Pt Entry(0x%03x) - > > 0x%016lx\n", > > > Index1, Lvl1PtEntry[Index1].Uint64)); > > > + > > > + Lvl2PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl3PtEntry[Index3].Bits.AddressLo, > > > Lvl3PtEntry[Index3].Bits.AddressHi); > > > + for (Index2 =3D 0; Index2 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index2++) { > > > + if (Lvl2PtEntry[Index2].Uint64 !=3D 0) { > > > + DEBUG ((DEBUG_VERBOSE," Lvl2Pt Entry(0x%03x) - 0x%016= lx\n", > > > Index2, Lvl2PtEntry[Index2].Uint64)); > > > + } > > > + if (Lvl2PtEntry[Index2].Uint64 =3D=3D 0) { > > > + continue; > > > + } > > > + if (Lvl2PtEntry[Index2].Bits.PageSize =3D=3D 0) { > > > + Lvl1PtEntry =3D (VTD_SECOND_LEVEL_PAGING_ENTRY > > > *)(UINTN)VTD_64BITS_ADDRESS(Lvl2PtEntry[Index2].Bits.AddressLo, > > > Lvl2PtEntry[Index2].Bits.AddressHi); > > > + for (Index1 =3D 0; Index1 < > > > SIZE_4KB/sizeof(VTD_SECOND_LEVEL_PAGING_ENTRY); Index1++) { > > > + if (Lvl1PtEntry[Index1].Uint64 !=3D 0) { > > > + DEBUG ((DEBUG_VERBOSE," Lvl1Pt Entry(0x%03x) - > > 0x%016lx\n", > > > Index1, Lvl1PtEntry[Index1].Uint64)); > > > + } > > > } > > > } > > > } > > > @@ -510,6 +600,7 @@ PageAttributeToLength ( > > > @param[in] VtdIndex The index used to identify a= VTd engine. > > > @param[in] SecondLevelPagingEntry The second level paging entr= y in > > > VTd table for the device. > > > @param[in] Address The address to be checked. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > @param[out] PageAttributes The page attribute of the pa= ge entry. > > > > > > @return The page entry. > > > @@ -519,6 +610,7 @@ GetSecondLevelPageTableEntry ( > > > IN UINTN VtdIndex, > > > IN VTD_SECOND_LEVEL_PAGING_ENTRY *SecondLevelPagingEntry, > > > IN PHYSICAL_ADDRESS Address, > > > + IN BOOLEAN Is5LevelPaging, > > > OUT PAGE_ATTRIBUTE *PageAttribute > > > ) > > > { > > > @@ -526,17 +618,38 @@ GetSecondLevelPageTableEntry ( > > > UINTN Index2; > > > UINTN Index3; > > > UINTN Index4; > > > + UINTN Index5; > > > UINT64 *L1PageTable; > > > UINT64 *L2PageTable; > > > UINT64 *L3PageTable; > > > UINT64 *L4PageTable; > > > + UINT64 *L5PageTable; > > > > > > + Index5 =3D ((UINTN)RShiftU64 (Address, 48)) &=20 > > > + PAGING_VTD_INDEX_MASK; > > > Index4 =3D ((UINTN)RShiftU64 (Address, 39)) & PAGING_VTD_INDEX_MAS= K; > > > Index3 =3D ((UINTN)Address >> 30) & PAGING_VTD_INDEX_MASK; > > > Index2 =3D ((UINTN)Address >> 21) & PAGING_VTD_INDEX_MASK; > > > Index1 =3D ((UINTN)Address >> 12) & PAGING_VTD_INDEX_MASK; > > > > > > - L4PageTable =3D (UINT64 *)SecondLevelPagingEntry; > > > + if (Is5LevelPaging) { > > > + L5PageTable =3D (UINT64 *)SecondLevelPagingEntry; > > > + if (L5PageTable[Index5] =3D=3D 0) { > > > + L5PageTable[Index5] =3D (UINT64)(UINTN)AllocateZeroPages (1); > > > + if (L5PageTable[Index5] =3D=3D 0) { > > > + DEBUG ((DEBUG_ERROR,"!!!!!! ALLOCATE LVL5 PAGE FAIL > > > (0x%x)!!!!!!\n", Index4)); > > > + ASSERT(FALSE); > > > + *PageAttribute =3D PageNone; > > > + return NULL; > > > + } > > > + FlushPageTableMemory (VtdIndex, (UINTN)L5PageTable[Index5], > > > SIZE_4KB); > > > + SetSecondLevelPagingEntryAttribute > > > ((VTD_SECOND_LEVEL_PAGING_ENTRY *)&L5PageTable[Index5],=20 > > > EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE); > > > + FlushPageTableMemory (VtdIndex,=20 > > > + (UINTN)&L5PageTable[Index5], > > > sizeof(L5PageTable[Index5])); > > > + } > > > + L4PageTable =3D (UINT64 *)(UINTN)(L5PageTable[Index5] & > > > PAGING_4K_ADDRESS_MASK_64); > > > + } else { > > > + L4PageTable =3D (UINT64 *)SecondLevelPagingEntry; } > > > + > > > if (L4PageTable[Index4] =3D=3D 0) { > > > L4PageTable[Index4] =3D (UINT64)(UINTN)AllocateZeroPages (1); > > > if (L4PageTable[Index4] =3D=3D 0) { @@ -785,7 +898,7 @@=20 > > > SetSecondLevelPagingAttribute ( > > > } > > > > > > while (Length !=3D 0) { > > > - PageEntry =3D GetSecondLevelPageTableEntry (VtdIndex, > > > SecondLevelPagingEntry, BaseAddress, &PageAttribute); > > > + PageEntry =3D GetSecondLevelPageTableEntry (VtdIndex, > > > SecondLevelPagingEntry, BaseAddress,=20 > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging, &PageAttribute); > > > if (PageEntry =3D=3D NULL) { > > > DEBUG ((DEBUG_ERROR, "PageEntry - NULL\n")); > > > return RETURN_UNSUPPORTED; > > > @@ -913,7 +1026,7 @@ SetAccessAttribute ( > > > > > > if (ExtContextEntry !=3D NULL) { > > > if (ExtContextEntry->Bits.Present =3D=3D 0) { > > > - SecondLevelPagingEntry =3D CreateSecondLevelPagingEntry (VtdIn= dex, 0); > > > + SecondLevelPagingEntry =3D CreateSecondLevelPagingEntry=20 > > > + (VtdIndex, 0, > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging); > > > DEBUG ((DEBUG_VERBOSE,"SecondLevelPagingEntry - 0x%x (S%04x=20 > > > B%02x D%02x F%02x) New\n", SecondLevelPagingEntry, Segment,=20 > > > SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function)); > > > Pt =3D (UINT64)RShiftU64 > > > ((UINT64)(UINTN)SecondLevelPagingEntry, > > > 12); > > > > > > @@ -922,7 +1035,7 @@ SetAccessAttribute ( > > > ExtContextEntry->Bits.DomainIdentifier =3D DomainIdentifier; > > > ExtContextEntry->Bits.Present =3D 1; > > > FlushPageTableMemory (VtdIndex, (UINTN)ExtContextEntry,=20 > > > sizeof(*ExtContextEntry)); > > > - DumpDmarExtContextEntryTable > > > (mVtdUnitInformation[VtdIndex].ExtRootEntryTable); > > > + DumpDmarExtContextEntryTable > > > (mVtdUnitInformation[VtdIndex].ExtRootEntryTable, > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging); > > > mVtdUnitInformation[VtdIndex].HasDirtyContext =3D TRUE; > > > } else { > > > SecondLevelPagingEntry =3D (VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ExtContextEntry- > > > >Bits.SecondLevelPageTranslationPointerLo, ExtContextEntry-=20 > > > >Bits.SecondLevelPageTranslationPointerHi); > > > @@ -930,7 +1043,7 @@ SetAccessAttribute ( > > > } > > > } else if (ContextEntry !=3D NULL) { > > > if (ContextEntry->Bits.Present =3D=3D 0) { > > > - SecondLevelPagingEntry =3D CreateSecondLevelPagingEntry (VtdIn= dex, 0); > > > + SecondLevelPagingEntry =3D CreateSecondLevelPagingEntry=20 > > > + (VtdIndex, 0, > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging); > > > DEBUG ((DEBUG_VERBOSE,"SecondLevelPagingEntry - 0x%x (S%04x=20 > > > B%02x D%02x F%02x) New\n", SecondLevelPagingEntry, Segment,=20 > > > SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function)); > > > Pt =3D (UINT64)RShiftU64 > > > ((UINT64)(UINTN)SecondLevelPagingEntry, > > > 12); > > > > > > @@ -939,7 +1052,7 @@ SetAccessAttribute ( > > > ContextEntry->Bits.DomainIdentifier =3D DomainIdentifier; > > > ContextEntry->Bits.Present =3D 1; > > > FlushPageTableMemory (VtdIndex, (UINTN)ContextEntry,=20 > > > sizeof(*ContextEntry)); > > > - DumpDmarContextEntryTable > > > (mVtdUnitInformation[VtdIndex].RootEntryTable); > > > + DumpDmarContextEntryTable > > > (mVtdUnitInformation[VtdIndex].RootEntryTable, > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging); > > > mVtdUnitInformation[VtdIndex].HasDirtyContext =3D TRUE; > > > } else { > > > SecondLevelPagingEntry =3D (VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ContextEntry- > > > >Bits.SecondLevelPageTranslationPointerLo, ContextEntry-=20 > > > >Bits.SecondLevelPageTranslationPointerHi); > > > @@ -1000,7 +1113,7 @@ AlwaysEnablePageAttribute ( > > > > > > if (mVtdUnitInformation[VtdIndex].FixedSecondLevelPagingEntry =3D= =3D 0) { > > > DEBUG((DEBUG_INFO, "CreateSecondLevelPagingEntry - %d\n",=20 > > > VtdIndex)); > > > - mVtdUnitInformation[VtdIndex].FixedSecondLevelPagingEntry =3D > > > CreateSecondLevelPagingEntry (VtdIndex, EDKII_IOMMU_ACCESS_READ |=20 > > > EDKII_IOMMU_ACCESS_WRITE); > > > + mVtdUnitInformation[VtdIndex].FixedSecondLevelPagingEntry =3D > > > CreateSecondLevelPagingEntry (VtdIndex, EDKII_IOMMU_ACCESS_READ |=20 > > > EDKII_IOMMU_ACCESS_WRITE,=20 > > > mVtdUnitInformation[VtdIndex].Is5LevelPaging); > > > } > > > > > > SecondLevelPagingEntry =3D > > > mVtdUnitInformation[VtdIndex].FixedSecondLevelPagingEntry; > > > diff --git > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTa= bleEx. > > > c > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTa= bleEx. > > > c > > > index 0ed9e3ca..a4466891 100644 > > > --- > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTa= bleEx. > > > c > > > +++ > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTa= bleEx. > > > c > > > @@ -78,11 +78,28 @@ CreateExtContextEntry ( > > > > > > DEBUG ((DEBUG_INFO,"DOMAIN: S%04x, B%02x D%02x F%02x\n",=20 > > > mVtdUnitInformation[VtdIndex].Segment, SourceId.Bits.Bus,=20 > > > SourceId.Bits.Device, SourceId.Bits.Function)); > > > > > > - if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT2) =3D= =3D 0) { > > > - DEBUG((DEBUG_ERROR, "!!!! 4-level page-table is not supported = on > > > VTD %d !!!!\n", VtdIndex)); > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; > > > + if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & BIT3) != =3D 0) { > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D TRUE; > > > + if (mAcpiDmarTable->HostAddressWidth <=3D 48) { > > > + if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW &=20 > > > + BIT2) !=3D 0) > { > > > + mVtdUnitInformation[VtdIndex].Is5LevelPaging =3D FALSE; > > > + } > > > + } > > > + } else if ((mVtdUnitInformation[VtdIndex].CapReg.Bits.SAGAW & > > > + BIT2) =3D=3D > > > 0) { > > > + DEBUG((DEBUG_ERROR, "!!!! Page-table type is not supported=20 > > > + on > > > VTD %d !!!!\n", VtdIndex)); > > > return EFI_UNSUPPORTED; > > > } > > > - ExtContextEntry->Bits.AddressWidth =3D 0x2; > > > + > > > + if (mVtdUnitInformation[VtdIndex].Is5LevelPaging) { > > > + ExtContextEntry->Bits.AddressWidth =3D 0x3; > > > + DEBUG((DEBUG_ERROR, "Using 4-level page-table on VTD %d\n", > > > VtdIndex)); > > > + } else { > > > + ExtContextEntry->Bits.AddressWidth =3D 0x2; > > > + DEBUG((DEBUG_ERROR, "Using 5-level page-table on VTD %d\n", > > > VtdIndex)); > > > + } > > > + > > > + > > > } > > > > > > FlushPageTableMemory (VtdIndex,=20 > > > (UINTN)mVtdUnitInformation[VtdIndex].ExtRootEntryTable, > > > EFI_PAGES_TO_SIZE(EntryTablePages)); > > > @@ -93,11 +110,13 @@ CreateExtContextEntry ( > > > /** > > > Dump DMAR extended context entry table. > > > > > > - @param[in] ExtRootEntry DMAR extended root entry. > > > + @param[in] ExtRootEntry DMAR extended root entry. > > > + @param[in] Is5LevelPaging If it is the 5 level paging. > > > **/ > > > VOID > > > DumpDmarExtContextEntryTable ( > > > - IN VTD_EXT_ROOT_ENTRY *ExtRootEntry > > > + IN VTD_EXT_ROOT_ENTRY *ExtRootEntry, IN BOOLEAN Is5LevelPaging > > > ) > > > { > > > UINTN Index; > > > @@ -127,7 +146,7 @@ DumpDmarExtContextEntryTable ( > > > if (ExtContextEntry[Index2].Bits.Present =3D=3D 0) { > > > continue; > > > } > > > - DumpSecondLevelPagingEntry ((VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ExtContextEntry[Index2].Bits.SecondLev > > > el > > > Pa > > > geTranslationPointerLo, > > > ExtContextEntry[Index2].Bits.SecondLevelPageTranslationPointerHi)) > > > ; > > > + DumpSecondLevelPagingEntry ((VOID > > > *)(UINTN)VTD_64BITS_ADDRESS(ExtContextEntry[Index2].Bits.SecondLev > > > el > > > Pa > > > geTranslationPointerLo, > > > ExtContextEntry[Index2].Bits.SecondLevelPageTranslationPointerHi), > > > Is5LevelPaging); > > > } > > > > > > if (ExtRootEntry[Index].Bits.UpperPresent =3D=3D 0) { diff --git= =20 > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c > > > b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c > > > index 699639ba..686d235f 100644 > > > ---=20 > > > a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg.c > > > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/VtdReg > > > +++ .c > > > @@ -174,8 +174,14 @@ PrepareVtdConfig ( > > > if ((mVtdUnitInformation[Index].CapReg.Bits.SLLPS & BIT0) =3D=3D= 0) { > > > DEBUG((DEBUG_WARN, "!!!! 2MB super page is not supported on=20 > > > VTD %d !!!!\n", Index)); > > > } > > > - if ((mVtdUnitInformation[Index].CapReg.Bits.SAGAW & BIT2) =3D=3D= 0) { > > > - DEBUG((DEBUG_ERROR, "!!!! 4-level page-table is not supported = on > > > VTD %d !!!!\n", Index)); > > > + if ((mVtdUnitInformation[Index].CapReg.Bits.SAGAW & BIT3) !=3D 0= ) { > > > + DEBUG((DEBUG_INFO, "Support 5-level page-table on VTD=20 > > > + %d\n", > > > Index)); > > > + } > > > + if ((mVtdUnitInformation[Index].CapReg.Bits.SAGAW & BIT2) !=3D 0= ) { > > > + DEBUG((DEBUG_INFO, "Support 4-level page-table on VTD=20 > > > + %d\n", > > > Index)); > > > + } > > > + if ((mVtdUnitInformation[Index].CapReg.Bits.SAGAW & (BIT3 | > > > + BIT2)) =3D=3D 0) > > > { > > > + DEBUG((DEBUG_ERROR, "!!!! Page-table type 0x%X is not=20 > > > + supported on > > > VTD %d !!!!\n", Index, mVtdUnitInformation[Index].CapReg.Bits.SAGAW))= ; > > > return ; > > > } > > > > > > -- > > > 2.16.2.windows.1