public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().
       [not found] <20170721101954.10248-1-Marvin.Haeuser@outlook.com>
@ 2017-07-21 10:20 ` Marvin Häuser
  2017-07-26  3:04   ` Fan, Jeff
  2017-07-21 10:20 ` [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport() Marvin Häuser
  1 sibling, 1 reply; 4+ messages in thread
From: Marvin Häuser @ 2017-07-21 10:20 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: jeff.fan@intel.com

The value returned by GetPageTableBase() is of type UINT64, which is
implicitely casted to UINTN by the return statement. To purge the
'possible loss of data' warning on 32-bit platforms, with this patch,
the value is casted to UINTN before returning.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
index a535389c26ce..009d8eb01347 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017, Intel Corporation. All rights reserved.<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
@@ -39,7 +39,7 @@ GetPageTableBase (
   VOID
   )
 {
-  return (AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
+  return (UINTN)(AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
 }
 
 /**
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().
       [not found] <20170721101954.10248-1-Marvin.Haeuser@outlook.com>
  2017-07-21 10:20 ` [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase() Marvin Häuser
@ 2017-07-21 10:20 ` Marvin Häuser
  2017-07-26  3:05   ` Fan, Jeff
  1 sibling, 1 reply; 4+ messages in thread
From: Marvin Häuser @ 2017-07-21 10:20 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: jeff.fan@intel.com

The documentation of PpinSupport() refers to 'Enhanced Intel
SpeedStep'. This patch fixes these referneces.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c              | 4 ++--
 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
index 438578a83230..58e303448507 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
@@ -26,8 +26,8 @@
                                CPU_FEATURE_GET_CONFIG_DATA was not provided in
                                RegisterCpuFeature().
 
-  @retval TRUE     Enhanced Intel SpeedStep feature is supported.
-  @retval FALSE    Enhanced Intel SpeedStep feature is not supported.
+  @retval TRUE     Protected Processor Inventory Number feature is supported.
+  @retval FALSE    Protected Processor Inventory Number feature is not supported.
 
   @note This service could be called by BSP/APs.
 **/
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
index c03e5ab0183f..c5bc62b20728 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
@@ -866,8 +866,8 @@ FeatureControlGetConfigData (
                                CPU_FEATURE_GET_CONFIG_DATA was not provided in
                                RegisterCpuFeature().
 
-  @retval TRUE     Enhanced Intel SpeedStep feature is supported.
-  @retval FALSE    Enhanced Intel SpeedStep feature is not supported.
+  @retval TRUE     Protected Processor Inventory Number feature is supported.
+  @retval FALSE    Protected Processor Inventory Number feature is not supported.
 
   @note This service could be called by BSP/APs.
 **/
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().
  2017-07-21 10:20 ` [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase() Marvin Häuser
@ 2017-07-26  3:04   ` Fan, Jeff
  0 siblings, 0 replies; 4+ messages in thread
From: Fan, Jeff @ 2017-07-26  3:04 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org

Reviewed-by: Jeff Fan <jeff.fan@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Marvin Häuser
Sent: Friday, July 21, 2017 6:20 PM
To: edk2-devel@lists.01.org
Cc: Fan, Jeff
Subject: [edk2] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().

The value returned by GetPageTableBase() is of type UINT64, which is implicitely casted to UINTN by the return statement. To purge the 'possible loss of data' warning on 32-bit platforms, with this patch, the value is casted to UINTN before returning.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
index a535389c26ce..009d8eb01347 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017, Intel Corporation. All rights reserved.<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 @@ -39,7 +39,7 @@ GetPageTableBase (
   VOID
   )
 {
-  return (AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
+  return (UINTN)(AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
 }
 
 /**
--
2.12.2.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().
  2017-07-21 10:20 ` [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport() Marvin Häuser
@ 2017-07-26  3:05   ` Fan, Jeff
  0 siblings, 0 replies; 4+ messages in thread
From: Fan, Jeff @ 2017-07-26  3:05 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org

Reviewed-by: Jeff Fan <jeff.fan@intel.com>

Thanks!

-----Original Message-----
From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com] 
Sent: Friday, July 21, 2017 6:20 PM
To: edk2-devel@lists.01.org
Cc: Fan, Jeff
Subject: [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().

The documentation of PpinSupport() refers to 'Enhanced Intel SpeedStep'. This patch fixes these referneces.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c              | 4 ++--
 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
index 438578a83230..58e303448507 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Ppin.c
@@ -26,8 +26,8 @@
                                CPU_FEATURE_GET_CONFIG_DATA was not provided in
                                RegisterCpuFeature().
 
-  @retval TRUE     Enhanced Intel SpeedStep feature is supported.
-  @retval FALSE    Enhanced Intel SpeedStep feature is not supported.
+  @retval TRUE     Protected Processor Inventory Number feature is supported.
+  @retval FALSE    Protected Processor Inventory Number feature is not supported.
 
   @note This service could be called by BSP/APs.
 **/
diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
index c03e5ab0183f..c5bc62b20728 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeatures.h
@@ -866,8 +866,8 @@ FeatureControlGetConfigData (
                                CPU_FEATURE_GET_CONFIG_DATA was not provided in
                                RegisterCpuFeature().
 
-  @retval TRUE     Enhanced Intel SpeedStep feature is supported.
-  @retval FALSE    Enhanced Intel SpeedStep feature is not supported.
+  @retval TRUE     Protected Processor Inventory Number feature is supported.
+  @retval FALSE    Protected Processor Inventory Number feature is not supported.
 
   @note This service could be called by BSP/APs.
 **/
--
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-26  3:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170721101954.10248-1-Marvin.Haeuser@outlook.com>
2017-07-21 10:20 ` [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase() Marvin Häuser
2017-07-26  3:04   ` Fan, Jeff
2017-07-21 10:20 ` [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport() Marvin Häuser
2017-07-26  3:05   ` Fan, Jeff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox