From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id ADB109414FB for ; Tue, 12 Sep 2023 10:01:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+W40ccDmTcLxk94sd1YZwoG7R4a13OoKuP4t2E6gg+c=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1694512869; v=1; b=C1vZ2TCLFggNITgA/VdNuOs3MC4aFbU+93jwoOjT2hNWdLe2z+i4RJwkA4mzOArsj2Jx0uG9 NPibnsnPro2tl2HipiTQfg9Hv0P5yC2ymDzoPuRAlmsdy9/R3HhQieTjxS3xPkUzkUEblKFneMz PMXw29TRW04vz1joCPkJp0G4= X-Received: by 127.0.0.2 with SMTP id GNspYY7687511xVTgK8SH14M; Tue, 12 Sep 2023 03:01:09 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.21277.1694512868868566773 for ; Tue, 12 Sep 2023 03:01:08 -0700 X-Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38C9TCmX001142; Tue, 12 Sep 2023 10:01:08 GMT X-Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t268fj0t2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 10:01:08 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38CA17ug013372 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Sep 2023 10:01:07 GMT X-Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 12 Sep 2023 03:01:06 -0700 Date: Tue, 12 Sep 2023 11:01:03 +0100 From: "Leif Lindholm" To: Ard Biesheuvel CC: , Ard Biesheuvel , Jake Garver Subject: Re: [edk2-devel] [PATCH] ArmPkg/ArmMmuLib: Drop buggy secure memory type check Message-ID: References: <20230912074230.3980611-1-ardb@google.com> MIME-Version: 1.0 In-Reply-To: <20230912074230.3980611-1-ardb@google.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: jAm_smAXoVcCaCWCAOL17Gj0ttsPBmhI X-Proofpoint-ORIG-GUID: jAm_smAXoVcCaCWCAOL17Gj0ttsPBmhI Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fbVSt1zlVmynjDLtvcoxtiuDx7686176AA= Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=C1vZ2TCL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, Sep 12, 2023 at 07:42:30 +0000, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > Jake reports that the IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE() macro is > no longer accurate since commit 852227a9d52e3cb9 ("ArmPkg/Mmu: Remove > handling of NONSECURE memory regions"). > > Fortunately, it only affects the NS bit in level 1 short descriptors, > which is ignored when executing in non-secure mode. And given that > running UEFI in the secure world is not a use case we aim to support, > let's just drop this logic altogether. > > Reported-by: Jake Garver > Signed-off-by: Ard Biesheuvel Good riddance. Reviewed-by: Leif Lindholm > --- > ArmPkg/Include/Library/ArmLib.h | 2 -- > ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 2 -- > 2 files changed, 4 deletions(-) > > diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h > index fb1ae57b3522..6c5315d7f45f 100644 > --- a/ArmPkg/Include/Library/ArmLib.h > +++ b/ArmPkg/Include/Library/ArmLib.h > @@ -45,8 +45,6 @@ typedef enum { > ARM_MEMORY_REGION_ATTRIBUTE_DEVICE, > } ARM_MEMORY_REGION_ATTRIBUTES; > > -#define IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE(attr) ((UINT32)(attr) & 1) > - > typedef struct { > EFI_PHYSICAL_ADDRESS PhysicalBase; > EFI_VIRTUAL_ADDRESS VirtualBase; > diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > index 00c5f42cd91a..28e4cd9f1a77 100644 > --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > @@ -169,7 +169,6 @@ PopulateLevel2PageTable ( > > // Overwrite the section entry to point to the new Level2 Translation Table > *SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) | > - (IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) | > TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE; > } else { > // We do not support the other section type (16MB Section) > @@ -192,7 +191,6 @@ PopulateLevel2PageTable ( > ZeroMem ((VOID *)TranslationTable, TRANSLATION_TABLE_PAGE_SIZE); > > *SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) | > - (IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) | > TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE; > } > > -- > 2.42.0.283.g2d96d420d3-goog > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108527): https://edk2.groups.io/g/devel/message/108527 Mute This Topic: https://groups.io/mt/101311374/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-