From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.5247.1665739236797666448 for ; Fri, 14 Oct 2022 02:20:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=RU8xQdL2; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: dun.tan@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665739236; x=1697275236; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=u0SFjycvFRDmyZrjUh1WH347NgWUbBeAQIyk49lweh8=; b=RU8xQdL2k3e/gW5fHA6rZ6iP35jCo+eveq8kP7rdZe/JfO1V+f9A3e34 DmdQ7mwDU/c3uABmc5SvYqCVc2jPjrH12F1ty+6fWpKL+NjJwgY8JONts pWFM04x+ckRZ2P/WBB3BpeZfciylexfhCznnocTfy4r8lAtEYj+/dJGbW bRK/gFTWcHfCTFE+N5bAabTmBr485Bg0eaPcwlOnIo64n7+1XLi2SqdHw th5iG1N+WgED+tf8toyOZsz/auF0tcDhdJq7Hd5VbqRE138YuEiqrr1+M uQ4xgJC5CA4yz2jDIwTPHG/L6QhGSnSRlhOXzPlFFXiIb3NX/qUFAWAwE w==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="285061269" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="285061269" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 02:20:36 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="627510796" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="627510796" Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.56.220]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 02:20:34 -0700 From: "duntan" To: devel@edk2.groups.io Subject: [Patch V3 0/4] Add Unit tests for Pei/DxeCpuExceptionHandlerLib Date: Fri, 14 Oct 2022 17:19:27 +0800 Message-Id: <20221014091931.847-1-dun.tan@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In V3 1/4 patch: Remove uunneeded CPU_INFO_IN_HOB and IA32_GDT structure. Use R8/R9 as the register name instead of R8Register. Return a Boolean flag for FindPFAddressInPageTable. In V3 2/4 patch: Use same global variable name for IA32 mExpectedContextInHandler/AfterException. In the new 4/4 patch: Add CpuExceptionHandlerTest.h in EccCheck IgnoreFiles of UefiCpuPkg/UefiCpuPkg.ci.yaml to pass ECC check. Dun Tan (4): UefiCpuPkg: Add Unit tests for DxeCpuExceptionHandlerLib UefiCpuPkg: Add Unit tests for PeiCpuExceptionHandlerLib UefiCpuPkg: Add Pei/DxeCpuExceptionHandlerLibUnitTest in dsc UefiCpuPkg: Add CpuExceptionHandlerTest.h in ECC IgnoreFile UefiCpuPkg/CpuExceptionHandlerUnitTest/CpuExceptionHandlerTest.h | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/CpuExceptionHandlerTestCommon.c | 852 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/DxeCpuExceptionHandlerLibUnitTest.inf | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/DxeCpuExceptionHandlerUnitTest.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/Ia32/ArchExceptionHandlerTest.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/Ia32/ArchExceptionHandlerTestAsm.nasm | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/PeiCpuExceptionHandlerLibUnitTest.inf | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/PeiCpuExceptionHandlerUnitTest.c | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/X64/ArchExceptionHandlerTest.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/CpuExceptionHandlerUnitTest/X64/ArchExceptionHandlerTestAsm.nasm | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/UefiCpuPkg.ci.yaml | 1 + UefiCpuPkg/UefiCpuPkg.dsc | 7 +++++++ 12 files changed, 2489 insertions(+) create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/CpuExceptionHandlerTest.h create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/CpuExceptionHandlerTestCommon.c create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/DxeCpuExceptionHandlerLibUnitTest.inf create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/DxeCpuExceptionHandlerUnitTest.c create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/Ia32/ArchExceptionHandlerTest.c create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/Ia32/ArchExceptionHandlerTestAsm.nasm create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/PeiCpuExceptionHandlerLibUnitTest.inf create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/PeiCpuExceptionHandlerUnitTest.c create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/X64/ArchExceptionHandlerTest.c create mode 100644 UefiCpuPkg/CpuExceptionHandlerUnitTest/X64/ArchExceptionHandlerTestAsm.nasm -- 2.31.1.windows.1