From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0714.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::714]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1B60A1A1E0B for ; Mon, 26 Sep 2016 15:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3EIOny6X7hKRW9oR7F3pELBONn+X+5DqZL0vOcHa0ko=; b=TnZXJDW+6inPy+kppPFL1+a0nl7Eb8OMM2Qm75Xg7LrDNk49yNmRAsY0nK3mrSlrW+MPWMmncUIDRJ1UBWTtRSGc+hAYwPwNpRN/QAk042OcGKfhd98y5L24rYiG/hV3+ICBcsM1uBes9qvEiBEb5g8yw06W7ngonjbGfCcyAsw= Received: from BL2PR03MB433.namprd03.prod.outlook.com (10.141.92.19) by BL2PR03MB433.namprd03.prod.outlook.com (10.141.92.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Mon, 26 Sep 2016 22:49:02 +0000 Received: from BL2PR03MB433.namprd03.prod.outlook.com ([10.141.92.19]) by BL2PR03MB433.namprd03.prod.outlook.com ([10.141.92.19]) with mapi id 15.01.0639.011; Mon, 26 Sep 2016 22:49:02 +0000 From: Kurt Kennett To: "edk2-devel@lists.01.org" CC: Ard Biesheuvel , Leif Lindholm Thread-Topic: [PATCH] ArmPkg-Drivers/CpuDxe: Fix Mmu Initialization Problem. Thread-Index: AdIYSA0Tn1eZSj5MT4WAyQI1TlRotA== Date: Mon, 26 Sep 2016 22:49:02 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Kurt.Kennett@microsoft.com; x-originating-ip: [2001:4898:80e8:5::35d] x-ms-office365-filtering-correlation-id: c4b61bca-7073-405e-8921-08d3e65f500d x-microsoft-exchange-diagnostics: 1; BL2PR03MB433; 6:QYFdkJ8yf3dC2SfzWy1g4Yqdvmha3eRAXKkiIMnG5y0mfWgY0eGvhYJawCF//O08H0IaJHH4GYu7pp6x+zbuHsjfyVoI1NGXGn7KA2SgtuLZuWZbrf0WbYy2tQbQewoiERa+bmDQP9FYLfMj9iv2Jl45TyZNyJEo9z57MK+TDID+QCv/65Nw8uSoM9n2rvPH4o/+JgHPdJ9RbQ5oWsazMFjNAo45yaCvtYzun3vDQdbvVceVHkTG4rDGYaflnDUIXIT5/qYNpIHn7gsqKrSRFAbsezSAbDXsQmEfWSyxBUPZc/r4w9hm5FBUbpbYtR2NkzsHl4bRPCuDAzb0xNFKAw==; 5:JHykccgpSvbybw/eqiZRvnzj0ftwc6B6Mceq9d7C8tRUxWFdV0miJovxRMUuycgUM0mkWkWkz5+W2KE2oLp42vPgQn34a4+WQqP2poWy2CCYxT3w+RiscO+Izgg+quBOK9quUHC/q8Z39DpNN53P6g==; 24:/AM18jexaSBrT8Qjw7CejOiN+xGji2ZkwGBL8mpfi9F1EfYlKjKLjWpOhrs/jiEPN1fa0lG4rje2McPSdNGlDJHWnObRFK3Y2yuBjWsuzPA=; 7:R313rsy5g88855lzB+3uUEQFGedpYiDcvF8QC8WMYq1dsJS4xmFqCXsE1Hi3i9Ixc6JpN2brJniWYKeSVG0Inu/8I97ZlUdbbMZnzyqDX/ULj9iwTX3nER8msFlefxIBCgLsvb9h2LwZiIDe9TXujYMSfgggs4BQBKtZtXUifaPmA6NGFq1QAJXP0lra136d3fqAsZ0fl4ynEWkEv625GO6SAJ9RR+q2HfnXL/w9qK3Uq5zXWONP0di1N7sltElCdqu7U/1zAVD6MeUvwqR7nKZThyJK+SXbi5NgQSBfeg4keT9Lvs+6eI9YlHWFQS8L x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB433; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(61426038)(61427038); SRVR:BL2PR03MB433; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB433; x-forefront-prvs: 00770C4423 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(189002)(199003)(110136003)(99286002)(105586002)(8676002)(86362001)(81166006)(97736004)(81156014)(7696004)(19580405001)(8990500004)(5002640100001)(19580395003)(4326007)(101416001)(86612001)(2906002)(229853001)(2351001)(6916009)(77096005)(2900100001)(50986999)(189998001)(7846002)(7736002)(106356001)(5660300001)(586003)(102836003)(54356999)(3280700002)(74316002)(8936002)(6116002)(87936001)(305945005)(11100500001)(33656002)(10090500001)(2501003)(68736007)(9686002)(92566002)(76576001)(3660700001)(5005710100001)(10290500002)(10400500002)(122556002)(3826002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB433; H:BL2PR03MB433.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Sep 2016 22:49:02.5134 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB433 Subject: [PATCH] ArmPkg-Drivers/CpuDxe: Fix Mmu Initialization Problem. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 22:49:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable During Mmu initialization in the CpuDxe, for a page table any bits set=20 in the 'NextSectionAttributes' are garbage and were set from bits that=20 are actually part of the pagetable address. We clear it out to zero=20 so that the SyncCacheConfigPage will use the page attributes instead=20 of trying to convert the (bogus) section attributes into page=20 attributes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Kurt Kennett --- ArmPkg/Drivers/CpuDxe/Arm/Mmu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c=20 b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c index 63da8ba..64ef1bb 100644 --- a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c +++ b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c @@ -297,6 +297,11 @@ SyncCacheConfig ( } NextRegionLength +=3D TT_DESCRIPTOR_SECTION_SIZE; } else if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(FirstLevelTable[i]= )) { + // In this case any bits set in the 'NextSectionAttributes' are garb= age and were set from + // bits that are actually part of the pagetable address. We clear i= t out to zero so that + // the SyncCacheConfigPage will use the page attributes instead of t= rying to convert the + // section attributes into page attributes + NextSectionAttributes =3D 0; Status =3D SyncCacheConfigPage ( i,FirstLevelTable[i], NumberOfDescriptors, MemorySpaceMap, -- 2.9.0.windows K2