[edk2-devel] [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol

Michael D Kinney posted 16 patches 6 years, 9 months ago
[edk2-devel] [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol
Posted by Michael D Kinney 6 years, 9 months ago
The NumberOfEnabledProcessors parameter to the MP Services
Protocol service GetNumberOfProcessors() is not optional and is
not allowed to be NULL.  Add the CpuEnabledCount local variable
and pass it into GetNumberOfProcessors().

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index 28de8457ce..3583e324e6 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -1,5 +1,5 @@
 /** 
-  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 
@@ -40,6 +40,7 @@ PpmPolicyEntry(
   EFI_HANDLE                Handle;
   EFI_STATUS                Status;
   UINTN                     CpuCount;
+  UINTN                     CpuEnabledCount;
   UINT8                     CPUMobileFeature;
 
   PCH_STEPPING              Stepping;
@@ -63,7 +64,7 @@ PpmPolicyEntry(
   //
   // Get processor count from MP service.
   //
-  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount, NULL);
+  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount, &CpuEnabledCount);
   ASSERT_EFI_ERROR (Status);
 
   //
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40250): https://edk2.groups.io/g/devel/message/40250
Mute This Topic: https://groups.io/mt/31551773/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol
Posted by Qian, Yi 6 years, 9 months ago
Reviewed by Qian, Yi <yi.qian@intel.com>

Thanks
QianYi

-----Original Message-----
From: Kinney, Michael D 
Sent: Thursday, May 9, 2019 12:31 PM
To: devel@edk2.groups.io
Cc: Sun, Zailiang <zailiang.sun@intel.com>; Qian, Yi <yi.qian@intel.com>
Subject: [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol

The NumberOfEnabledProcessors parameter to the MP Services Protocol service GetNumberOfProcessors() is not optional and is not allowed to be NULL.  Add the CpuEnabledCount local variable and pass it into GetNumberOfProcessors().

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index 28de8457ce..3583e324e6 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -1,5 +1,5 @@
 /**
-  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2019, Intel Corporation. All rights 
+ reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 
@@ -40,6 +40,7 @@ PpmPolicyEntry(
   EFI_HANDLE                Handle;
   EFI_STATUS                Status;
   UINTN                     CpuCount;
+  UINTN                     CpuEnabledCount;
   UINT8                     CPUMobileFeature;
 
   PCH_STEPPING              Stepping;
@@ -63,7 +64,7 @@ PpmPolicyEntry(
   //
   // Get processor count from MP service.
   //
-  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount, NULL);
+  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount, 
+ &CpuEnabledCount);
   ASSERT_EFI_ERROR (Status);
 
   //
--
2.21.0.windows.1



-- 
Qian Yi

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40341): https://edk2.groups.io/g/devel/message/40341
Mute This Topic: https://groups.io/mt/31551773/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services Protocol
Posted by Sun, Zailiang 6 years, 9 months ago
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Thursday, May 9, 2019 12:31 PM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang <zailiang.sun@intel.com>; Qian, Yi <yi.qian@intel.com>
> Subject: [Patch 04/16] Vlv2TbltDevicePkg/PpmPolicy: Fix call to MP Services
> Protocol
> 
> The NumberOfEnabledProcessors parameter to the MP Services Protocol
> service GetNumberOfProcessors() is not optional and is not allowed to be
> NULL.  Add the CpuEnabledCount local variable and pass it into
> GetNumberOfProcessors().
> 
> Cc: Zailiang Sun <zailiang.sun@intel.com>
> Cc: Yi Qian <yi.qian@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
> b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
> index 28de8457ce..3583e324e6 100644
> --- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
> +++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
> @@ -1,5 +1,5 @@
>  /**
> -  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2009 - 2019, Intel Corporation. All rights
> + reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> @@ -40,6 +40,7 @@ PpmPolicyEntry(
>    EFI_HANDLE                Handle;
>    EFI_STATUS                Status;
>    UINTN                     CpuCount;
> +  UINTN                     CpuEnabledCount;
>    UINT8                     CPUMobileFeature;
> 
>    PCH_STEPPING              Stepping;
> @@ -63,7 +64,7 @@ PpmPolicyEntry(
>    //
>    // Get processor count from MP service.
>    //
> -  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount,
> NULL);
> +  Status = MpService->GetNumberOfProcessors (MpService, &CpuCount,
> + &CpuEnabledCount);
>    ASSERT_EFI_ERROR (Status);
> 
>    //
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40293): https://edk2.groups.io/g/devel/message/40293
Mute This Topic: https://groups.io/mt/31551773/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-