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 4A245D80442 for ; Thu, 15 Feb 2024 14:17:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=z6otrnDSQorl/QDDt6b7jbVwvy/VW/rMPIcq19dGhXk=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:Organization: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=1708006633; v=1; b=LBs98Lod3LfuPHXS/y4qOtBvTtmqaH+7KePT544UnPeHBGc7k41hQM+mUbI7Ci4JDXjtWq+m 6spJcEzjkQ7E9GBj3Ec49/zb4LcMuumqOIRuH/Dz9JflWn2GcC8GPHF5oxNd3kKgHQTamk1pBnZ 9AFKWtPdmSPywVd8JxYmd2gw= X-Received: by 127.0.0.2 with SMTP id xADWYY7687511xV0LStfkfem; Thu, 15 Feb 2024 06:17:13 -0800 X-Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mx.groups.io with SMTP id smtpd.web10.14672.1708006632851010376 for ; Thu, 15 Feb 2024 06:17:13 -0800 X-Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a3da5bf7f9cso67156666b.1 for ; Thu, 15 Feb 2024 06:17:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX0SSCXBHOJIcottXzYo+C2ckr8luGSYN1DHyQOdlz47gdrRr9DUkjRcFGPDzaffxJTl462U68sz9LeLzoJLlzkhU5Egg== X-Gm-Message-State: kisseHiD4FZlx6IS8lQDAfqZx7686176AA= X-Google-Smtp-Source: AGHT+IFovy+027jNygQmg+xafwXei2mKTrz8sDunZTAecud5l1bnATQLkSFXA/AJRs34YSbETKnE/Q== X-Received: by 2002:a17:906:52d2:b0:a3d:48cd:9d15 with SMTP id w18-20020a17090652d200b00a3d48cd9d15mr1417332ejn.23.1708006631252; Thu, 15 Feb 2024 06:17:11 -0800 (PST) X-Received: from [192.168.200.206] (83.11.22.32.ipv4.supernova.orange.pl. [83.11.22.32]) by smtp.gmail.com with ESMTPSA id ti1-20020a170907c20100b00a3d90d6fca8sm566071ejc.8.2024.02.15.06.17.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Feb 2024 06:17:10 -0800 (PST) Message-ID: <408b0a68-216b-4232-ae4f-6db71924c662@linaro.org> Date: Thu, 15 Feb 2024 15:17:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH 1/1] SbsaQemu: AcpiDxe: Create SRAT table at runtime To: Xiong Yining , devel@edk2.groups.io Cc: quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, graeme@xora.org.uk, chenbaozi@phytium.com.cn References: <20240131131554.3003561-1-xiongyining1480@phytium.com.cn> <20240131131554.3003561-2-xiongyining1480@phytium.com.cn> From: "Marcin Juszkiewicz" Organization: Linaro In-Reply-To: <20240131131554.3003561-2-xiongyining1480@phytium.com.cn> 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,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=20140610 header.b=LBs98Lod; 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=linaro.org (policy=none) W dniu 31.01.2024 o 2:15 PM, Xiong Yining pisze: > Add support to create SRAT(System resource affinity table) for > sbsa platform at runtime. > > Signed-off-by: Xiong Yining > Signed-off-by: Chen Baozi > --- > .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.h | 27 ++++++ > .../Include/Library/SbsaQemuHardwareInfoLib.h | 11 +++ > .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 92 +++++++++++++++++++ > .../SbsaQemuHardwareInfoLib.c | 36 ++++++++ > 4 files changed, 166 insertions(+) > > diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.h b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.h > index 7595df4c8a2d..b8c29b803b81 100644 > --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.h > +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.h > @@ -63,4 +63,31 @@ typedef struct { > > ++#define SBSAQEMU_ACPI_GICC_AFFINITY_STRUCTURE_INIT( \ > + ProximtyDomain, ACPIProcessorUID, Flags, ClockDomain) \ s/ProximtyDomain/ProximityDomain/ please Applied it on top of 20240131120507.2829117-1-xiongyining1480@phytium.com.cn series ("get rid of DeviceTree from SbsaQemu v5" one). Code boots but only memory from the first node is listed by both EDK2 and Linux. QEMU arguments: -smp 4,sockets=4,maxcpus=4 -m 4G,slots=2,maxmem=5G -object memory-backend-ram,size=1G,id=m0 -object memory-backend-ram,size=3G,id=m1 -numa node,nodeid=0,cpus=0-1,memdev=m0 -numa node,nodeid=1,cpus=2,memdev=m1 -numa node,nodeid=2,cpus=3 EDK2 memmap: Type Start End # Pages Attributes Available 0000010000000000-000001003841AFFF 000000000003841B 000000000000000E LoaderCode 000001003841B000-00000100384FFFFF 00000000000000E5 000000000000000E RT_Code 0000010038500000-000001003857FFFF 0000000000000080 800000000000000E RT_Data 0000010038580000-000001003861FFFF 00000000000000A0 800000000000000E RT_Code 0000010038620000-000001003866FFFF 0000000000000050 800000000000000E ACPI_Recl 0000010038670000-00000100386DFFFF 0000000000000070 000000000000000E RT_Code 00000100386E0000-000001003872FFFF 0000000000000050 800000000000000E Available 0000010038730000-000001003A00DFFF 00000000000018DE 000000000000000E BS_Data 000001003A00E000-000001003A02BFFF 000000000000001E 000000000000000E Available 000001003A02C000-000001003A039FFF 000000000000000E 000000000000000E BS_Data 000001003A03A000-000001003A056FFF 000000000000001D 000000000000000E Available 000001003A057000-000001003A057FFF 0000000000000001 000000000000000E BS_Data 000001003A058000-000001003B623FFF 00000000000015CC 000000000000000E Available 000001003B624000-000001003B7D3FFF 00000000000001B0 000000000000000E BS_Code 000001003B7D4000-000001003BBFFFFF 000000000000042C 000000000000000E RT_Code 000001003BC00000-000001003BD8FFFF 0000000000000190 800000000000000E RT_Data 000001003BD90000-000001003BFDFFFF 0000000000000250 800000000000000E Available 000001003BFE0000-000001003BFFEFFF 000000000000001F 000000000000000E BS_Data 000001003BFFF000-000001003C01FFFF 0000000000000021 000000000000000E Available 000001003C020000-000001003F7D4FFF 00000000000037B5 000000000000000E BS_Data 000001003F7D5000-000001003F7F5FFF 0000000000000021 000000000000000E BS_Code 000001003F7F6000-000001003F83CFFF 0000000000000047 000000000000000E BS_Data 000001003F83D000-000001003FFD9FFF 000000000000079D 000000000000000E BS_Code 000001003FFDA000-000001003FFF7FFF 000000000000001E 000000000000000E BS_Data 000001003FFF8000-000001003FFFFFFF 0000000000000008 000000000000000E MMIO 0000000010000000-00000000106BFFFF 00000000000006C0 8000000000000001 MMIO 0000000060010000-0000000060010FFF 0000000000000001 8000000000000001 Reserved : 0 Pages (0 Bytes) LoaderCode: 229 Pages (937,984 Bytes) LoaderData: 0 Pages (0 Bytes) BS_Code : 1,169 Pages (4,788,224 Bytes) BS_Data : 7,662 Pages (31,383,552 Bytes) RT_Code : 688 Pages (2,818,048 Bytes) RT_Data : 752 Pages (3,080,192 Bytes) ACPI_Recl : 112 Pages (458,752 Bytes) ACPI_NVS : 0 Pages (0 Bytes) MMIO : 1,729 Pages (7,081,984 Bytes) MMIO_Port : 0 Pages (0 Bytes) PalCode : 0 Pages (0 Bytes) Available : 251,532 Pages (1,030,275,072 Bytes) Persistent: 0 Pages (0 Bytes) -------------- Total Memory: 1,024 MB (1,073,741,824 Bytes) SRAT table shows both memory nodes: --------------- SRAT Table --------------- Address : 0x100386DFD18 Length : 200 00000000 : 53 52 41 54 C8 00 00 00 - 03 48 4C 49 4E 41 52 4F SRAT.....HLINARO 00000010 : 53 42 53 41 51 45 4D 55 - 10 08 20 20 4C 4E 52 4F SBSAQEMU.. LNRO 00000020 : 01 00 00 00 01 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00000030 : 01 28 01 00 00 00 00 00 - 00 00 00 40 00 01 00 00 .(.........@.... 00000040 : 00 00 00 C0 00 00 00 00 - 00 00 00 00 01 00 00 00 ................ 00000050 : 00 00 00 00 00 00 00 00 - 01 28 00 00 00 00 00 00 .........(...... 00000060 : 00 00 00 00 00 01 00 00 - 00 00 00 40 00 00 00 00 ...........@.... 00000070 : 00 00 00 00 01 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00000080 : 03 12 00 00 00 00 00 00 - 00 00 01 00 00 00 00 00 ................ 00000090 : 00 00 03 12 00 00 00 00 - 01 00 00 00 01 00 00 00 ................ 000000A0 : 00 00 00 00 03 12 01 00 - 00 00 02 00 00 00 01 00 ................ 000000B0 : 00 00 00 00 00 00 03 12 - 02 00 00 00 03 00 00 00 ................ 000000C0 : 01 00 00 00 00 00 00 00 ........ Table Checksum : OK SRAT : Signature : SRAT Length : 200 Revision : 3 Checksum : 0x48 Oem ID : LINARO Oem Table ID : SBSAQEMU Oem Revision : 0x20200810 Creator ID : LNRO Creator Revision : 0x1 Reserved : 0x1 Reserved : 0x0 Memory Affinity Structure [0] : Type : 0x1 Length : 0x28 Proximity Domain : 0x1 Reserved : 0x0 Base Address Low : 0x40000000 Base Address High : 0x100 Length Low : 0xC0000000 Length High : 0x0 Reserved : 0x0 Flags : 0x1 Reserved : 0x0 Memory Affinity Structure [1] : Type : 0x1 Length : 0x28 Proximity Domain : 0x0 Reserved : 0x0 Base Address Low : 0x0 Base Address High : 0x100 Length Low : 0x40000000 Length High : 0x0 Reserved : 0x0 Flags : 0x1 Reserved : 0x0 GICC Affinity Structure [0] : Type : 0x3 Length : 0x12 Proximity Domain : 0x0 ACPI Processor UID : 0x0 Flags : 0x1 Clock Domain : 0x0 GICC Affinity Structure [1] : Type : 0x3 Length : 0x12 Proximity Domain : 0x0 ACPI Processor UID : 0x1 Flags : 0x1 Clock Domain : 0x0 GICC Affinity Structure [2] : Type : 0x3 Length : 0x12 Proximity Domain : 0x1 ACPI Processor UID : 0x2 Flags : 0x1 Clock Domain : 0x0 GICC Affinity Structure [3] : Type : 0x3 Length : 0x12 Proximity Domain : 0x2 ACPI Processor UID : 0x3 Flags : 0x1 Clock Domain : 0x0 Linux (kernel from Debian or Fedora) boots with memory from the first node only: [ 0.000000] ACPI: SPCR: console: pl011,mmio32,0x60000000,115200 [ 0.000000] ACPI: SRAT: Node 1 PXM 1 [mem 0x10040000000-0x100ffffffff] [ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x10000000000-0x1003fffffff] [ 0.000000] NUMA: NODE_DATA [mem 0x1003f6fd1c0-0x1003f713fff] [ 0.000000] NUMA: Initmem setup node 1 [] [ 0.000000] NUMA: NODE_DATA [mem 0x1003f6e6380-0x1003f6fd1bf] [ 0.000000] NUMA: NODE_DATA(1) on node 0 [ 0.000000] NUMA: Initmem setup node 2 [] [ 0.000000] NUMA: NODE_DATA [mem 0x1003f6cf540-0x1003f6e637f] [ 0.000000] NUMA: NODE_DATA(2) on node 0 [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000010000000000-0x000001003fffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Device empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000010000000000-0x00000100384fffff] [ 0.000000] node 0: [mem 0x0000010038500000-0x000001003866ffff] [ 0.000000] node 0: [mem 0x0000010038670000-0x00000100386dffff] [ 0.000000] node 0: [mem 0x00000100386e0000-0x000001003872ffff] [ 0.000000] node 0: [mem 0x0000010038730000-0x000001003bbfffff] [ 0.000000] node 0: [mem 0x000001003bc00000-0x000001003bfdffff] [ 0.000000] node 0: [mem 0x000001003bfe0000-0x000001003fffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000010000000000-0x000001003fffffff] [ 0.000000] Initmem setup node 1 as memoryless [ 0.000000] Initmem setup node 2 as memoryless [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x0 -> Node 0 [ 0.000000] ACPI: NUMA: SRAT: PXM 0 -> MPIDR 0x1 -> Node 0 [ 0.000000] ACPI: NUMA: SRAT: PXM 1 -> MPIDR 0x2 -> Node 1 [ 0.000000] ACPI: NUMA: SRAT: PXM 2 -> MPIDR 0x3 -> Node 2 [ 0.000000] percpu: Embedded 15 pages/cpu s195368 r8192 d42200 u245760 [ 0.000000] Fallback order for Node 0: 0 [ 0.000000] Fallback order for Node 1: 1 0 [ 0.000000] Fallback order for Node 2: 2 0 [ 0.000000] Built 3 zonelists, mobility grouping on. Total pages: 65280 [ 0.000000] Memory: 833824K/1048576K available (18496K kernel code, 4236K rwdata, 16112K rodata, 10560K init, 10585K bss, 149216K reserved, 65536K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=3 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115524): https://edk2.groups.io/g/devel/message/115524 Mute This Topic: https://groups.io/mt/104074353/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-