From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.3840.1687771020578749046 for ; Mon, 26 Jun 2023 02:17:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WlXVFh4Q; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0CF7860DB6 for ; Mon, 26 Jun 2023 09:17:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72F46C433C8 for ; Mon, 26 Jun 2023 09:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687771019; bh=o42dPwz998+v8u0Dtc692VPxoPsUE1iLQHkAQ2/LoFw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WlXVFh4QDH4m3OI7do33Udh4UePAh/Yb2eLLwm3onvUlGwXQaTlU68KtUgFDyraLu Ejnby7/2jMfXvNoRPYR5uQgetNd+ZR0PkQI9xd7L6rc5JiIPmGMvgR+ET4Wwgj0nsJ kpb1dmt0a85P6VBGG1wN23gTO9mCFIg/9w2miBmwsta5e3TdTNKqyaJUvw1VjM5WrD Xqj7N/YHJopZYLqUs4foKh2OB89VI0uvM7qWoHXUlt985oHWU+gHFHxO6HY9eL1OPa iSjpZnWDbGJTUc5kmNQfP9XgFXM/O3OdIW5lnAFezeNoSaXXpR6e6cf6QAjt94SPc+ 9odmz9IVhx02Q== Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-4f86a7a5499so3978131e87.2 for ; Mon, 26 Jun 2023 02:16:59 -0700 (PDT) X-Gm-Message-State: AC+VfDyUuvywnhL+Ovw+YgqOwSApN0XdEA0YGPgF1l8AOxjawbO65E8j Ir+k7Kke5abcWy9sWFl7H0G7DutvCKYHRd3b8Og= X-Google-Smtp-Source: ACHHUZ5riVYVu+BMVPtvzbYy4RxTXMs1+qk8KvjrqMpPcNvtaxTpNYXK6nmROdt64YKVvTJLMQES4HsFsUFhtrATRus= X-Received: by 2002:a05:6512:2527:b0:4fa:a217:1e76 with SMTP id be39-20020a056512252700b004faa2171e76mr2068743lfb.9.1687771017417; Mon, 26 Jun 2023 02:16:57 -0700 (PDT) MIME-Version: 1.0 References: <20230602151739.3600820-1-ardb@kernel.org> <6bd48197-a08e-ba19-3d84-c6fd53407519@linux.microsoft.com> <03df01d9a710$fc2be230$f483a690$@byosoft.com.cn> In-Reply-To: <03df01d9a710$fc2be230$f483a690$@byosoft.com.cn> From: "Ard Biesheuvel" Date: Mon, 26 Jun 2023 11:16:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v2 0/7] Add PPI to manage PEI phase memory attributes To: devel@edk2.groups.io, gaoliming@byosoft.com.cn Cc: mikuback@linux.microsoft.com, Ray Ni , Jiewen Yao , Gerd Hoffmann , Taylor Beebe , Oliver Smith-Denny , Dandan Bi , Dun Tan , "Kinney, Michael D" , Leif Lindholm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 25 Jun 2023 at 04:59, gaoliming via groups.io wrote: > > For the changes in MdeModulePkg, Reviewed-by: Liming Gao > Merged as #4573 Thanks all. > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Michael > > Kubacki > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B46=E6=9C=887=E6=97=A5= 7:13 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: Ard Biesheuvel ; devel@ed= k2.groups.io > > =E6=8A=84=E9=80=81: Ray Ni ; Jiewen Yao ; Gerd > > Hoffmann ; Taylor Beebe ; Oliver > > Smith-Denny ; Dandan Bi ; > > Dun Tan ; Liming Gao ; > > Kinney, Michael D ; Leif Lindholm > > > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v2 0/7] Add PPI to manage P= EI phase memory > > attributes > > > > Reviewed-by: Michael Kubacki > > > > On 6/2/2023 11:17 AM, Ard Biesheuvel wrote: > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4468 > > > > > > > > > > > > This is a followup to the RFC that I sent to the edk2-devel list on t= he > > > > > > 25th of May. > > > > > > > > > > > > In an attempt to make some incremental progress, this v2 only covers = the > > > > > > NX remapping of the DXE stack in DxeIpl, using the newly introduced > > > > > > memory attributes PPI. > > > > > > > > > > > > Other use cases are deferred until we can converge on an approach tha= t > > > > > > works across architectures and platforms. In particular, this means t= he > > > > > > following use cases: > > > > > > - mapping the DXE core code and data regions RO and XP, respectively; > > > > > > - mapping shadowed PEIMs read-only (including the PEI core itself); > > > > > > - managing memory permissions after temporary RAM migration; > > > > > > - reorganizing the X64 PEI flow with respect to page table allocation= ; > > > > > > - managing the dispatch order of the PEIM producing the PPI in relati= on > > > > > > to its consumers. > > > > > > > > > > > > The current series specifies the PPI in patch #1, and wires it up int= o > > > > > > DxeIpl to remap the DXE stack non-executable in a generic manner > > > > > > (patches #2 and #3) > > > > > > > > > > > > Patches #4 and #5 implement the PPI for ARM and AArch64. > > > > > > > > > > > > Patch #6 switches ARM and AArch64 over to the generic DxeIpl. > > > > > > > > > > > > Patch #7 cleans up the ARM implementation of the UEFI memory attribut= es > > > > > > protocol, based on the improvements made in patch #4. > > > > > > > > > > > > Changes since RFC (in addition to the above): > > > > > > - update PPI protype to use attributes+mask instead of setmask+clearm= ask > > > > > > - drop OVMF patch for RISC-V that has been applied in the meantime > > > > > > > > > > > > Cc: Ray Ni > > > > > > Cc: Jiewen Yao > > > > > > Cc: Gerd Hoffmann > > > > > > Cc: Taylor Beebe > > > > > > Cc: Oliver Smith-Denny > > > > > > Cc: Dandan Bi > > > > > > Cc: Dun Tan > > > > > > Cc: Liming Gao > > > > > > Cc: "Kinney, Michael D" > > > > > > Cc: Leif Lindholm > > > > > > Cc: Michael Kubacki > > > > > > > > > > > > Ard Biesheuvel (7): > > > > > > MdeModulePkg: Define memory attribute PPI > > > > > > MdeModulePkg/DxeIpl: Merge EBC, RISCV64 and LOONGARCH code > > > > > > MdeModulePkg/DxeIpl: Use memory attribute PPI to remap the stack > > NX > > > > > > ArmPkg/ArmMmuLib: Extend API to manage memory permissions > > better > > > > > > ArmPkg/CpuPei: Implement the memory attributes PPI > > > > > > MdeModulePkg/DxeIpl ARM AARCH64: Switch to generic handoff code > > > > > > ArmPkg/CpuDxe: Simplify memory attributes protocol implementation > > > > > > > > > > > > ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c > > | 2 +- > > > > > > ArmPkg/Drivers/CpuDxe/MemoryAttribute.c > > | 50 +---------- > > > > > > ArmPkg/Drivers/CpuPei/CpuPei.c > > | 76 +++++++++++++++++ > > > > > > ArmPkg/Drivers/CpuPei/CpuPei.inf > > | 4 + > > > > > > ArmPkg/Include/Library/ArmMmuLib.h > > | 36 +++++++- > > > > > > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > > | 52 +++++++++++- > > > > > > ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c > > | 88 +++++++++++++++++--- > > > > > > ArmPkg/Library/OpteeLib/Optee.c > > | 2 +- > > > > > > MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c > > | 71 ---------------- > > > > > > MdeModulePkg/Core/DxeIplPeim/{Ebc/DxeLoadFunc.c =3D> DxeHandoff.c} > > | 31 ++++++- > > > > > > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > > | 24 ++---- > > > > > > MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c > > | 63 -------------- > > > > > > MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c > > | 75 ----------------- > > > > > > MdeModulePkg/Include/Ppi/MemoryAttribute.h > > | 83 ++++++++++++++++++ > > > > > > MdeModulePkg/MdeModulePkg.dec > > | 3 + > > > > > > 15 files changed, 366 insertions(+), 294 deletions(-) > > > > > > delete mode 100644 > > MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c > > > > > > rename MdeModulePkg/Core/DxeIplPeim/{Ebc/DxeLoadFunc.c =3D> > > DxeHandoff.c} (62%) > > > > > > delete mode 100644 > > MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c > > > > > > delete mode 100644 > > MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c > > > > > > create mode 100644 MdeModulePkg/Include/Ppi/MemoryAttribute.h > > > > > > > > > > > > > > > > > > > > > > >=20 > >