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 5A80B941CD9 for ; Tue, 29 Aug 2023 16:26:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GwyblZzPUu7CU0/B5vn8oWJHVKwd/NxUBjaVHEedIO8=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1693326393; v=1; b=jE7vSwKBE6cahZYKUKlsoRQGa/005kCcFLo2IgbU3CK07Htp0JMXysYkt/0t/h211Xs3wUF0 sRVQuJ9QA4ZtAyWnfceZR5EAN/lucEYNKouzjCxsJjdW0T8iSpSFWVORhcPVePHN+4YAiZ32oZj ltq8g4GF/m5+51k3sq4J0ISA= X-Received: by 127.0.0.2 with SMTP id O9s6YY7687511xbYtGi0MrqR; Tue, 29 Aug 2023 09:26:33 -0700 X-Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web11.1402.1693326392451030434 for ; Tue, 29 Aug 2023 09:26:32 -0700 X-Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1bf5c314a57so28173385ad.1 for ; Tue, 29 Aug 2023 09:26:32 -0700 (PDT) X-Gm-Message-State: i1EoPYQO1zleD6JPKIhnCH76x7686176AA= X-Google-Smtp-Source: AGHT+IFON/sBy3O9hyaYReFnAfqJqC0//AideDlavefJdgSCVpEtG1rhUypw08zYIW1dFIL7wm6iWg== X-Received: by 2002:a17:903:25d4:b0:1bb:94ed:20a with SMTP id jc20-20020a17090325d400b001bb94ed020amr23212920plb.24.1693326391719; Tue, 29 Aug 2023 09:26:31 -0700 (PDT) X-Received: from [192.168.0.233] ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id u14-20020a170902e5ce00b001bd41b70b60sm9588218plf.45.2023.08.29.09.26.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Aug 2023 09:26:31 -0700 (PDT) Message-ID: <80414988-a569-4c5e-a250-48c9e6cc7c4a@gmail.com> Date: Tue, 29 Aug 2023 09:26:30 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v2 20/25] OvmfPkg: Enable Choosing Memory Protection Profile via QemuCfg To: Gerd Hoffmann Cc: devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Rebecca Cran , Peter Grehan , =?UTF-8?Q?Corvin_K=C3=B6hne?= References: <20230818223159.1073-1-taylor.d.beebe@gmail.com> <20230818223159.1073-21-taylor.d.beebe@gmail.com> From: "Taylor Beebe" In-Reply-To: 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,taylor.d.beebe@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=jE7vSwKB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 8/29/23 4:17 AM, Gerd Hoffmann wrote: > Hi, > >> - SetDxeMemoryProtectionSettings (&DxeSettings, DxeMemoryProtectionSett= ingsPcd); >> - SetMmMemoryProtectionSettings (&MmSettings, MmMemoryProtectionSetting= sPcd); >> + Status =3D QemuFwCfgParseString (DXE_MEMORY_PROTECTION_PROFILE_FWCFG_= FILE, &StringSize, String); >> + if (!EFI_ERROR (Status)) { >> + DEBUG ((DEBUG_INFO, "Setting DXE Memory Protection Profile: %a\n", = String)); >> + if (AsciiStriCmp (String, "debug") =3D=3D 0) { >> + DxeSettings =3D DxeMemoryProtectionProfiles[DxeMemoryProtectionSe= ttingsDebug].Settings; > I'd suggest to just loop over DxeMemoryProtectionProfiles and compare > String with .Name, so we don't have to touch this in case we add or > remove profiles. Sounds good -- will update in v3 >> + DxeSettings =3D DxeMemoryProtectionProfiles[DxeMemoryProtectionSett= ingsDebug].Settings; > I'd prefer to use DxeMemoryProtectionSettingsPcd by default. The PCDs are still removed in this patch series. The PCD profile is=20 included in the earlier patches of this series to ensure the memory=20 protections are consistent as each patch transitions the references to=20 use the library interface. I opted to to remove the PCDs for a couple of=20 reasons: 1. The PCDs are the legacy interface, and keeping legacy interfaces=20 around is sometimes necessary for compatibility but not in this case.=20 Keeping the PCDs would disrupt maintainability, clarity, and=20 extensibility of memory protections. I am also not confident the legacy=20 interface would ever be removed in the future. 2. Removing the PCDs will cause a build failure for platforms which=20 reference them. This outcome is desirable in this case because action=20 needs to be taken to ensure the platform protection meets expectations=20 with this new system. If the PCDs were kept, platform creators may try=20 updating the PCDs and be confused when the changes are not reflected in=20 the state of the system because the PCD profile is not in use. This=20 nuance helps identify a confusing interface. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108098): https://edk2.groups.io/g/devel/message/108098 Mute This Topic: https://groups.io/mt/100830924/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-