From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 268752097E274 for ; Thu, 12 Jul 2018 17:48:11 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2018 17:48:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,345,1526367600"; d="scan'208";a="72336984" Received: from ydong10-win10.ccr.corp.intel.com ([10.239.9.24]) by orsmga001.jf.intel.com with ESMTP; 12 Jul 2018 17:48:01 -0700 From: Eric Dong To: edk2-devel@lists.01.org Date: Fri, 13 Jul 2018 08:47:56 +0800 Message-Id: <20180713004759.14224-1-eric.dong@intel.com> X-Mailer: git-send-email 2.15.0.windows.1 X-Mailman-Approved-At: Mon, 16 Jul 2018 10:17:53 -0700 Subject: [Patch v3 0/3] Optimize load uCode performance X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2018 00:48:12 -0000 Use below three rules to optimize load uCode performance: 1. Let BSP relocate uCode from flash to memory for better performance. 2. BSP caches the CPU ID and address of uCode so AP doesn’t need to look for the uCode again if the CPU ID is same as BSP’s. 3. Only apply uCode in one thread of a core when hyper threading is enabled. v2 changes: Fix potential issue if allocate memory failed. V3 Changes: Remove the ASSERT code which is not correct. Test: Use an sample platform which has 1 socket, 4 core, 8 threads, the CpuMpPei driver cost time reduce from 108.4ms to 27.2ms Eric Dong (3): UefiCpuPkg/MpInitLib: Use BSP uCode for APs if possible. UefiCpuPkg/MpInitLib: Load uCode once for each core. UefiCpuPkg/MpInitLib: Relocate uCode to memory to save time. UefiCpuPkg/Library/MpInitLib/Microcode.c | 43 +++++++++++++++++++++++++++++--- UefiCpuPkg/Library/MpInitLib/MpLib.c | 38 +++++++++++++++++++++++++--- UefiCpuPkg/Library/MpInitLib/MpLib.h | 11 ++++++-- 3 files changed, 84 insertions(+), 8 deletions(-) -- 2.15.0.windows.1