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 5208B941CB5 for ; Thu, 14 Mar 2024 15:13:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=SHeNdq/Zz1Zcl/ZLnfAIxYQ7ou/G+7cLNUAjOvg255k=; 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=1710429199; v=1; b=UEYU3lVKCpy9WISMPgAIN/5r9wkZ3i5WGUoJfqxz3UEHzoAerh3K8yKqg8Kfwqn9y0GtBBHh p2wmkn8ymztvYwAy7iKnI750u2fXFHePpvaqztenK629uCpPvipE5vNZJTVuEvNC+P+Ry8kuU8c UAZoX4H18Y1SOdhM7mXmxJ/ApjJzUhQCuUwNa6YfUSUbqyZCiZd6y00v4ylqE3eMbNfWIbA4ZKQ jRgqfK1vA8n8+gIaBP8AGm5sPZHd1b+vGwKngUTPCAMHkka/9hpcAfUnenU14RBlGb0M8UzJw/Z w+f9grzCnwu+G0CMD7/tXoNQaNY5LrU4zWYt6Kd/0t6Aw== X-Received: by 127.0.0.2 with SMTP id 2D9IYY7687511xgO6XcqOClv; Thu, 14 Mar 2024 08:13:19 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.15323.1710429198928377151 for ; Thu, 14 Mar 2024 08:13:19 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 80FBD614FA for ; Thu, 14 Mar 2024 15:13:18 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32045C433F1 for ; Thu, 14 Mar 2024 15:13:18 +0000 (UTC) X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-513cfc93f4eso1111545e87.3 for ; Thu, 14 Mar 2024 08:13:18 -0700 (PDT) X-Gm-Message-State: 7wplTEcQ9VpgmK5uJz0YdJsox7686176AA= X-Google-Smtp-Source: AGHT+IF4qpiEDMCbv/kaARnYLvN55qUNVPGlXhITm9LsOg0rvbAUNCVY3GHFL9TvWZsFbb/Yyiq398j9y10WGhkeXBw= X-Received: by 2002:a05:6512:3c9b:b0:513:d3b2:1c34 with SMTP id h27-20020a0565123c9b00b00513d3b21c34mr1346798lfv.49.1710429196560; Thu, 14 Mar 2024 08:13:16 -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: <20240306-no-dt-for-cpu-v6-2-acd8727a1b59@linaro.org> From: "Ard Biesheuvel" Date: Thu, 14 Mar 2024 16:13:05 +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: Thu, 14 Mar 2024 08:13:19 -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=UEYU3lVK; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 Wed, 6 Mar 2024 at 12:42, Marcin Juszkiewicz wrote: > > We read it once and store in Pcd for future use. > > Signed-off-by: Marcin Juszkiewicz > --- > .../SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf | 4 +++- > .../SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 9 +++++---- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf > index 19534b7a274a..9752694a432b 100644 > --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf > +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf > @@ -1,7 +1,7 @@ > ## @file > # This driver effectuates SbsaQemu platform configuration settings > # > -# Copyright (c) 2019, Linaro Ltd. All rights reserved. > +# Copyright (c) Linaro Ltd. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -32,6 +32,7 @@ [LibraryClasses] > PcdLib > DebugLib > NonDiscoverableDeviceRegistrationLib > + SbsaQemuHardwareInfoLib > UefiDriverEntryPoint > > [Pcd] > @@ -46,6 +47,7 @@ [Pcd] > gArmTokenSpaceGuid.PcdGicDistributorBase > gArmTokenSpaceGuid.PcdGicRedistributorsBase > gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase > + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount > > > [Depex] 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. This is why PCDs suck for dynamic information, to be honest. Much better to use a protocol (DEPEXes declare dependencies on protocols, so a driver will never run before the protocols it depends on have been made available) Given that this is intended as reference code, I think it is very important to get this right. > diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c > index 4ebbe7c93a19..14e1ec7eab29 100644 > --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c > +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c > @@ -1,7 +1,7 @@ > /** @file > -* FDT client protocol driver for qemu,mach-virt-ahci DT node > +* SbsaQemu Platform Initialization > * > -* Copyright (c) 2019, Linaro Ltd. All rights reserved. > +* Copyright (c) Linaro Ltd. All rights reserved. > * > * SPDX-License-Identifier: BSD-2-Clause-Patent > * > @@ -12,13 +12,12 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > > -#include > - > EFI_STATUS > EFIAPI > InitializeSbsaQemuPlatformDxe ( > @@ -123,5 +122,7 @@ InitializeSbsaQemuPlatformDxe ( > } > } > > + SbsaQemuGetCpuCount (); > + > return EFI_SUCCESS; > } > > -- > 2.44.0 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116766): https://edk2.groups.io/g/devel/message/116766 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] -=-=-=-=-=-=-=-=-=-=-=-