public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
@ 2016-12-12  6:35 Jiewen Yao
  2016-12-12  6:53 ` Zeng, Star
  0 siblings, 1 reply; 6+ messages in thread
From: Jiewen Yao @ 2016-12-12  6:35 UTC (permalink / raw)
  To: edk2-devel; +Cc: Chao Zhang, Star Zeng

Tcg2Dxe allocates event log below 4G. It is unnecessary.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index 9e8dfae..ca28301 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -1396,7 +1396,7 @@ SetupEventLog (
       mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
       Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
       Status = gBS->AllocatePages (
-                      AllocateMaxAddress,
+                      AllocateAnyPages,
                       EfiBootServicesData,
                       EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
                       &Lasa
@@ -1498,7 +1498,7 @@ SetupEventLog (
       if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
         Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
         Status = gBS->AllocatePages (
-                        AllocateMaxAddress,
+                        AllocateAnyPages,
                         EfiACPIMemoryNVS,
                         EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
                         &Lasa
-- 
2.7.4.windows.1



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

* Re: [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
  2016-12-12  6:35 Jiewen Yao
@ 2016-12-12  6:53 ` Zeng, Star
  2016-12-12  6:55   ` Yao, Jiewen
  0 siblings, 1 reply; 6+ messages in thread
From: Zeng, Star @ 2016-12-12  6:53 UTC (permalink / raw)
  To: Jiewen Yao, edk2-devel; +Cc: Chao Zhang, star.zeng

Jiewen,

Minor comments added inline below.

On 2016/12/12 14:35, Jiewen Yao wrote:
> Tcg2Dxe allocates event log below 4G. It is unnecessary.
>
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> index 9e8dfae..ca28301 100644
> --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> @@ -1396,7 +1396,7 @@ SetupEventLog (
>        mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
>        Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

How about also removing this line to reduce confusion?

>        Status = gBS->AllocatePages (
> -                      AllocateMaxAddress,
> +                      AllocateAnyPages,
>                        EfiBootServicesData,
>                        EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
>                        &Lasa
> @@ -1498,7 +1498,7 @@ SetupEventLog (
>        if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
>          Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

Same comment with above.

Thanks,
Star

>          Status = gBS->AllocatePages (
> -                        AllocateMaxAddress,
> +                        AllocateAnyPages,
>                          EfiACPIMemoryNVS,
>                          EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
>                          &Lasa
>



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

* Re: [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
  2016-12-12  6:53 ` Zeng, Star
@ 2016-12-12  6:55   ` Yao, Jiewen
  2016-12-12  6:56     ` Zeng, Star
  0 siblings, 1 reply; 6+ messages in thread
From: Yao, Jiewen @ 2016-12-12  6:55 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Zhang, Chao B

Yes, I agree.

From: Zeng, Star
Sent: Monday, December 12, 2016 2:54 PM
To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org
Cc: Zhang, Chao B <chao.b.zhang@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: Re: [edk2] [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation

Jiewen,

Minor comments added inline below.

On 2016/12/12 14:35, Jiewen Yao wrote:
> Tcg2Dxe allocates event log below 4G. It is unnecessary.
>
> Cc: Chao Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Cc: Star Zeng <star.zeng@intel.com<mailto:star.zeng@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> ---
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> index 9e8dfae..ca28301 100644
> --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> @@ -1396,7 +1396,7 @@ SetupEventLog (
>        mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
>        Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

How about also removing this line to reduce confusion?

>        Status = gBS->AllocatePages (
> -                      AllocateMaxAddress,
> +                      AllocateAnyPages,
>                        EfiBootServicesData,
>                        EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
>                        &Lasa
> @@ -1498,7 +1498,7 @@ SetupEventLog (
>        if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
>          Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

Same comment with above.

Thanks,
Star

>          Status = gBS->AllocatePages (
> -                        AllocateMaxAddress,
> +                        AllocateAnyPages,
>                          EfiACPIMemoryNVS,
>                          EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
>                          &Lasa
>


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

* Re: [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
  2016-12-12  6:55   ` Yao, Jiewen
@ 2016-12-12  6:56     ` Zeng, Star
  0 siblings, 0 replies; 6+ messages in thread
From: Zeng, Star @ 2016-12-12  6:56 UTC (permalink / raw)
  To: Yao, Jiewen, edk2-devel@lists.01.org; +Cc: Zhang, Chao B, Zeng, Star

With that, Reviewed-by: Star Zeng <star.zeng@intel.com>

From: Yao, Jiewen
Sent: Monday, December 12, 2016 2:55 PM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
Cc: Zhang, Chao B <chao.b.zhang@intel.com>
Subject: RE: [edk2] [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation

Yes, I agree.

From: Zeng, Star
Sent: Monday, December 12, 2016 2:54 PM
To: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Zhang, Chao B <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>; Zeng, Star <star.zeng@intel.com<mailto:star.zeng@intel.com>>
Subject: Re: [edk2] [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation

Jiewen,

Minor comments added inline below.

On 2016/12/12 14:35, Jiewen Yao wrote:
> Tcg2Dxe allocates event log below 4G. It is unnecessary.
>
> Cc: Chao Zhang <chao.b.zhang@intel.com<mailto:chao.b.zhang@intel.com>>
> Cc: Star Zeng <star.zeng@intel.com<mailto:star.zeng@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> ---
>  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> index 9e8dfae..ca28301 100644
> --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> @@ -1396,7 +1396,7 @@ SetupEventLog (
>        mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
>        Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

How about also removing this line to reduce confusion?

>        Status = gBS->AllocatePages (
> -                      AllocateMaxAddress,
> +                      AllocateAnyPages,
>                        EfiBootServicesData,
>                        EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
>                        &Lasa
> @@ -1498,7 +1498,7 @@ SetupEventLog (
>        if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
>          Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);

Same comment with above.

Thanks,
Star

>          Status = gBS->AllocatePages (
> -                        AllocateMaxAddress,
> +                        AllocateAnyPages,
>                          EfiACPIMemoryNVS,
>                          EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
>                          &Lasa
>


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

* [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
@ 2016-12-12  7:02 Jiewen Yao
  2016-12-13  1:16 ` Zhang, Chao B
  0 siblings, 1 reply; 6+ messages in thread
From: Jiewen Yao @ 2016-12-12  7:02 UTC (permalink / raw)
  To: edk2-devel; +Cc: Chao Zhang, Star Zeng

Tcg2Dxe allocates event log below 4G. It is unnecessary.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index 9e8dfae..cf2fe4e 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -1394,9 +1394,8 @@ SetupEventLog (
   for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) {
     if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {
       mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
-      Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
       Status = gBS->AllocatePages (
-                      AllocateMaxAddress,
+                      AllocateAnyPages,
                       EfiBootServicesData,
                       EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
                       &Lasa
@@ -1496,9 +1495,8 @@ SetupEventLog (
   for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) {
     if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {
       if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-        Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
         Status = gBS->AllocatePages (
-                        AllocateMaxAddress,
+                        AllocateAnyPages,
                         EfiACPIMemoryNVS,
                         EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
                         &Lasa
-- 
2.7.4.windows.1



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

* Re: [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation
  2016-12-12  7:02 [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation Jiewen Yao
@ 2016-12-13  1:16 ` Zhang, Chao B
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Chao B @ 2016-12-13  1:16 UTC (permalink / raw)
  To: Yao, Jiewen, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>





Thanks & Best regards
Chao Zhang

-----Original Message-----
From: Yao, Jiewen 
Sent: Monday, December 12, 2016 3:03 PM
To: edk2-devel@lists.01.org
Cc: Zhang, Chao B; Zeng, Star
Subject: [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation

Tcg2Dxe allocates event log below 4G. It is unnecessary.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
---
 SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index 9e8dfae..cf2fe4e 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -1394,9 +1394,8 @@ SetupEventLog (
   for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) {
     if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {
       mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;
-      Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
       Status = gBS->AllocatePages (
-                      AllocateMaxAddress,
+                      AllocateAnyPages,
                       EfiBootServicesData,
                       EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
                       &Lasa
@@ -1496,9 +1495,8 @@ SetupEventLog (
   for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) {
     if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {
       if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-        Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1);
         Status = gBS->AllocatePages (
-                        AllocateMaxAddress,
+                        AllocateAnyPages,
                         EfiACPIMemoryNVS,
                         EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)),
                         &Lasa
-- 
2.7.4.windows.1



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

end of thread, other threads:[~2016-12-13  1:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12  7:02 [PATCH] SecurityPkg:/Tcg2Dxe: remove 4G limitation Jiewen Yao
2016-12-13  1:16 ` Zhang, Chao B
  -- strict thread matches above, loose matches on Subject: below --
2016-12-12  6:35 Jiewen Yao
2016-12-12  6:53 ` Zeng, Star
2016-12-12  6:55   ` Yao, Jiewen
2016-12-12  6:56     ` Zeng, Star

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