From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 A6BC681DC7 for ; Sun, 13 Nov 2016 17:41:54 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 13 Nov 2016 17:41:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,487,1473145200"; d="scan'208,217";a="1059062864" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 13 Nov 2016 17:41:58 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 13 Nov 2016 17:41:58 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 13 Nov 2016 17:41:57 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.96]) with mapi id 14.03.0248.002; Mon, 14 Nov 2016 09:41:56 +0800 From: "Yao, Jiewen" To: "Fan, Jeff" , Laszlo Ersek CC: "edk2-devel@ml01.01.org" , Paolo Bonzini Thread-Topic: [edk2] [PATCH v2 0/3] Put AP into safe hlt-loop code on S3 path Thread-Index: AQHSO97kE3vvVAqcOkqRz7pXpAmLxaDTq3eAgAKwFoCAAVyh8A== Date: Mon, 14 Nov 2016 01:41:55 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386CFE5A@shsmsx102.ccr.corp.intel.com> References: <20161111054545.19616-1-jeff.fan@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4A2DB4F5@shsmsx102.ccr.corp.intel.com> In-Reply-To: <542CF652F8836A4AB8DBFAAD40ED192A4A2DB4F5@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [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: Mon, 14 Nov 2016 01:41:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. I think it is good to check in because it did fix an existing issue. I suggest we describe the remaining issue honestly in our checkin log. Thank you Yao Jiewen From: Fan, Jeff Sent: Sunday, November 13, 2016 8:52 PM To: Laszlo Ersek Cc: edk2-devel@ml01.01.org; Yao, Jiewen ; Paolo Bonzi= ni Subject: RE: [edk2] [PATCH v2 0/3] Put AP into safe hlt-loop code on S3 pat= h Laszlo, Thanks your testing. It seems that there is still some unknown issue existi= ng. I suggest to push this serial of patches firstly, because they have big pro= gress to solve the AP crashed issue in https://bugzilla.tianocore.org/show_= bug.cgi?id=3D216. I could submit another bug to handle "AP lost" issue. Thus, JIewen's or o= thers' patches could be push as long as they have no additional issue excep= t for "AP Lost:". I could follow up to fix "AP Lost" issue. Thanks! Jeff -----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Saturday, November 12, 2016 3:49 AM To: Fan, Jeff Cc: edk2-devel@ml01.01.org; Yao, Jiewen; Pao= lo Bonzini Subject: Re: [edk2] [PATCH v2 0/3] Put AP into safe hlt-loop code on S3 pat= h On 11/11/16 06:45, Jeff Fan wrote: > 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=3D216 > > 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(-) > Applied this locally to master (ffd6b0b1b65e) for testing. I tested the ser= ies with a suspend-resume loop -- not a busy loop, just manually. (So there= was always one second or so between adjacent steps.) No crashes or emulation failures, but the "AP going lost" issue remains pre= sent -- sometimes Linux cannot bring up one of the four VCPUs after resume. In the Ia32 case, this "AP lost" symptom surfaced after the 6th resume. In the Ia32X64 case, I experienced the symptom after the 89th resume. Thanks Laszlo