That's good. Reviewed-by: Liming Gao <[email protected]>
-----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Shia, Cinnamon Sent: Wednesday, January 20, 2016 11:05 AM To: Gao, Liming; [email protected] Subject: Re: [edk2] [PATCH] Nt32Pkg: Fix asserts from running Nt32 64-bit on Win8 Hi Liming, According to my tests, no, 32-bit NT32 image works fine. It can boot to Shell successfully. Extending the memory space of CPU HOB from 32 to 52 is for letting the resource above 4GB to be added to GCD. Thanks, Cinnamon Shia -----Original Message----- From: Gao, Liming [mailto:[email protected]] Sent: Tuesday, January 19, 2016 5:16 PM To: Shia, Cinnamon; [email protected] Subject: RE: [edk2] [PATCH] Nt32Pkg: Fix asserts from running Nt32 64-bit on Win8 Good enhancement. Have BuildCpuHob (52, 16) impact on normal 32bit NT32 image? Thanks Liming -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Cinnamon Shia Sent: Tuesday, January 19, 2016 5:02 PM To: [email protected] Subject: [edk2] [PATCH] Nt32Pkg: Fix asserts from running Nt32 64-bit on Win8 On Windows 8, 64-bit NT32 images are loaded above 4GB. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <[email protected]> --- Nt32Pkg/Nt32Pkg.dsc | 4 ++++ Nt32Pkg/Sec/SecMain.c | 3 ++- Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c | 5 +++-- Nt32Pkg/WinNtFlashMapPei/FlashMap.c | 13 ++++++++++--- Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf | 4 ++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index e8edb9e..3858dd6 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -6,6 +6,7 @@ # # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -276,6 +277,9 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 [PcdsDynamicDefault.Ia32] gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\Ia32\Apps"|VOID*|106 diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c index e6eb3cf..e9f72df 100644 --- a/Nt32Pkg/Sec/SecMain.c +++ b/Nt32Pkg/Sec/SecMain.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -809,7 +810,7 @@ Returns: // Align buffer on section boundry // ImageContext.ImageAddress += ImageContext.SectionAlignment - 1; - ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1); + ImageContext.ImageAddress &= + ~((EFI_PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1); Status = PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c index ab5fd0f..8b68fef 100644 --- a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c +++ b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -176,9 +177,9 @@ Returns: } while (!EFI_ERROR (Status)); // - // Build the CPU hob with 36-bit addressing and 16-bits of IO space. + // Build the CPU hob with 52-bit addressing and 16-bits of IO space. // - BuildCpuHob (36, 16); + BuildCpuHob (52, 16); // // Build GUIDed Hob that contains the Memory Type Information array diff --git a/Nt32Pkg/WinNtFlashMapPei/FlashMap.c b/Nt32Pkg/WinNtFlashMapPei/FlashMap.c index 36457bd..0a1b325 100644 --- a/Nt32Pkg/WinNtFlashMapPei/FlashMap.c +++ b/Nt32Pkg/WinNtFlashMapPei/FlashMap.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -85,9 +86,15 @@ Returns: // // Relocate the base of FV region // - PcdSet32 (PcdFlashNvStorageVariableBase, PcdGet32 (PcdWinNtFlashNvStorageVariableBase) + (UINT32) FdBase); - PcdSet32 (PcdFlashNvStorageFtwWorkingBase, PcdGet32 (PcdWinNtFlashNvStorageFtwWorkingBase) + (UINT32) FdBase); - PcdSet32 (PcdFlashNvStorageFtwSpareBase, PcdGet32 (PcdWinNtFlashNvStorageFtwSpareBase) + (UINT32) FdBase); + if (FdBase >= BASE_4GB) { + PcdSet64 (PcdFlashNvStorageVariableBase64, PcdGet32 (PcdWinNtFlashNvStorageVariableBase) + (UINT64) FdBase); + PcdSet64 (PcdFlashNvStorageFtwWorkingBase64, PcdGet32 (PcdWinNtFlashNvStorageFtwWorkingBase) + (UINT64) FdBase); + PcdSet64 (PcdFlashNvStorageFtwSpareBase64, PcdGet32 + (PcdWinNtFlashNvStorageFtwSpareBase) + (UINT64) FdBase); } else { + PcdSet32 (PcdFlashNvStorageVariableBase, PcdGet32 (PcdWinNtFlashNvStorageVariableBase) + (UINT32) FdBase); + PcdSet32 (PcdFlashNvStorageFtwWorkingBase, PcdGet32 (PcdWinNtFlashNvStorageFtwWorkingBase) + (UINT32) FdBase); + PcdSet32 (PcdFlashNvStorageFtwSpareBase, PcdGet32 + (PcdWinNtFlashNvStorageFtwSpareBase) + (UINT32) FdBase); } return EFI_SUCCESS; } diff --git a/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf b/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf index 5334fb9..f5a14af 100644 --- a/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf +++ b/Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf @@ -3,6 +3,7 @@ # # This module installs FlashMap PPI which is used to get flash layout information. # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -49,10 +50,13 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

