From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 820F781E51 for ; Thu, 10 Nov 2016 21:45:47 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 10 Nov 2016 21:45:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,620,1473145200"; d="scan'208";a="900259274" Received: from jfan12-desk.ccr.corp.intel.com ([10.239.9.5]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2016 21:45:50 -0800 From: Jeff Fan To: edk2-devel@lists.01.org Date: Fri, 11 Nov 2016 13:45:42 +0800 Message-Id: <20161111054545.19616-1-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 Subject: [PATCH v2 0/3] Put AP into safe hlt-loop code on S3 path X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 05:45:47 -0000 On S3 path, we will wake up APs to restore CPU context in PiSmmCpuDxeSmm driver. In case, one NMI or SMI happens, APs may exit from hlt state and execute the instruction after HLT instruction. But APs are not running on safe code, it leads OVMF S3 boot unstable. https://bugzilla.tianocore.org/show_bug.cgi?id=216 I tested real platform with 64bit DXE. v2: 1. Make stack alignment per Laszlo's comment. 2. Trim whitespace at end of end per Laszlo's comment. 3. Update year mark in file header. 4. Enhancement on InterlockedDecrement() per Paolo's comment. Jeff Fan (3): UefiCpuPkg/PiSmmCpuDxeSmm: Put AP into safe hlt-loop code on S3 path UefiCpuPkg/PiSmmCpuDxeSmm: Place AP to 32bit protected mode on S3 path UefiCpuPkg/PiSmmCpuDxeSmm: Decrease mNumberToFinish in AP safe code UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 33 +++++++++++++- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c | 29 +++++++++++- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 15 +++++++ UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 63 ++++++++++++++++++++++++++- 4 files changed, 136 insertions(+), 4 deletions(-) -- 2.9.3.windows.2