From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mx.groups.io with SMTP id smtpd.web10.1393.1688055627343670931 for ; Thu, 29 Jun 2023 09:20:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@taylorbeebe.com header.s=google header.b=D/ILIF0P; spf=pass (domain: taylorbeebe.com, ip: 209.85.210.176, mailfrom: t@taylorbeebe.com) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-66869feb7d1so571655b3a.3 for ; Thu, 29 Jun 2023 09:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=taylorbeebe.com; s=google; t=1688055626; x=1690647626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=J3GHoY4ztV7sZtPS1LcHNyw1VmM4RTuV3p8x2Tlvfi4=; b=D/ILIF0PEWhZwZR30BCVQrVCh15wL6Dp07bfwU2u7SFZ4hW4XwnoZc8owDMuNQ915G zBrEEL/4AaJH8/wFSNsqm+Nia0NO8DCXSkUP0/SNdV0G6CFXu/wIYLwXOc1mJ+BF5m5x qgKzykQ7ehu1gBZJpzYhEp6RniHktr18bzBlGyX/XCVOccIKWO3E/xlkqdQIgzIkt9PM dHpxMDE+WgxgNrmygLMpzb+2udVlch2/qqXzrwU3Xckdgt9xmiHA5pCSJQYqrlvPq6zm b0u75kPIn75y31STO+wwGV9ih1CdvAPcyaU7FeOTOY5TAazlZK138TkfhZrSD7CAS+9g 4nww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688055626; x=1690647626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=J3GHoY4ztV7sZtPS1LcHNyw1VmM4RTuV3p8x2Tlvfi4=; b=EA2J7Y4YvLVTf8j5N7uqPDvrZgECwVkarauProop6m95NWkMCGRSPzOnc7bYK3kgD0 nHopjtxu5zH+zq1YTI/CPLTUq5RtEM43vK5CFGEVuwVsuaVC0kaMK+JNAs1KF3yCZT5D QSigfU6s3wyIBUlNGrWY4vtweoQFLAwVLkKc9bX1y69MIpzqjVNglm/SyGwn+xHjE0nq VgQwYb+mbvoKSe5viq0cBp6rxHlaxT4ULwbBPCCehfL4AvESmTdtm7Gr4W/AhVIdEUfP 6NOBNkBq7vmLMtKHCVT73h9tFrzm6eUFJsiFLWGyogRWNL/wx687S6biG4hfvNif5DUR s9lA== X-Gm-Message-State: ABy/qLZRXYMneQyuKE4gJETHc+0l3guN91aKpEJZ0Ja/H1a5zmpQqTqO 2L/ijl//iouFncKvv5VsI+lbS0t1XILz3QyM/9Pccw== X-Google-Smtp-Source: APBJJlH9HOx4vWMnKehBZH9CmEMFNC+1xk3ObtReq97dyd65ifQTbecbODzvmrb+MMQShby1lkbdrA== X-Received: by 2002:a05:6a00:182a:b0:666:ae6b:c476 with SMTP id y42-20020a056a00182a00b00666ae6bc476mr394859pfa.25.1688055626569; Thu, 29 Jun 2023 09:20:26 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.46.230.135]) by smtp.gmail.com with ESMTPSA id b5-20020aa78705000000b0064f7c56d8b7sm6993578pfo.219.2023.06.29.09.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 09:20:26 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Taylor Beebe , Leif Lindholm , Ard Biesheuvel Subject: [PATCH 0/4] Update CpuDxe MMU Logic to Improve Consistency Date: Thu, 29 Jun 2023 09:17:54 -0700 Message-ID: X-Mailer: git-send-email 2.41.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch series: 1. Updates applies uncrustify to noncompliant files 2. Updates GetMemoryRegion() to handle the case where BaseAddress is an unmapped page, and update some other return values to be more consistent. 3. Adds some branching paths to what were previously only ASSERT statements to avoid dereferencing NULL and producing non-deterministic behavior when ASSERTs are disabled. 4. Adds function headers to the MMU logic documenting the behavior, parameters, and potetial return values. Taylor Beebe (4): ArmPkg: Apply Uncrustify to Non-Compliant Files ArmPkg: Update GetMemoryRegion() to Handle No mapping ArmPkg: Fix Unsafe ASSERTs in MMU Logic ArmPkg: Add Function Headers to MMU Logic Cc: Leif Lindholm Cc: Ard Biesheuvel ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c | 143 ++++++++++++-- ArmPkg/Drivers/CpuDxe/Arm/Mmu.c | 187 ++++++++++++++---- .../MmCommunicationPei/MmCommunicationPei.c | 6 +- ArmPkg/Include/IndustryStandard/ArmStdSmc.h | 8 +- 4 files changed, 281 insertions(+), 63 deletions(-) -- 2.41.0.windows.1