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 8A9F99414AE for ; Tue, 19 Mar 2024 10:25:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=NxTgoGmnWWb9eDMaUHbRqEF0qUdp24s0HgyUakTwex4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:From:To:Cc:References:Organization:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1710843919; v=1; b=om4dTpCF57IZ1TfdA/ciPJGDXkqpXGnC43L9rdRDOK/vgy4Iwj3g4tSNACRIVM6f1CChMI+h ylkhFqsvSa7BYU72b/N+W23eOw3JcDQJWsmQoEBfQGwkKkd9EVQqC4MaJQISP9kiQ9VNCmXLlC0 61VQaGpSdDax5iNwGDgx2jN0xSZtgQyWGeLhsSgE/ll+WQbCNO6QPVb43ettjku3JBeyBt8DtvD SgdZoKK/SiE0HhG/Dtolt+9GUIiWGvctzEFddBsZQi0pA88nHzSkZ12McWHNitDiw8Lsi/4Q+Dq wB2/nw+/vcAiCqFdvxKqWqc9SXhHXaKvThXj7a99p/NBQ== X-Received: by 127.0.0.2 with SMTP id gRRiYY7687511x5gxlRfqatM; Tue, 19 Mar 2024 03:25:19 -0700 X-Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.web10.11939.1710843918353557767 for ; Tue, 19 Mar 2024 03:25:18 -0700 X-Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a4644bde1d4so701043966b.3 for ; Tue, 19 Mar 2024 03:25:18 -0700 (PDT) X-Gm-Message-State: 8nTmKvjO7aVsanCmvi4zuPj5x7686176AA= X-Google-Smtp-Source: AGHT+IHYfKVnh5GuaaHnIw7cQZDyaFGMyxA3YXbtqUb+ZV3/FnYhKRYOfvnbQXD3hBeL1PbFCHj74w== X-Received: by 2002:a17:906:348a:b0:a46:d591:828c with SMTP id g10-20020a170906348a00b00a46d591828cmr1390542ejb.49.1710843916776; Tue, 19 Mar 2024 03:25:16 -0700 (PDT) X-Received: from [192.168.200.106] (83.11.22.169.ipv4.supernova.orange.pl. [83.11.22.169]) by smtp.gmail.com with ESMTPSA id ak8-20020a170906888800b00a46b4544da2sm2918896ejc.125.2024.03.19.03.25.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Mar 2024 03:25:16 -0700 (PDT) Message-ID: Date: Tue, 19 Mar 2024 11:25:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH edk2-platforms v6 2/7] Platform/SbsaQemu: read amount of cpus during init From: "Marcin Juszkiewicz" To: Ard Biesheuvel Cc: devel@edk2.groups.io, Leif Lindholm , Ard Biesheuvel , Graeme Gregory , Xiong Yining , Chen Baozi References: <20240306-no-dt-for-cpu-v6-0-acd8727a1b59@linaro.org> <20240306-no-dt-for-cpu-v6-2-acd8727a1b59@linaro.org> Organization: Linaro 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 Resent-Date: Tue, 19 Mar 2024 03:25:18 -0700 Reply-To: devel@edk2.groups.io,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Language: pl-PL, en-GB, en-HK Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=om4dTpCF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linaro.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 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: InitializeSbsaQemuPlatformDxe: InitializeSbsaQemuPlatformDxe called InitializeSbsaQemuPlatformDxe: Got platform AHCI 60100000 65536 INFO: SMC call: (0xc2000001) (function id: 1) INFO: Platform version requested Platform version: 0.3 INFO: SMC call: (0xc2000064) (function id: 100) GICD base: 0x40060000 GICR base: 0x40080000 INFO: SMC call: (0xc2000065) (function id: 101) GICI base: 0x44081000 InitializeSbsaQemuPlatformDxe: Got platform XHCI 60110000 65536 INFO: SMC call: (0xc20000c8) (function id: 200) We have 4 cpus. It does: - AHCI init - Platform version - GIC addresses - GIC ITS address - XHCI init - CPU count Then system boot continues with gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount being set to proper value. If replacing use of Pcd with calls to SbsaQemuGetCpuCount() look better then I can change code to make it happen. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116890): https://edk2.groups.io/g/devel/message/116890 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] -=-=-=-=-=-=-=-=-=-=-=-