From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3D178AC1293 for ; Tue, 2 Jul 2024 16:33:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+vHyejJ3/8P33mjyVsHqmdwNogMqPEPnrj2FQo589W8=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1719938009; v=1; b=LM9lnDLa36SfE3CqIU1dalw4TWzP5Z7szfK+yRtchUUE8YgjtLfT6nYkHGAhRZxdVyq3oylB 7wEqpEXE+nzlj0Ff3O2pwPXaG9FK0aAQlZeTz+3MaelbDuS4dkDSYZ7oLaSM9Vn+emWCPnmiF3D Ev5gqxzugmAC28Wa/t7aE/ceXSz1Yi8hPXz8TPdeXi7TPVaFDhMVqj1m6dG2SJwtJP8HGQHggZc pYjg5zdp/gexRVIG9QRzRFGC6oUnnW830Cf03+ElIBCng0IM9JlIva0TwCvZIuqT6HPWiIevzPy WB5q380N0kMgtIfQYftz8+g0abPnx5u6YzE3gleUVkvkA== X-Received: by 127.0.0.2 with SMTP id wAstYY7687511x2gXOJ0geZj; Tue, 02 Jul 2024 09:33:28 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web10.29040.1719938007880203031 for ; Tue, 02 Jul 2024 09:33:28 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id CFA64260988; Tue, 2 Jul 2024 18:33:25 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id YJ6ft-x3OL0O; Tue, 2 Jul 2024 18:33:23 +0200 (CEST) X-Received: from applejack.lan (83.8.74.165.ipv4.supernova.orange.pl [83.8.74.165]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id C6EF52602E9; Tue, 2 Jul 2024 18:33:22 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Tue, 02 Jul 2024 18:33:04 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v2 3/3] SbsaQemu: provide cache info per core in PPTT MIME-Version: 1.0 Message-Id: <20240702-acpi65-v2-3-3cb18a892221@linaro.org> References: <20240702-acpi65-v2-0-3cb18a892221@linaro.org> In-Reply-To: <20240702-acpi65-v2-0-3cb18a892221@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Graeme Gregory , Chen Baozi , Xiong Yining , Marcin Juszkiewicz 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, 02 Jul 2024 09:33:28 -0700 Resent-From: marcin.juszkiewicz@linaro.org Reply-To: devel@edk2.groups.io,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 8vnXSDzS4ufWsZPtdN4ZEkvxx7686176AA= 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=20240206 header.b=LM9lnDLa; 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 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io During Linaro Connect MAD24 I was asked to move cache information from being 'per cluster' to be 'per core'. This is a move for implementing MPAM support. So topology moves from: Socket -> Clusters -> Cores + Caches -> Threads (if exist) to: Socket -> Clusters -> Cores -> Caches + Threads (if exist) Cache sizes are still 32+32+512KB (L1d, L1i, L2) as QEMU does not implement them at all so we can tell whatever. Signed-off-by: Marcin Juszkiewicz --- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 46 ++++++++++------= ---- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index 4c275faf7de6..02c84a16a4bc 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -561,8 +561,8 @@ AddPpttTable ( TableSize =3D sizeof (EFI_ACPI_DESCRIPTION_HEADER) + CpuTopo.Sockets * (sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCE= SSOR) + CpuTopo.Clusters * (sizeof (EFI_ACPI_6_5_= PPTT_STRUCTURE_PROCESSOR) + - sizeof (EFI_ACPI_6_5_= PPTT_STRUCTURE_CACHE) * 3 + CpuTopo.Cores * (size= of (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR) + + size= of (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE) * 3 + size= of (UINT32) * 2))); =20 if (CpuTopo.Threads > 1) { @@ -604,37 +604,21 @@ AddPpttTable ( =20 ClusterIndex =3D SocketIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PRO= CESSOR); for (ClusterNum =3D 0; ClusterNum < CpuTopo.Clusters; ClusterNum++) { - L1DCacheIndex =3D ClusterIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE= _PROCESSOR); - L1ICacheIndex =3D L1DCacheIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTUR= E_CACHE); - L2CacheIndex =3D L1ICacheIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTUR= E_CACHE); - CoreIndex =3D L2CacheIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE= _CACHE); + CoreIndex =3D ClusterIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PRO= CESSOR); =20 // Add the Cluster PPTT structure EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR Cluster =3D SBSAQEMU_ACPI_PRO= CESSOR_HIERARCHY_NODE_STRUCTURE_INIT (ClusterFlags, SocketIndex, 0, 0); CopyMem (New, &Cluster, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSO= R)); New +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR); =20 - L1DCache.CacheId =3D CacheId++; - // Add L1 D Cache structure - CopyMem (New, &L1DCache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE))= ; - ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L2C= acheIndex; - New +=3D siz= eof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - - L1ICache.CacheId =3D CacheId++; - // Add L1 I Cache structure - CopyMem (New, &L1ICache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE))= ; - ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L2C= acheIndex; - New +=3D siz= eof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - - L2Cache.CacheId =3D CacheId++; - // Add L2 Cache structure - CopyMem (New, &L2Cache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE)); - New +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - for (CoreNum =3D 0; CoreNum < CpuTopo.Cores; CoreNum++) { UINT32 *PrivateResourcePtr; UINT32 CoreCpuId; =20 + L1DCacheIndex =3D CoreIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_= PROCESSOR); + L1ICacheIndex =3D L1DCacheIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCT= URE_CACHE); + L2CacheIndex =3D L1ICacheIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCT= URE_CACHE); + if (CpuTopo.Threads =3D=3D 1) { CoreCpuId =3D CpuId; } else { @@ -650,6 +634,23 @@ AddPpttTable ( PrivateResourcePtr[1] =3D L1ICacheIndex; New +=3D (2 * sizeof (UINT32)); =20 + L1DCache.CacheId =3D CacheId++; + // Add L1 D Cache structure + CopyMem (New, &L1DCache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE= )); + ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L= 2CacheIndex; + New +=3D s= izeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); + + L1ICache.CacheId =3D CacheId++; + // Add L1 I Cache structure + CopyMem (New, &L1ICache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE= )); + ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L= 2CacheIndex; + New +=3D s= izeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); + + L2Cache.CacheId =3D CacheId++; + // Add L2 Cache structure + CopyMem (New, &L2Cache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE)= ); + New +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); + if (CpuTopo.Threads =3D=3D 1) { CpuId++; } else { @@ -665,6 +666,7 @@ AddPpttTable ( } =20 CoreIndex +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR) + si= zeof (UINT32) * 2; + CoreIndex +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE) * 3; } =20 ClusterIndex =3D CoreIndex; --=20 2.45.2 -=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 (#119765): https://edk2.groups.io/g/devel/message/119765 Mute This Topic: https://groups.io/mt/107003195/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-