From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhichao.gao@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Thu, 11 Apr 2019 17:42:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 17:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,339,1549958400"; d="scan'208";a="222781307" Received: from gaozhic-mobl.ccr.corp.intel.com ([10.239.198.173]) by orsmga001.jf.intel.com with ESMTP; 11 Apr 2019 17:42:36 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jiewen Yao , Chao Zhang , Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Michael D Kinney , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: [PATCH V2 0/5] Make some DebugLib instance runtime safe Date: Fri, 12 Apr 2019 08:42:26 +0800 Message-Id: <20190412004231.17280-1-zhichao.gao@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1416 Some pointer will be invalid after ExitBootServices, such as protocol pointer, gST, gBS and so on. Disable the functions which used that pointer. Remove SMM support of UefiDebugLibDebugPortProtocol, UefidebugLibConOut and UefiDebugLibStdErr. Before removing, should change the SMM instance in the dsc file which use them as SMM instance. And null version is safe. V2: Fix some typos. Change the comment of function to meet the Doxygen rule. Cc: Jiewen Yao Cc: Chao Zhang Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Aaron Antone (3): MdePkg/UefiDebugLibDebugPortProtocol: Make it runtime safe MdePkg/UefidebugLibConOut: Make it runtime safe MdePkg/UefiDebugLibStdErr: Make it runtime safe Zhichao Gao (2): MdeModulePkg: Change the SMM debug lib instance SignedCapsulePkg: Change the SMM debug lib instance MdeModulePkg/MdeModulePkg.dsc | 2 +- MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 116 +++++++------- .../UefiDebugLibConOut/DebugLibConstructor.c | 77 +++++++++ .../UefiDebugLibConOut/UefiDebugLibConOut.inf | 12 +- .../UefiDebugLibDebugPortProtocol/DebugLib.c | 146 +++++++++--------- .../DebugLibConstructor.c | 77 +++++++++ .../UefiDebugLibDebugPortProtocol.inf | 12 +- MdePkg/Library/UefiDebugLibStdErr/DebugLib.c | 113 +++++++------- .../UefiDebugLibStdErr/DebugLibConstructor.c | 77 +++++++++ .../UefiDebugLibStdErr/UefiDebugLibStdErr.inf | 12 +- SignedCapsulePkg/SignedCapsulePkg.dsc | 4 +- 11 files changed, 458 insertions(+), 190 deletions(-) create mode 100644 MdePkg/Library/UefiDebugLibConOut/DebugLibConstructor.c create mode 100644 MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLibConstructor.c create mode 100644 MdePkg/Library/UefiDebugLibStdErr/DebugLibConstructor.c -- 2.21.0.windows.1