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 43682D800F5 for ; Wed, 10 Jul 2024 17:52:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JMPEVehov4uRJwwWjx2B+jlE9OVeeC7I4s1IKOilmlk=; 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=1720633973; v=1; b=2RSadEQf5/iDqwbFw5Ukg16yV39rJ+a7CH2/Q6/8Zx1HtZlAeNfoBFl2IVUK5AOmMRMEG/ls /FYMtAKPuU/nCravdxtjHIsA8vCTI9dXz3uIHT2ZaMDz+w7Lzo6AEv9r1SIMR5MU8va9Jk9UEgD hq8UUFG9N9q+HQlSgFlJIfqsIGNTRSkVUaZPIujQNpxMCxs5ib7rojcj2iz4aTUDrN3bWX/aqiR JWXh5jsALo2nQ1L0zHnDa+rSWQWswkuLVyuzrJhf7V07RGjvBmfVHcypZwz6kHIyN4Zz9qt+8+u EcZGF0peWweShFprFUabG6iF0fueGwGgc4X4p3FZVOFmg== X-Received: by 127.0.0.2 with SMTP id 9vpEYY7687511xGEeZdtKTrM; Wed, 10 Jul 2024 10:52:51 -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.1393.1720633966172355119 for ; Wed, 10 Jul 2024 10:52:46 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EBDC22619B7; Wed, 10 Jul 2024 19:52:43 +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 wNODddrrZ53t; Wed, 10 Jul 2024 19:52:42 +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 52BA52619AA; Wed, 10 Jul 2024 19:52:41 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 10 Jul 2024 19:52:22 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v4 4/6] SbsaQemu: provide cache info per core in PPTT MIME-Version: 1.0 Message-Id: <20240710-acpi65-v4-4-bc32224e4be4@linaro.org> References: <20240710-acpi65-v4-0-bc32224e4be4@linaro.org> In-Reply-To: <20240710-acpi65-v4-0-bc32224e4be4@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: Wed, 10 Jul 2024 10:52:46 -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: VgnG2A25Q7gUCcqaTSIOx4wFx7686176AA= 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=2RSadEQf; 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 (#119873): https://edk2.groups.io/g/devel/message/119873 Mute This Topic: https://groups.io/mt/107147591/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-