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 21D0FD811D1 for ; Tue, 19 Mar 2024 11:03:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EPtbJ3AL2PA83LpSqiCRLk8XqsE0PFIYvqr4x+VS7F0=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1710846187; v=1; b=plhqfWeNWibLT3jE5nfJcauYp/jqaOJHjgQPdnCs6JCnsTq9IRrRNUthMdtBdP9f7tXRLq/t 7B1T3imhAhcVmxepbME0SA6taTtQBinRMqYnN7ZM7Uad97pnEvAVBLVKUutZ5knXokr35uNZgik JNLL1ksbHCUiQRtUuFMxU6LKZWxvw8HwYeR3Snuct6cV3BRVx0ZOQPy1yZac42HTAussqL5STBt f2sjMjycMzw9/kP+DY9gchtZL5z+B8Ct2Qeq2Ml7A8qJZSlLQtCtei5boVD1jmyP8Leqqn6w/Lh h05KWAt/dHGgckmL6PgfUMwvrhvV2YYHFz7/UJWKtuDBg== X-Received: by 127.0.0.2 with SMTP id oCZKYY7687511x9xuu0qJvIX; Tue, 19 Mar 2024 04:03:07 -0700 X-Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web10.12519.1710846186750749990 for ; Tue, 19 Mar 2024 04:03:07 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 9A7A7CE0A36 for ; Tue, 19 Mar 2024 11:03:03 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD988C43390 for ; Tue, 19 Mar 2024 11:03:02 +0000 (UTC) X-Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d48f03a8bbso32297331fa.0 for ; Tue, 19 Mar 2024 04:03:02 -0700 (PDT) X-Gm-Message-State: M7qTr1pIC2g0b6bKeDSt9lNox7686176AA= X-Google-Smtp-Source: AGHT+IGmZ1sB+PsrOdyUNcfD1ENwlBfjE0uwccdaZZPnHtyEPe/jq80saNg3r6l9OvLTactAGXJ0Z2pYKP93iv4c5fE= X-Received: by 2002:a05:651c:b06:b0:2d4:8446:ef49 with SMTP id b6-20020a05651c0b0600b002d48446ef49mr1028453ljr.8.1710846181140; Tue, 19 Mar 2024 04:03:01 -0700 (PDT) MIME-Version: 1.0 References: <20240306-no-dt-for-cpu-v6-0-acd8727a1b59@linaro.org> <20240306-no-dt-for-cpu-v6-2-acd8727a1b59@linaro.org> In-Reply-To: From: "Ard Biesheuvel" Date: Tue, 19 Mar 2024 12:02:49 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH edk2-platforms v6 2/7] Platform/SbsaQemu: read amount of cpus during init To: Marcin Juszkiewicz Cc: devel@edk2.groups.io, Leif Lindholm , Ard Biesheuvel , Graeme Gregory , Xiong Yining , Chen Baozi 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 Resent-Date: Tue, 19 Mar 2024 04:03:07 -0700 Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=plhqfWeN; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) On Tue, 19 Mar 2024 at 11:25, Marcin Juszkiewicz wrote: > > W dniu 15.03.2024 o 12:49, Marcin Juszkiewicz pisze: > > W dniu 14.03.2024 o 16:13, Ard Biesheuvel pisze: > > >> How is it guaranteed that other components will only see the correct > >> core count? DXE dispatch is ordered using a dependency graph, so all > >> users of this PCD should never execute before this driver. > > > > SbsaQemuPlatformDxe is a DXE, right? So it is called on platform init. > > > > At the end of initialization it calls SbsaQemuGetCpuCount() from > > SbsaQemuHardwareInfoLib to SET this PCD. It does not use it during > > platform init cause it does not require this information. But calls > > function to make sure that amount of cpus is known to whatever will be > > called later. > > > > Sure, maybe SbsaQemuHardwareInfoLib should be something else (DXE, > > Protocol or other EDK2 magic thing) but it is set of functions to be > > called from other places of EDK2. > > EDK2 starts and one of the first DXE called is SbsaQemuPlatformDxe one: > How is this guaranteed? DXE are generally dispatched in the order in which they appear in the FDF, but only if all DEPEX dependencies are satisfied. DEPEXes are compiled from the DXE .inf along with all its [recursive] library dependencies, so upstream changes could affect the DEPEX of SbsaQemuPlatformDxe, and therefore where it appears in the dispatch order. None of the below is relevant, really. If you want to rely on dynamic PCDs in DXE, the only safe way to set them is from the PEI phase. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116891): https://edk2.groups.io/g/devel/message/116891 Mute This Topic: https://groups.io/mt/104763764/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-