public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] OvmfPkg: miscellaneous readability improvements
@ 2020-03-12 22:35 Laszlo Ersek
  2020-03-12 22:35 ` [PATCH 1/2] OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts Laszlo Ersek
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-03-12 22:35 UTC (permalink / raw)
  To: edk2-devel-groups-io
  Cc: Anthony Perard, Ard Biesheuvel, Jordan Justen, Julien Grall,
	Leif Lindholm, Philippe Mathieu-Daudé

Repo:   https://pagure.io/lersek/edk2.git
Branch: ovmfpkg_misc_readability

Implement two suggestions from Leif, from the

  [edk2-devel] [PATCH 0/5]
  OvmfPkg: improve SMM comms security with adaptive MemoryTypeInformation

  https://edk2.groups.io/g/devel/message/55726
  http://mid.mail-archive.com/20200310222739.26717-1-lersek@redhat.com

review thread.

Thanks
Laszlo

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien@xen.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>

Laszlo Ersek (2):
  OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts
  OvmfPkg: give more telling names to some FDF include files

 OvmfPkg/OvmfPkgIa32.fdf                                                | 4 ++--
 OvmfPkg/OvmfPkgIa32X64.fdf                                             | 4 ++--
 OvmfPkg/OvmfPkgX64.fdf                                                 | 4 ++--
 OvmfPkg/OvmfXen.fdf                                                    | 4 ++--
 OvmfPkg/PlatformPei/MemTypeInfo.c                                      | 6 ++++++
 OvmfPkg/{DecomprScratchEnd.fdf.inc => FvmainCompactScratchEnd.fdf.inc} | 0
 OvmfPkg/{OvmfPkg.fdf.inc => OvmfPkgDefines.fdf.inc}                    | 0
 7 files changed, 14 insertions(+), 8 deletions(-)
 rename OvmfPkg/{DecomprScratchEnd.fdf.inc => FvmainCompactScratchEnd.fdf.inc} (100%)
 rename OvmfPkg/{OvmfPkg.fdf.inc => OvmfPkgDefines.fdf.inc} (100%)

-- 
2.19.1.3.g30247aa5d201


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

* [PATCH 1/2] OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts
  2020-03-12 22:35 [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Laszlo Ersek
@ 2020-03-12 22:35 ` Laszlo Ersek
  2020-03-12 22:35 ` [PATCH 2/2] OvmfPkg: give more telling names to some FDF include files Laszlo Ersek
  2020-03-13  9:54 ` [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Leif Lindholm
  2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-03-12 22:35 UTC (permalink / raw)
  To: edk2-devel-groups-io
  Cc: Ard Biesheuvel, Jordan Justen, Leif Lindholm,
	Philippe Mathieu-Daudé

Add a code comment that explains the nature of the NumberOfPages field
values. Including this kind of historical information was suggested by
Leif in <https://edk2.groups.io/g/devel/message/55797> (alternative link:
<http://mid.mail-archive.com/20200312104006.GB23627@bivouac.eciton.net>).

Right now, the most recent commit updating the page counts has been commit
991d95636264 ("[...] Update default memory type information to reduce EFI
Memory Map fragmentation.", 2010-07-16).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Suggested-by: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/PlatformPei/MemTypeInfo.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTypeInfo.c
index c709236a457a..863c6f382680 100644
--- a/OvmfPkg/PlatformPei/MemTypeInfo.c
+++ b/OvmfPkg/PlatformPei/MemTypeInfo.c
@@ -19,6 +19,12 @@
 
 #include "Platform.h"
 
+//
+// The NumberOfPages values below are ad-hoc. They are updated sporadically at
+// best (please refer to git-blame for past updates). The values capture a set
+// of BIN hints that made sense at a particular time, for some (now likely
+// unknown) workloads / boot paths.
+//
 STATIC EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
   { EfiACPIMemoryNVS,       0x004 },
   { EfiACPIReclaimMemory,   0x008 },
-- 
2.19.1.3.g30247aa5d201



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

* [PATCH 2/2] OvmfPkg: give more telling names to some FDF include files
  2020-03-12 22:35 [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Laszlo Ersek
  2020-03-12 22:35 ` [PATCH 1/2] OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts Laszlo Ersek
@ 2020-03-12 22:35 ` Laszlo Ersek
  2020-03-13  9:54 ` [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Leif Lindholm
  2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-03-12 22:35 UTC (permalink / raw)
  To: edk2-devel-groups-io
  Cc: Anthony Perard, Ard Biesheuvel, Jordan Justen, Julien Grall,
	Leif Lindholm, Philippe Mathieu-Daudé

Leif suggested that FDF include files should preferably refer with their
names to the FDF file sections from which they are included.

Therefore

- rename "OvmfPkg.fdf.inc" to "OvmfPkgDefines.fdf.inc" (included from the
  [Defines] section),

- rename "DecomprScratchEnd.fdf.inc" to "FvmainCompactScratchEnd.fdf.inc"
  (included under the [FV.FVMAIN_COMPACT] section).

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien@xen.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: http://mid.mail-archive.com/20200312142006.GG23627@bivouac.eciton.net
Ref: https://edk2.groups.io/g/devel/message/55812
Suggested-by: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/OvmfPkgIa32.fdf                                                | 4 ++--
 OvmfPkg/OvmfPkgIa32X64.fdf                                             | 4 ++--
 OvmfPkg/OvmfPkgX64.fdf                                                 | 4 ++--
 OvmfPkg/OvmfXen.fdf                                                    | 4 ++--
 OvmfPkg/{DecomprScratchEnd.fdf.inc => FvmainCompactScratchEnd.fdf.inc} | 0
 OvmfPkg/{OvmfPkg.fdf.inc => OvmfPkgDefines.fdf.inc}                    | 0
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index f1a15de365fd..da5943769352 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -11,7 +11,7 @@
 ################################################################################
 
 [Defines]
-!include OvmfPkg.fdf.inc
+!include OvmfPkgDefines.fdf.inc
 
 #
 # Build the variable store and the firmware code as one unified flash device
@@ -397,7 +397,7 @@ [FV.FVMAIN_COMPACT]
    }
  }
 
-!include DecomprScratchEnd.fdf.inc
+!include FvmainCompactScratchEnd.fdf.inc
 
 ################################################################################
 
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 9e2eb78230e9..0e2a5caaf906 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -11,7 +11,7 @@
 ################################################################################
 
 [Defines]
-!include OvmfPkg.fdf.inc
+!include OvmfPkgDefines.fdf.inc
 
 #
 # Build the variable store and the firmware code as one unified flash device
@@ -400,7 +400,7 @@ [FV.FVMAIN_COMPACT]
    }
  }
 
-!include DecomprScratchEnd.fdf.inc
+!include FvmainCompactScratchEnd.fdf.inc
 
 ################################################################################
 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 9e2eb78230e9..0e2a5caaf906 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -11,7 +11,7 @@
 ################################################################################
 
 [Defines]
-!include OvmfPkg.fdf.inc
+!include OvmfPkgDefines.fdf.inc
 
 #
 # Build the variable store and the firmware code as one unified flash device
@@ -400,7 +400,7 @@ [FV.FVMAIN_COMPACT]
    }
  }
 
-!include DecomprScratchEnd.fdf.inc
+!include FvmainCompactScratchEnd.fdf.inc
 
 ################################################################################
 
diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf
index 5ca8081c0265..3c4164a5f50e 100644
--- a/OvmfPkg/OvmfXen.fdf
+++ b/OvmfPkg/OvmfXen.fdf
@@ -12,7 +12,7 @@
 ################################################################################
 
 [Defines]
-!include OvmfPkg.fdf.inc
+!include OvmfPkgDefines.fdf.inc
 
 #
 # This will allow the flash device image to be recognize as an ELF, with first
@@ -442,7 +442,7 @@ [FV.FVMAIN_COMPACT]
    }
  }
 
-!include DecomprScratchEnd.fdf.inc
+!include FvmainCompactScratchEnd.fdf.inc
 
 ################################################################################
 
diff --git a/OvmfPkg/DecomprScratchEnd.fdf.inc b/OvmfPkg/FvmainCompactScratchEnd.fdf.inc
similarity index 100%
rename from OvmfPkg/DecomprScratchEnd.fdf.inc
rename to OvmfPkg/FvmainCompactScratchEnd.fdf.inc
diff --git a/OvmfPkg/OvmfPkg.fdf.inc b/OvmfPkg/OvmfPkgDefines.fdf.inc
similarity index 100%
rename from OvmfPkg/OvmfPkg.fdf.inc
rename to OvmfPkg/OvmfPkgDefines.fdf.inc
-- 
2.19.1.3.g30247aa5d201


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

* Re: [PATCH 0/2] OvmfPkg: miscellaneous readability improvements
  2020-03-12 22:35 [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Laszlo Ersek
  2020-03-12 22:35 ` [PATCH 1/2] OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts Laszlo Ersek
  2020-03-12 22:35 ` [PATCH 2/2] OvmfPkg: give more telling names to some FDF include files Laszlo Ersek
@ 2020-03-13  9:54 ` Leif Lindholm
  2020-03-13 20:46   ` [edk2-devel] " Laszlo Ersek
  2 siblings, 1 reply; 5+ messages in thread
From: Leif Lindholm @ 2020-03-13  9:54 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: edk2-devel-groups-io, Anthony Perard, Ard Biesheuvel,
	Jordan Justen, Julien Grall, Philippe Mathieu-Daudé

On Thu, Mar 12, 2020 at 23:35:53 +0100, Laszlo Ersek wrote:
> Repo:   https://pagure.io/lersek/edk2.git
> Branch: ovmfpkg_misc_readability
> 
> Implement two suggestions from Leif, from the
> 
>   [edk2-devel] [PATCH 0/5]
>   OvmfPkg: improve SMM comms security with adaptive MemoryTypeInformation
> 
>   https://edk2.groups.io/g/devel/message/55726
>   http://mid.mail-archive.com/20200310222739.26717-1-lersek@redhat.com
> 
> review thread.

For the series:
Reviewed-by: Leif Lindholm <leif@nuviainc.com>

Thanks!

/
    Leif

> Thanks
> Laszlo
> 
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> Laszlo Ersek (2):
>   OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts
>   OvmfPkg: give more telling names to some FDF include files
> 
>  OvmfPkg/OvmfPkgIa32.fdf                                                | 4 ++--
>  OvmfPkg/OvmfPkgIa32X64.fdf                                             | 4 ++--
>  OvmfPkg/OvmfPkgX64.fdf                                                 | 4 ++--
>  OvmfPkg/OvmfXen.fdf                                                    | 4 ++--
>  OvmfPkg/PlatformPei/MemTypeInfo.c                                      | 6 ++++++
>  OvmfPkg/{DecomprScratchEnd.fdf.inc => FvmainCompactScratchEnd.fdf.inc} | 0
>  OvmfPkg/{OvmfPkg.fdf.inc => OvmfPkgDefines.fdf.inc}                    | 0
>  7 files changed, 14 insertions(+), 8 deletions(-)
>  rename OvmfPkg/{DecomprScratchEnd.fdf.inc => FvmainCompactScratchEnd.fdf.inc} (100%)
>  rename OvmfPkg/{OvmfPkg.fdf.inc => OvmfPkgDefines.fdf.inc} (100%)
> 
> -- 
> 2.19.1.3.g30247aa5d201
> 

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

* Re: [edk2-devel] [PATCH 0/2] OvmfPkg: miscellaneous readability improvements
  2020-03-13  9:54 ` [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Leif Lindholm
@ 2020-03-13 20:46   ` Laszlo Ersek
  0 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-03-13 20:46 UTC (permalink / raw)
  To: devel, leif
  Cc: Anthony Perard, Ard Biesheuvel, Jordan Justen, Julien Grall,
	Philippe Mathieu-Daudé

On 03/13/20 10:54, Leif Lindholm wrote:
> On Thu, Mar 12, 2020 at 23:35:53 +0100, Laszlo Ersek wrote:
>> Repo:   https://pagure.io/lersek/edk2.git
>> Branch: ovmfpkg_misc_readability
>>
>> Implement two suggestions from Leif, from the
>>
>>   [edk2-devel] [PATCH 0/5]
>>   OvmfPkg: improve SMM comms security with adaptive MemoryTypeInformation
>>
>>   https://edk2.groups.io/g/devel/message/55726
>>   http://mid.mail-archive.com/20200310222739.26717-1-lersek@redhat.com
>>
>> review thread.
> 
> For the series:
> Reviewed-by: Leif Lindholm <leif@nuviainc.com>

Commit range d42fdd6f8384..799d88c1bae7, via
<https://github.com/tianocore/edk2/pull/443>.

Thanks,
Laszlo


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

end of thread, other threads:[~2020-03-13 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-12 22:35 [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Laszlo Ersek
2020-03-12 22:35 ` [PATCH 1/2] OvmfPkg/PlatformPei: explain EFI_MEMORY_TYPE_INFORMATION page counts Laszlo Ersek
2020-03-12 22:35 ` [PATCH 2/2] OvmfPkg: give more telling names to some FDF include files Laszlo Ersek
2020-03-13  9:54 ` [PATCH 0/2] OvmfPkg: miscellaneous readability improvements Leif Lindholm
2020-03-13 20:46   ` [edk2-devel] " Laszlo Ersek

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