From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 69A8821A04802 for ; Tue, 11 Apr 2017 00:31:25 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 11 Apr 2017 00:31:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,184,1488873600"; d="scan'208";a="1154230113" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 11 Apr 2017 00:31:11 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Apr 2017 00:16:49 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 11 Apr 2017 00:16:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.117]) with mapi id 14.03.0319.002; Tue, 11 Apr 2017 15:16:47 +0800 From: "Tian, Feng" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Tian, Feng" Thread-Topic: [PATCH 3/3] UefiCpuPkg: Error Level is not used correctly Thread-Index: AQHSscJ/Y6E/dtTlREeLjmlACGEzpKG/w58w Date: Tue, 11 Apr 2017 07:16:46 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699E3CC7@SHSMSX101.ccr.corp.intel.com> References: <20170410061941.5016-1-jeff.fan@intel.com> <20170410061941.5016-4-jeff.fan@intel.com> In-Reply-To: <20170410061941.5016-4-jeff.fan@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 3/3] UefiCpuPkg: Error Level is not used correctly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 07:31:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Feng Tian -----Original Message----- From: Fan, Jeff=20 Sent: Monday, April 10, 2017 2:20 PM To: edk2-devel@lists.01.org Cc: Tian, Feng ; Yao, Jiewen Subject: [PATCH 3/3] UefiCpuPkg: Error Level is not used correctly Cc: Feng Tian Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 68 +++++++++++--------= ---- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTa= ble.c index ab664b4..2c61e75 100644 --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c @@ -634,10 +634,10 @@ ConvertMemoryPageAttributes ( switch(CurrentPagingContext.MachineType) { case IMAGE_FILE_MACHINE_I386: if (CurrentPagingContext.ContextData.Ia32.PageTableBase =3D=3D 0) { - DEBUG ((DEBUG_ERROR, "PageTable is 0!\n")); if (Attributes =3D=3D 0) { return EFI_SUCCESS; } else { + DEBUG ((DEBUG_ERROR, "PageTable is 0!\n")); return EFI_UNSUPPORTED; } } diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg= /Universal/Acpi/S3Resume2Pei/S3Resume.c index a9d1042..e53ed21 100644 --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c @@ -4,7 +4,7 @@ This module will execute the boot script saved during last boot and afte= r that, control is passed to OS waking up handler. =20 - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights=20 + reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
=20 This program and the accompanying materials @@ -531,7 +531,7 @@ S3Resume= BootOs ( // // X64 long mode waking vector // - DEBUG (( EFI_D_ERROR, "Transfer to 64bit OS waking vector - %x\r\n",= (UINTN)Facs->XFirmwareWakingVector)); + DEBUG ((DEBUG_INFO, "Transfer to 64bit OS waking vector -=20 + %x\r\n", (UINTN)Facs->XFirmwareWakingVector)); if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) { AsmEnablePaging64 ( 0x38, @@ -557,7 +557,7 @@ S3ResumeBootOs ( // // IA32 protected mode waking vector (Page disabled) // - DEBUG (( EFI_D_ERROR, "Transfer to 32bit OS waking vector - %x\r\n",= (UINTN)Facs->XFirmwareWakingVector)); + DEBUG ((DEBUG_INFO, "Transfer to 32bit OS waking vector -=20 + %x\r\n", (UINTN)Facs->XFirmwareWakingVector)); SwitchStack ( (SWITCH_STACK_ENTRY_POINT) (UINTN) Facs->XFirmwareWakingVector, NULL, @@ -569,7 +569,7 @@ S3ResumeBootOs ( // // 16bit Realmode waking vector // - DEBUG (( EFI_D_ERROR, "Transfer to 16bit OS waking vector - %x\r\n", (= UINTN)Facs->FirmwareWakingVector)); + DEBUG ((DEBUG_INFO, "Transfer to 16bit OS waking vector - %x\r\n",=20 + (UINTN)Facs->FirmwareWakingVector)); AsmTransferControl (Facs->FirmwareWakingVector, 0x0); } =20 @@ -630,7 +630,7 @@ RestoreS3PageTables ( // // The assumption is : whole page table is allocated in CONTINUOUS mem= ory and CR3 points to TOP page. // - DEBUG ((EFI_D_ERROR, "S3NvsPageTableAddress - %x (%x)\n", (UINTN)S3Nvs= PageTableAddress, (UINTN)Build4GPageTableOnly)); + DEBUG ((DEBUG_INFO, "S3NvsPageTableAddress - %x (%x)\n",=20 + (UINTN)S3NvsPageTableAddress, (UINTN)Build4GPageTableOnly)); =20 // // By architecture only one PageMapLevel4 exists - so lets allocate st= orage for it. @@ -783,7 +783,7 @@ S3ResumeExecuteBootScript ( PEI_S3_RESUME_STATE *PeiS3ResumeState; BOOLEAN InterruptStatus; =20 - DEBUG ((EFI_D_ERROR, "S3ResumeExecuteBootScript()\n")); + DEBUG ((DEBUG_INFO, "S3ResumeExecuteBootScript()\n")); =20 // // Attempt to use content from SMRAM first @@ -810,13 +810,13 @@ S3Resum= eExecuteBootScript ( (VOID **) &SmmAccess ); if (!EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Close all SMRAM regions before executing boot = script\n")); + DEBUG ((DEBUG_INFO, "Close all SMRAM regions before executing=20 + boot script\n")); =20 for (Index =3D 0, Status =3D EFI_SUCCESS; !EFI_ERROR (Status); Index= ++) { Status =3D SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTa= blePointer (), SmmAccess, Index); } =20 - DEBUG ((EFI_D_ERROR, "Lock all SMRAM regions before executing boot s= cript\n")); + DEBUG ((DEBUG_INFO, "Lock all SMRAM regions before executing boot=20 + script\n")); =20 for (Index =3D 0, Status =3D EFI_SUCCESS; !EFI_ERROR (Status); Index= ++) { Status =3D SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTab= lePointer (), SmmAccess, Index); @@ -881,7 +881,7 @@ S3ResumeExecuteBootScr= ipt ( ); ASSERT (FALSE); } - DEBUG (( EFI_D_ERROR, "PeiS3ResumeState - %x\r\n", PeiS3ResumeState)); + DEBUG ((DEBUG_INFO, "PeiS3ResumeState - %x\r\n", PeiS3ResumeState)); PeiS3ResumeState->ReturnCs =3D 0x10; PeiS3ResumeState->ReturnEntryPoint =3D (EFI_PHYSICAL_ADDRESS)(UINTN)S3= ResumeBootOs; PeiS3ResumeState->ReturnStackPointer =3D (EFI_PHYSICAL_ADDRESS)STACK_ALI= GN_DOWN (&Status); @@ -901,7 +901,7 @@ S3ResumeExecuteBootScript ( // // X64 S3 Resume // - DEBUG (( EFI_D_ERROR, "Enable X64 and transfer control to Standalone B= oot Script Executor\r\n")); + DEBUG ((DEBUG_INFO, "Enable X64 and transfer control to Standalone=20 + Boot Script Executor\r\n")); =20 // // Switch to long mode to complete resume. @@ -917,7 +917,7 @@ S3ResumeExecuteBootScript ( // // IA32 S3 Resume // - DEBUG (( EFI_D_ERROR, "transfer control to Standalone Boot Script Exec= utor\r\n")); + DEBUG ((DEBUG_INFO, "transfer control to Standalone Boot Script=20 + Executor\r\n")); SwitchStack ( (SWITCH_STACK_ENTRY_POINT) (UINTN) EfiBootScriptExecutorVariable->Bo= otScriptExecutorEntrypoint, (VOID *)AcpiS3Context, @@ -985,7 +985,7 @@ S3RestoreConfig2 ( TempAcpiS3Context =3D 0; TempEfiBootScriptExecutorVariable =3D 0; =20 - DEBUG ((EFI_D_ERROR, "Enter S3 PEIM\r\n")); + DEBUG ((DEBUG_INFO, "Enter S3 PEIM\r\n")); =20 VarSize =3D sizeof (EFI_PHYSICAL_ADDRESS); Status =3D RestoreLockBox ( @@ -1023,15 +1023,15 @@ S3RestoreConfig2 ( EfiBootScriptExecutorVariable =3D (BOOT_SCRIPT_EXECUTOR_VARIABLE *) (UIN= TN) TempEfiBootScriptExecutorVariable; ASSERT (EfiBootScriptExecutorVariable !=3D NULL); =20 - DEBUG (( EFI_D_ERROR, "AcpiS3Context =3D %x\n", AcpiS3Context)); - DEBUG (( EFI_D_ERROR, "Waking Vector =3D %x\n", ((EFI_ACPI_2_0_FIRMWARE_= ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)))->Firmwa= reWakingVector)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->AcpiFacsTable =3D %x\n", AcpiS3Con= text->AcpiFacsTable)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->IdtrProfile =3D %x\n", AcpiS3Conte= xt->IdtrProfile)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3NvsPageTableAddress =3D %x\n", A= cpiS3Context->S3NvsPageTableAddress)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3DebugBufferAddress =3D %x\n", Ac= piS3Context->S3DebugBufferAddress)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->BootScriptStackBase =3D %x\n", Acp= iS3Context->BootScriptStackBase)); - DEBUG (( EFI_D_ERROR, "AcpiS3Context->BootScriptStackSize =3D %x\n", Acp= iS3Context->BootScriptStackSize)); - DEBUG (( EFI_D_ERROR, "EfiBootScriptExecutorVariable->BootScriptExecutor= Entrypoint =3D %x\n", EfiBootScriptExecutorVariable->BootScriptExecutorEntr= ypoint)); + DEBUG (( DEBUG_INFO, "AcpiS3Context =3D %x\n", AcpiS3Context)); DEBUG=20 + (( DEBUG_INFO, "Waking Vector =3D %x\n",=20 + ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN)=20 + (AcpiS3Context->AcpiFacsTable)))->FirmwareWakingVector)); + DEBUG (( DEBUG_INFO, "AcpiS3Context->AcpiFacsTable =3D %x\n",=20 + AcpiS3Context->AcpiFacsTable)); DEBUG (( DEBUG_INFO,=20 + "AcpiS3Context->IdtrProfile =3D %x\n", AcpiS3Context->IdtrProfile)); =20 + DEBUG (( DEBUG_INFO, "AcpiS3Context->S3NvsPageTableAddress =3D %x\n",=20 + AcpiS3Context->S3NvsPageTableAddress)); + DEBUG (( DEBUG_INFO, "AcpiS3Context->S3DebugBufferAddress =3D %x\n",=20 + AcpiS3Context->S3DebugBufferAddress)); + DEBUG (( DEBUG_INFO, "AcpiS3Context->BootScriptStackBase =3D %x\n",=20 + AcpiS3Context->BootScriptStackBase)); + DEBUG (( DEBUG_INFO, "AcpiS3Context->BootScriptStackSize =3D %x\n",=20 + AcpiS3Context->BootScriptStackSize)); + DEBUG (( DEBUG_INFO,=20 + "EfiBootScriptExecutorVariable->BootScriptExecutorEntrypoint =3D %x\n",=20 + EfiBootScriptExecutorVariable->BootScriptExecutorEntrypoint)); =20 // // Additional step for BootScript integrity - we only handle BootScript = and BootScriptExecutor. @@ -1081,19 +1081,19 @@ S3RestoreConfig2 ( SmmS3ResumeState->ReturnContext2 =3D (EFI_PHYSICAL_ADDRESS)(UINTN)= EfiBootScriptExecutorVariable; SmmS3ResumeState->ReturnStackPointer =3D (EFI_PHYSICAL_ADDRESS)STACK_A= LIGN_DOWN (&Status); =20 - DEBUG (( EFI_D_ERROR, "SMM S3 Signature =3D %x\n", SmmS= 3ResumeState->Signature)); - DEBUG (( EFI_D_ERROR, "SMM S3 Stack Base =3D %x\n", SmmS= 3ResumeState->SmmS3StackBase)); - DEBUG (( EFI_D_ERROR, "SMM S3 Stack Size =3D %x\n", SmmS= 3ResumeState->SmmS3StackSize)); - DEBUG (( EFI_D_ERROR, "SMM S3 Resume Entry Point =3D %x\n", SmmS= 3ResumeState->SmmS3ResumeEntryPoint)); - DEBUG (( EFI_D_ERROR, "SMM S3 CR0 =3D %x\n", SmmS= 3ResumeState->SmmS3Cr0)); - DEBUG (( EFI_D_ERROR, "SMM S3 CR3 =3D %x\n", SmmS= 3ResumeState->SmmS3Cr3)); - DEBUG (( EFI_D_ERROR, "SMM S3 CR4 =3D %x\n", SmmS= 3ResumeState->SmmS3Cr4)); - DEBUG (( EFI_D_ERROR, "SMM S3 Return CS =3D %x\n", SmmS= 3ResumeState->ReturnCs)); - DEBUG (( EFI_D_ERROR, "SMM S3 Return Entry Point =3D %x\n", SmmS= 3ResumeState->ReturnEntryPoint)); - DEBUG (( EFI_D_ERROR, "SMM S3 Return Context1 =3D %x\n", SmmS= 3ResumeState->ReturnContext1)); - DEBUG (( EFI_D_ERROR, "SMM S3 Return Context2 =3D %x\n", SmmS= 3ResumeState->ReturnContext2)); - DEBUG (( EFI_D_ERROR, "SMM S3 Return Stack Pointer =3D %x\n", SmmS= 3ResumeState->ReturnStackPointer)); - DEBUG (( EFI_D_ERROR, "SMM S3 Smst =3D %x\n", SmmS= 3ResumeState->Smst)); + DEBUG (( DEBUG_INFO, "SMM S3 Signature =3D %x\n", SmmS3= ResumeState->Signature)); + DEBUG (( DEBUG_INFO, "SMM S3 Stack Base =3D %x\n", SmmS3= ResumeState->SmmS3StackBase)); + DEBUG (( DEBUG_INFO, "SMM S3 Stack Size =3D %x\n", SmmS3= ResumeState->SmmS3StackSize)); + DEBUG (( DEBUG_INFO, "SMM S3 Resume Entry Point =3D %x\n", SmmS3= ResumeState->SmmS3ResumeEntryPoint)); + DEBUG (( DEBUG_INFO, "SMM S3 CR0 =3D %x\n", SmmS3= ResumeState->SmmS3Cr0)); + DEBUG (( DEBUG_INFO, "SMM S3 CR3 =3D %x\n", SmmS3= ResumeState->SmmS3Cr3)); + DEBUG (( DEBUG_INFO, "SMM S3 CR4 =3D %x\n", SmmS3= ResumeState->SmmS3Cr4)); + DEBUG (( DEBUG_INFO, "SMM S3 Return CS =3D %x\n", SmmS3= ResumeState->ReturnCs)); + DEBUG (( DEBUG_INFO, "SMM S3 Return Entry Point =3D %x\n", SmmS3= ResumeState->ReturnEntryPoint)); + DEBUG (( DEBUG_INFO, "SMM S3 Return Context1 =3D %x\n", SmmS3= ResumeState->ReturnContext1)); + DEBUG (( DEBUG_INFO, "SMM S3 Return Context2 =3D %x\n", SmmS3= ResumeState->ReturnContext2)); + DEBUG (( DEBUG_INFO, "SMM S3 Return Stack Pointer =3D %x\n", SmmS3= ResumeState->ReturnStackPointer)); + DEBUG (( DEBUG_INFO, "SMM S3 Smst =3D %x\n", SmmS3= ResumeState->Smst)); =20 if (SmmS3ResumeState->Signature =3D=3D SMM_S3_RESUME_SMM_32) { SwitchStack ( -- 2.9.3.windows.2