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 EF281D80220 for ; Thu, 11 Jul 2024 11:32:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4zi38WinJLriQUsb8RwpFzHP9M9QnT/fPNl0cUPd/T4=; 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=1720697544; v=1; b=pxy+LVpugsHFY9QeRz4HZZYvT2f6GE8Nx1h1uI2DKLR1+PaonEuTQCotwnf9ZgamRjAV89dC A3lp+ht/gkZwCdNl3UY1FmkaOgIyBeU7gPY7bLGFgHTyaNkPZMinsb8mlttRv795AqtW7gkhfAO d1brp6fejEwReTzhke77ygdmf3ZxPGke/9CVqvV6DKyPsPYXcduDH1EPpS3ofvemcPKvH+PLB5z qR98ahbhPlaO1hQhOntGUNjB6P2hHjXFpTr9PRw7gdblPAfG2eoMPeqFowaNNkb+AJlqrZgsd7q MU8nuGG6FlJmK+ufN6vrYksRrWDSiFHRAMgI2nNuQwaXQ== X-Received: by 127.0.0.2 with SMTP id W7LLYY7687511xVncYGvRK4o; Thu, 11 Jul 2024 04:32:23 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.9669.1720697542799042837 for ; Thu, 11 Jul 2024 04:32:23 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 6E4CB2606D3; Thu, 11 Jul 2024 13:32:20 +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 R29Z4wnw8vHP; Thu, 11 Jul 2024 13:32:18 +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 415A5260CC2; Thu, 11 Jul 2024 13:32:16 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Thu, 11 Jul 2024 13:32:00 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v5 4/6] SbsaQemu: provide cache info per core in PPTT MIME-Version: 1.0 Message-Id: <20240711-acpi65-v5-4-a30180b74964@linaro.org> References: <20240711-acpi65-v5-0-a30180b74964@linaro.org> In-Reply-To: <20240711-acpi65-v5-0-a30180b74964@linaro.org> To: devel@edk2.groups.io Cc: Xiong Yining , Marcin Juszkiewicz , Leif Lindholm , Ard Biesheuvel , Graeme Gregory , Chen Baozi , Jonathan Cameron 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, 11 Jul 2024 04:32:23 -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: l86ogIeIRuo45PTy3AoHoANSx7686176AA= 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=pxy+LVpu; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 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) 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 | 50 ++++++++++------= ---- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index 8770b2293b92..e4bdd5edbd95 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -572,8 +572,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) { @@ -617,11 +617,6 @@ AddPpttTable ( =20 ClusterOffset =3D SocketOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_P= ROCESSOR); for (ClusterIndex =3D 0; ClusterIndex < CpuTopo.Clusters; ClusterIndex= ++) { - L1DCacheOffset =3D ClusterOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCTU= RE_PROCESSOR); - L1ICacheOffset =3D L1DCacheOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCT= URE_CACHE); - L2CacheOffset =3D L1ICacheOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCT= URE_CACHE); - CoreOffset =3D L2CacheOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCTU= RE_CACHE); - // Add the Cluster PPTT structure EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR Cluster =3D SBSAQEMU_ACPI_PRO= CESSOR_HIERARCHY_NODE_STRUCTURE_INIT ( ClusterFlags, @@ -632,27 +627,16 @@ AddPpttTable ( CopyMem (New, &Cluster, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSO= R)); New +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR); =20 - // Add L1 D Cache structure - L1DCache.CacheId =3D CacheId++; - CopyMem (New, &L1DCache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE))= ; - ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L2C= acheOffset; - New +=3D siz= eof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - - // Add L1 I Cache structure - L1ICache.CacheId =3D CacheId++; - CopyMem (New, &L1ICache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE))= ; - ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L2C= acheOffset; - New +=3D siz= eof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - - // Add L2 Cache structure - L2Cache.CacheId =3D CacheId++; - CopyMem (New, &L2Cache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE)); - New +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); - + CoreOffset =3D ClusterOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_P= ROCESSOR); for (CoreIndex =3D 0; CoreIndex < CpuTopo.Cores; CoreIndex++) { UINT32 *PrivateResourcePtr; UINT32 CoreCpuId; =20 + // two UINT32s for PrivateResourcePtr data + L1DCacheOffset =3D CoreOffset + sizeof (EFI_ACPI_6_5_PPTT_STRUCTUR= E_PROCESSOR) + sizeof (UINT32) * 2; + L1ICacheOffset =3D L1DCacheOffset + sizeof (EFI_ACPI_6_5_PPTT_STRU= CTURE_CACHE); + L2CacheOffset =3D L1ICacheOffset + sizeof (EFI_ACPI_6_5_PPTT_STRU= CTURE_CACHE); + if (CpuTopo.Threads =3D=3D 1) { CoreCpuId =3D CpuId; } else { @@ -673,6 +657,23 @@ AddPpttTable ( PrivateResourcePtr[1] =3D L1ICacheOffset; New +=3D (2 * sizeof (UINT32)); =20 + // Add L1 D Cache structure + L1DCache.CacheId =3D CacheId++; + CopyMem (New, &L1DCache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE= )); + ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L= 2CacheOffset; + New +=3D s= izeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); + + // Add L1 I Cache structure + L1ICache.CacheId =3D CacheId++; + CopyMem (New, &L1ICache, sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE= )); + ((EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE *)New)->NextLevelOfCache =3D L= 2CacheOffset; + New +=3D s= izeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); + + // Add L2 Cache structure + L2Cache.CacheId =3D CacheId++; + 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 { @@ -692,7 +693,8 @@ AddPpttTable ( CoreOffset +=3D CpuTopo.Threads * sizeof (EFI_ACPI_6_5_PPTT_STR= UCTURE_PROCESSOR); } =20 - CoreOffset +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR) + s= izeof (UINT32) * 2; + CoreOffset +=3D sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_PROCESSOR) + = sizeof (UINT32) * 2; + CoreOffset +=3D 3 * sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_CACHE); } =20 ClusterOffset =3D CoreOffset; --=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 (#119898): https://edk2.groups.io/g/devel/message/119898 Mute This Topic: https://groups.io/mt/107160645/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-