From nobody Mon Feb 9 16:45:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112886+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112886+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1703521240; cv=none; d=zohomail.com; s=zohoarc; b=cony+Km+JHvR2mfD7rivk7VuKZ2HycAEaUBN5o5wkLh2pZqqBTVgMLwnk3QgK3mXxH8M9smA+63q8769CSnrDWpeffzODcNhv/dyDMv5ZFP73WQ7sHSVAj1CU/hC9b7gmBy+b+G9qQPWizd3n8CwupRIk7nnjnmZupT1vu8gOk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703521240; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=AR63L+xSXnYiv9oT5C2u3ehvalMa1PqP54LoFsyw66U=; b=l1l5ic26d2a48BcfY81Ukp3a9prAHMNj8iGdShxH2FOUNWStkfDnk01OEP/eTyTp3bnfEs80fn2HCJfrLVF1jbw60fG8mpdp6msxZriD7IUEBO1kOvyy3wf8A9pk5uySBySbysNssOALqtLhKuF+ofzlCelmaKtcK/Vy0g5N5RE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112886+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170352124065183.60341422184206; Mon, 25 Dec 2023 08:20:40 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=BGG5JbZu32FnB2A8hpeq1jJyF7h7bTM56lPMFHWKDzA=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20140610; t=1703521240; v=1; b=td2uvUnXAs8fP+T21gysvRWALNc4M9Jds7CggT0UOp/Z5hKglzAw4MACVttoZfBAd+kF1ur0 e25CbX4f0FQxTpRGqp5hXMb3Lwb91R1V+Bnss0/tpqSYv89S8gN3vKFhXg0Xp+PyJCxx6vsubFN M0v5Sx+9cAoDk9BVxIxy/tRo= X-Received: by 127.0.0.2 with SMTP id v7kTYY1788612xWWxLaGbOYw; Mon, 25 Dec 2023 08:20:40 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.61867.1703521238683254667 for ; Mon, 25 Dec 2023 08:20:39 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="375789608" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="375789608" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 08:20:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="26085421" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.219]) by orviesa001.jf.intel.com with ESMTP; 25 Dec 2023 08:20:38 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Cc: Ray Ni Subject: [edk2-devel] [PATCH v2 1/6] SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not Date: Tue, 26 Dec 2023 00:20:29 +0800 Message-Id: <20231225162034.2052-2-jiaxin.wu@intel.com> In-Reply-To: <20231225162034.2052-1-jiaxin.wu@intel.com> References: <20231225162034.2052-1-jiaxin.wu@intel.com> Precedence: Bulk List-Subscribe: List-Help: 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,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NLR9eTNx5E6AmaA1qcswlNUKx1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1703521242540100006 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch is to use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a BOOLEAN if it's not NULL. Cc: Ray Ni Signed-off-by: Jiaxin Wu --- .../Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c | 14 ++++++++++= ---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugA= gentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAg= entLib.c index f49a592d27..1f34a0edc8 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib= .c +++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib= .c @@ -157,12 +157,13 @@ RestoreDebugRegister ( in SMM code. =20 If InitFlag is DEBUG_AGENT_INIT_SMM, it will override IDT table entries and initialize debug port. It will get debug agent Mailbox from GUIDed H= OB, it it exists, debug agent wiil copied it into the local Mailbox in SMM s= pace. - it will override IDT table entries and initialize debug port. Context wi= ll be - NULL. + it will override IDT table entries and initialize debug port. Context mu= st + point to a BOOLEAN if it's not NULL, which indicates SMM Debug Agent sup= ported + or not. If InitFlag is DEBUG_AGENT_INIT_ENTER_SMI, debug agent will save Debug Registers and get local Mailbox in SMM space. Context will be NULL. If InitFlag is DEBUG_AGENT_INIT_EXIT_SMI, debug agent will restore Debug Registers. Context will be NULL. =20 @@ -203,29 +204,32 @@ InitializeDebugAgent ( (VOID *)&mVectorHandoffInfoDebugAgent[0], sizeof (EFI_VECTOR_HANDOFF_INFO) * mVectorHandoffI= nfoCount ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "DebugAgent: Cannot install configuration tab= le for persisted vector handoff info!\n")); + *(BOOLEAN *)Context =3D FALSE; CpuDeadLoop (); } =20 // // Check if Debug Agent initialized in DXE phase // Status =3D EfiGetSystemConfigurationTable (&gEfiDebugAgentGuid, (VOI= D **)&Mailbox); if ((Status =3D=3D EFI_SUCCESS) && (Mailbox !=3D NULL)) { VerifyMailboxChecksum (Mailbox); - mMailboxPointer =3D Mailbox; + mMailboxPointer =3D Mailbox; + *(BOOLEAN *)Context =3D TRUE; break; } =20 // // Check if Debug Agent initialized in SEC/PEI phase // Mailbox =3D GetMailboxFromHob (); if (Mailbox !=3D NULL) { - mMailboxPointer =3D Mailbox; + mMailboxPointer =3D Mailbox; + *(BOOLEAN *)Context =3D TRUE; break; } =20 // // Debug Agent was not initialized before, use the local mailbox. @@ -273,10 +277,12 @@ InitializeDebugAgent ( // // Restore saved IDT entries // CopyMem ((VOID *)IdtDescriptor.Base, &IdtEntry, 33 * sizeof (IA32_ID= T_GATE_DESCRIPTOR)); =20 + *(BOOLEAN *)Context =3D TRUE; + break; =20 case DEBUG_AGENT_INIT_ENTER_SMI: SaveDebugRegister (); if (!mSmmDebugIdtInitFlag) { --=20 2.16.2.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 (#112886): https://edk2.groups.io/g/devel/message/112886 Mute This Topic: https://groups.io/mt/103360802/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-