From nobody Sun Feb 8 13:09:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57792+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57792+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1587545582; cv=none; d=zohomail.com; s=zohoarc; b=HHknUStQfGvNTLExcahhr+1MFNG2y+nLx1t784D4IfXsyGOO2FM7c+uAdrSpiUWGOw3saL2u2zbYk/In5POoCLW/TDGMtosIDYMOsbl7J4nTmW+71JPmvxQ9Yr9QnzheswIr6LIL7l42AtNdFDoM9zG6LvTLJ+S7nFkaRd5UrFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587545582; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Wej21mX70gzUEenhSiAN4XllrrMp60h5O5zk7UwFOAI=; b=JQAhC1NRwWfde16SCHeTcgltLAFdBpcEEM5aK4XRah4d3fE1nnn9Ta06KdnT41vsJuAEhuXaqLSIR6bDVz5bbde9gxJ8EYe8tOEGoisyqb0CaPXEkkZN0+WyThgZd1dnSrGUeU6V4q0Q06rww/zKxIOW6vZkWqP383H7q2sHxt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57792+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158754558266555.15352182654544; Wed, 22 Apr 2020 01:53:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aJCMYY1788612xYxnDGmMcFS; Wed, 22 Apr 2020 01:53:02 -0700 X-Received: from mga12.intel.com (mga12.intel.com []) by mx.groups.io with SMTP id smtpd.web12.2797.1587545580516086204 for ; Wed, 22 Apr 2020 01:53:01 -0700 IronPort-SDR: CiZ9dM9jt8CewTNEpasByccs1k9ZeRPDzHlbxyyIiAILnwOHeUMqD2KK2GDVb7LwcLTanNBwEZ WWZsV3mjXrVg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 01:53:01 -0700 IronPort-SDR: EhSSQalvWN/eAlfm3RVYplNYzoTFr/A48EirXhEiTjiaEb+yAjOrskJiO+EgyMqELaGvgW1xEE mq1GMZaHn3lw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,413,1580803200"; d="scan'208";a="334555637" X-Received: from ydong10-desktop.ccr.corp.intel.com ([10.239.158.133]) by orsmga001.jf.intel.com with ESMTP; 22 Apr 2020 01:53:00 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Ray Ni , Laszlo Ersek , Chandana Kumar Subject: [edk2-devel] [PATCH 1/2] UefiCpuPkg/MpInitLib: Restore IDT context for APs. Date: Wed, 22 Apr 2020 16:52:52 +0800 Message-Id: <20200422085252.1412-2-eric.dong@intel.com> In-Reply-To: <20200422085252.1412-1-eric.dong@intel.com> References: <20200422085252.1412-1-eric.dong@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,eric.dong@intel.com X-Gm-Message-State: 9sHDoeVec8olHHo8Xh7SfMe7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587545582; bh=KC5In5Zhtgdrs9PO9c0dEpdP07gdKQcIZe0ydwTZPtU=; h=Cc:Date:From:Reply-To:Subject:To; b=J0xymw78cNNCpYPC5Js6Zw1h4xXD5TLYnqyZG5nv1HYDyvvY31e+MxCySPJ5IKssCxW QwvhfpNL4kr8ppxCtctVZgnI0kt96CzDrXAlxlfGGBJQMnPAx4EncpdeNL6+rwKu2v44r RR7euBArl0X+ysE4tzoqG+qLkDy92FNFET0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2683 This patch fixes an assertion because AP can't find the CpuMpData. When AP is waken up through Init-Sipi-Sipi, AP's IDT should be restored to pre-allocated buffer so AP can get the CpuMpData through the IDT base address. Current code already has logic to handle this when CpuMpData-> InitFlag is ApInitConfig but misses the logic when CpuMpData->InitFlag is ApInitReconfig. This patch fixes this gap. Cc: Ray Ni Cc: Laszlo Ersek Cc: Chandana Kumar Signed-off-by: Eric Dong --- V2: Enhance code to remove CpuMpData->ApLoopMode =3D=3D ApInHltLoop check. UefiCpuPkg/Library/MpInitLib/MpLib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 64a4c3546e..2e87aa1f06 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -692,6 +692,16 @@ ApWakeupFunction ( // RestoreVolatileRegisters (&CpuMpData->CpuData[ProcessorNumber].Vol= atileRegisters, TRUE); } else { + if (CpuMpData->InitFlag =3D=3D ApInitReconfig) { + // + // Initialize AP volatile registers in ApInitReconfig path. + // ApInitReconfig happens when: + // 1. AP is re-enabled after it's disabled, in either PEI or DXE= phase. + // 2. AP is initialized in DXE phase. + // + RestoreVolatileRegisters (&CpuMpData->CpuData[0].VolatileRegiste= rs, FALSE); + } + // // The CPU driver might not flush TLB for APs on spot after updati= ng // page attributes. AP in mwait loop mode needs to take care of it= when --=20 2.23.0.windows.1 -=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 (#57792): https://edk2.groups.io/g/devel/message/57792 Mute This Topic: https://groups.io/mt/73191488/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-