From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web12.2549.1632536286207133826 for ; Fri, 24 Sep 2021 19:18:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=RTCE8vvl; spf=pass (domain: nuviainc.com, ip: 209.85.214.169, mailfrom: rebecca@nuviainc.com) Received: by mail-pl1-f169.google.com with SMTP id j14so7792857plx.4 for ; Fri, 24 Sep 2021 19:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AVQ87NHhndcrwsh/H76nG9/vgRM1/rIlpT5nFUhW85c=; b=RTCE8vvlHe1qHBFh9pdMb4VTv8gQWAYZgMdrS/my9sOphaaCVryyf2+uHeGi7K4Qi+ LvKSsmiyDwYYaC7n/Ir5HWB+Pz+pcZ2Wn5BI3ZYVtr4f7ZA3XOmBZVV+Vi/X0zkEdnRO WDtM4/v+lpI58js0Fv3AGA7xQDtlAAXmyC9z6tj2qYc2RHROl3Dx6SNN2usNgx8zu/nd Y6k9YzFiwHtDi+cUouC8OhIksWMmkcsoSADHU0OYMXTypmQRh0DQv//rKfFCHgsbMYI8 ZD7XYYlspVb0ugt75DFZ08YMlXiBWbnqXhcdGII3tHOu22H2zUOTQIPtQ3DaLoc69zxj fdnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AVQ87NHhndcrwsh/H76nG9/vgRM1/rIlpT5nFUhW85c=; b=J9aHZfgmiYdnA0sfC19WjEtMUmL2TCf9UUkhWTB1cLx4qRr/47+nLmw4+1k8v8xasX is6/IQNkOyy4BFAJvYmXHJWl7SnEVOSZsObSwSsNMFBj+ig7E0pdOr8DY0r2NaC4cdmo rvRaGS23Ab9dpiJ388G70noEojbhw+Hz3GVgcfAek/lt3auIamkLjMoukQXdrS3QGImQ TkAHWDsjZmmyQ8wrYgkr4BV2qBdaCs00f+wbvp1DYPte4mq8Yx/IXXaI0HR6au485ZSd H9X9hE7rGEJjvU94S1MtRVZ8N6mjUM9o98OZQD7OMkric4zFxj9/XNfIlcxLI10PPkQ6 4xqA== X-Gm-Message-State: AOAM532RwRJ9iIcRCSsqBI+e/efdmDF4xkNgqALYzJR/2shxI2ToyBhX y7KZ6tngUlfA4q7lMwdg+eLvmFb+jlGr7j38MtPjDDp8S+MXEHyJUc1K917UrYkVWLCiLzHy55a UWLhbzIDM+MnVRLqyiXb4BZZwrkHYPOmd8iiBRVw6fPjqPwkpqFRndGs/Af2jmFKDCEj+4I7x X-Google-Smtp-Source: ABdhPJzu2n0CufD/iY3/ykb+TPpPDc/Vao0QetT5KGzGIM0yEB/AfMzzTXor+Xr+0nkBo0rCq3nM/g== X-Received: by 2002:a17:903:228b:b0:13c:94f8:d723 with SMTP id b11-20020a170903228b00b0013c94f8d723mr12035832plh.12.1632536285367; Fri, 24 Sep 2021 19:18:05 -0700 (PDT) Return-Path: Received: from linbox.int.bluestop.org.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id q11sm10562111pfn.91.2021.09.24.19.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 19:18:04 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Gerd Hoffmann , rfc@edk2.groups.io Cc: Rebecca Cran Subject: [RFC] [PATCH 0/2] Proposal to add EFI_MP_SERVICES_PROTOCOL support for AARCH64 Date: Fri, 24 Sep 2021 20:17:50 -0600 Message-Id: <20210925021752.20678-1-rebecca@nuviainc.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit I'd like to propose adding EFI_MP_SERVICES_PROTOCOL support for AARCH64 systems. I've attached two patches to implement support for it in the DXE phase, based on code in EmulatorPkg and UefiCpuPkg. It's added under ArmPkg for now, but longer term it should probably be moved into UefiCpuPkg. Patch 1/2 is the start of addressing the issue that the Aff0 field of the MPIDR is no longer guaranteed to be the core, and should be referred to in a more generic way: for example it could be the thread, with Aff1 being the core and Aff2 the cluster. Clearly much more work is needed to fully remove that assumption. Patch 2/2 implements the EFI_MP_SERVICES_PROTOCOL for DXE in Library/MpInitLib. CpuDxe initializes the MP support, and as a result gains a dependency on MpInitLib. ArmVirt.dsc.inc needs updated to add the new library, as will all AARCH64 platforms. I sent out a patch for MdeModulePkg last week to add a corresponding test application, MpServicesTest (see https://edk2.groups.io/g/devel/message/80878). Rebecca Cran (2): ArmPkg: Replace CoreId and ClusterId with Mpidr in ARM_CORE_INFO struct ArmPkg: Add Library/MpInitLib to support EFI_MP_SERVICES_PROTOCOL ArmPkg/ArmPkg.dec | 4 + ArmPkg/ArmPkg.dsc | 4 + ArmPkg/Drivers/CpuDxe/AArch64/Arch.c | 22 + ArmPkg/Drivers/CpuDxe/Arm/Arch.c | 22 + ArmPkg/Drivers/CpuDxe/CpuDxe.c | 2 + ArmPkg/Drivers/CpuDxe/CpuDxe.h | 10 + ArmPkg/Drivers/CpuDxe/CpuDxe.inf | 6 + ArmPkg/Drivers/CpuDxe/CpuMpInit.c | 604 ++++++++ ArmPkg/Include/Guid/ArmMpCoreInfo.h | 3 +- ArmPkg/Include/Library/ArmLib.h | 4 + ArmPkg/Include/Library/MpInitLib.h | 366 +++++ ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S | 61 + ArmPkg/Library/MpInitLib/DxeMpInitLib.inf | 53 + ArmPkg/Library/MpInitLib/DxeMpLib.c | 1498 ++++++++++++++++++++ ArmPkg/Library/MpInitLib/InternalMpInitLib.h | 358 +++++ ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c | 8 +- ArmPlatformPkg/PrePeiCore/MainMPCore.c | 2 +- ArmPlatformPkg/PrePi/MainMPCore.c | 2 +- ArmVirtPkg/ArmVirt.dsc.inc | 3 + 19 files changed, 3024 insertions(+), 8 deletions(-) create mode 100644 ArmPkg/Drivers/CpuDxe/AArch64/Arch.c create mode 100644 ArmPkg/Drivers/CpuDxe/Arm/Arch.c create mode 100644 ArmPkg/Drivers/CpuDxe/CpuMpInit.c create mode 100644 ArmPkg/Include/Library/MpInitLib.h create mode 100644 ArmPkg/Library/MpInitLib/AArch64/MpFuncs.S create mode 100644 ArmPkg/Library/MpInitLib/DxeMpInitLib.inf create mode 100644 ArmPkg/Library/MpInitLib/DxeMpLib.c create mode 100644 ArmPkg/Library/MpInitLib/InternalMpInitLib.h -- 2.31.1