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 EC4F078003C for ; Fri, 8 Dec 2023 14:49:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UehxIGaEwCJ+DOe9fddebf+5Af52qRzpm62KxF7ZpsY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: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=1702046981; v=1; b=MPbf5gsed0Qys3QQFzO+CB7Uygrv5KZJ67bz8P2F4sp58JJ6U117++Mgvtmg4rzSRho93HVR bffCyg8A1QeOHU35Urw8CcXJGRhv910eqtFIT2988NUMKkmfWqd4AwEdXSBBPvNwHikNXo8dzAi ZBAQSeJVY4ZJ0V2ht1y1QcSg= X-Received: by 127.0.0.2 with SMTP id y7rkYY7687511xbAAZz9Zn3M; Fri, 08 Dec 2023 06:49:41 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.37174.1702046980849910548 for ; Fri, 08 Dec 2023 06:49:41 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113--iROBbixPsymBS9GMSFa1w-1; Fri, 08 Dec 2023 09:49:34 -0500 X-MC-Unique: -iROBbixPsymBS9GMSFa1w-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 314B53C0C882; Fri, 8 Dec 2023 14:49:34 +0000 (UTC) X-Received: from [10.39.193.124] (unknown [10.39.193.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4C151C060AF; Fri, 8 Dec 2023 14:49:32 +0000 (UTC) Message-ID: <606aadcb-1ed1-e486-5ec5-04c7d9930251@redhat.com> Date: Fri, 8 Dec 2023 15:49:31 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2] ArmVirt: Allow memory attributes protocol to be disabled on first boot From: "Laszlo Ersek" To: devel@edk2.groups.io, ardb@kernel.org Cc: Gerd Hoffmann , Oliver Steffen , Alexander Graf , Oliver Smith-Denny , Taylor Beebe , Peter Jones , Leif Lindholm References: <20231207100603.2654084-1-ardb@google.com> In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: GGFl6ffXyZKWnCFAMgmvzr5nx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=MPbf5gse; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.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 12/8/23 15:34, Laszlo Ersek wrote: > (7) Tying back to my point (4) -- I understand this is a hack anyway, > but I'm still uncomfortable with platform BDS uninstalling a protocol > that is owned by / provided by the CPU driver. Feels like a significant > layering violation. >=20 > Can we modify the CPU driver instead, to listen to a new event group, > upon which being signaled, the CPU driver would uninstall the protocol > (and close the listening event)? >=20 > This PlatformBootManagerLib instance would act more or less the same > (I'd suggest signaling the event group from within AfterConsole, in case > the PCD default and/or the fw_cfg knob dictated that), but the protocol > uninstallation would occur in "ArmPkg/Drivers/CpuDxe". >=20 > In more technical terms, the layering violation IMO is that we mess with > CpuDxe's "mCpuHandle" and "mMemoryAttribute" static variables from > within BDS. Adding the new event group requires more boiler-plate code > for sure, but there's a small code-size benefit as well: we'd not have > to look up either the handle (with LocateHandle) or the protocol > interface (with HandleProtocol), as CpuDxe inherently knows those > (mCpuHandle, mMemoryAttribute). Or maybe avoid modifying PlatformBootManagerLib completely; instead, move the logic into CpuDxe, into a ready-to-boot event handler? At that time, variable services should be available to CpuDxe as well (for the BootOrder UEFI var check). Laszlo -=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 (#112234): https://edk2.groups.io/g/devel/message/112234 Mute This Topic: https://groups.io/mt/103031504/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-