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 3F29E7803D1 for ; Tue, 9 Jul 2024 10:47:50 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=80A27U1b7Ei2VSO9tFKzbqDAmevN6QzRNX9xpVrWj7g=; 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=1720522070; v=1; b=fWfkN5DY8Fs0Lh9iSxtcFCWJVrJChhL7CWSnlpG9I8xIpz+OvZGha1KQBywplmRa1BPHWHxt WQF30FTwK1PZjElmfKNEppLyOy4fxMvMrnLJxwI5jJPeLzlXtLszDy3huphbtR2uWDIAldqZLM+ 51Aau8bd3ZO1f/zUQ0oetVp045jO6nhOV+5gwmWprKY5i2ZYyDasTeEf89gy/A768Sxv+OlLJLC 5NLhSIu+l8KWTUA88eU6pPLfY4p4snsVptRBC6IuoUESsP+YM2iASOK33t+1fDf9AdAAFBeaTwm kp5cH5F1pqI2AhLNmpfOuzXADO6gGHQ6HexlynXPelkMg== X-Received: by 127.0.0.2 with SMTP id UT8hYY7687511xWfSAbcNVYx; Tue, 09 Jul 2024 03:47:48 -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.10030.1720522063115998233 for ; Tue, 09 Jul 2024 03:47:43 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EE7F5260837; Tue, 9 Jul 2024 12:47:40 +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 z9_N9ig9gJyK; Tue, 9 Jul 2024 12:47:38 +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 406FD260ACD; Tue, 9 Jul 2024 12:47:36 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Tue, 09 Jul 2024 12:47:09 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v3 4/5] SbsaQemu: provide cache info per core in PPTT MIME-Version: 1.0 Message-Id: <20240709-acpi65-v3-4-ee93ba536fcf@linaro.org> References: <20240709-acpi65-v3-0-ee93ba536fcf@linaro.org> In-Reply-To: <20240709-acpi65-v3-0-ee93ba536fcf@linaro.org> To: devel@edk2.groups.io Cc: Xiong Yining , Marcin Juszkiewicz , Leif Lindholm , Ard Biesheuvel , Graeme Gregory , 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: Tue, 09 Jul 2024 03:47:43 -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: qvUMQOnivmiaFve5FePACbDBx7686176AA= 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=fWfkN5DY; 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 | 47 +++++++++++-----= ---- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index cf0102d11f1f..a7a9664abdcb 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -562,8 +562,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) { @@ -609,10 +609,7 @@ 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 ( @@ -624,27 +621,15 @@ 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= acheIndex; - 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= acheIndex; - 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); - for (CoreNum =3D 0; CoreNum < CpuTopo.Cores; CoreNum++) { UINT32 *PrivateResourcePtr; UINT32 CoreCpuId; =20 + // two UINT32s for PrivateResourcePtr data + L1DCacheIndex =3D CoreIndex + sizeof (EFI_ACPI_6_5_PPTT_STRUCTURE_= PROCESSOR) + sizeof (UINT32) * 2; + 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 { @@ -665,6 +650,23 @@ AddPpttTable ( PrivateResourcePtr[1] =3D L1ICacheIndex; 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= 2CacheIndex; + 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= 2CacheIndex; + 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 { @@ -685,6 +687,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 (#119834): https://edk2.groups.io/g/devel/message/119834 Mute This Topic: https://groups.io/mt/107120146/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-