[edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants

Rebecca Cran posted 1 patch 2 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20210612210749.75099-1-rebecca@bsdio.com
OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 -------
OvmfPkg/Bhyve/BhyveX64.dsc                   |  1 -
OvmfPkg/Bhyve/PlatformPei/Platform.h         | 17 -----------------
3 files changed, 25 deletions(-)
[edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants
Posted by Rebecca Cran 2 years, 9 months ago
Several Xen remnants were left over from adapting the Ovmf code for
Bhyve. Remove them.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 -------
 OvmfPkg/Bhyve/BhyveX64.dsc                   |  1 -
 OvmfPkg/Bhyve/PlatformPei/Platform.h         | 17 -----------------
 3 files changed, 25 deletions(-)

diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
index 994ee2c7cd..87c9bdafba 100644
--- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
@@ -18,7 +18,6 @@
 #include <Library/DebugLib.h>
 #include <Library/PcdLib.h>
 #include <Library/UefiBootServicesTableLib.h>
-#include <Library/XenPlatformLib.h>
 #include <IndustryStandard/Acpi.h>
 
 typedef struct {
@@ -46,12 +45,6 @@ BhyveInstallAcpiTable(
   OUT  UINTN                         *TableKey
   );
 
-EFI_STATUS
-EFIAPI
-InstallXenTables (
-  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
-  );
-
 EFI_STATUS
 EFIAPI
 InstallAcpiTables (
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index d8792812ab..25420d8261 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -219,7 +219,6 @@
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
-  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
 
 
 !if $(TPM_ENABLE) == TRUE
diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h b/OvmfPkg/Bhyve/PlatformPei/Platform.h
index 8239ca05ac..e0327202a5 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.h
+++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h
@@ -98,28 +98,11 @@ InstallClearCacheCallback (
   VOID
   );
 
-EFI_STATUS
-InitializeXen (
-  VOID
-  );
-
-BOOLEAN
-XenDetect (
-  VOID
-  );
-
 VOID
 AmdSevInitialize (
   VOID
   );
 
-extern BOOLEAN mXen;
-
-VOID
-XenPublishRamRegions (
-  VOID
-  );
-
 extern EFI_BOOT_MODE mBootMode;
 
 extern BOOLEAN mS3Supported;
-- 
2.32.0




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76437): https://edk2.groups.io/g/devel/message/76437
Mute This Topic: https://groups.io/mt/83497982/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants
Posted by Peter Grehan 2 years, 9 months ago
On 6/13/21 7:07 AM, Rebecca Cran wrote:
> Several Xen remnants were left over from adapting the Ovmf code for
> Bhyve. Remove them.
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>   OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 -------
>   OvmfPkg/Bhyve/BhyveX64.dsc                   |  1 -
>   OvmfPkg/Bhyve/PlatformPei/Platform.h         | 17 -----------------
>   3 files changed, 25 deletions(-)
> 
> diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> index 994ee2c7cd..87c9bdafba 100644
> --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> @@ -18,7 +18,6 @@
>   #include <Library/DebugLib.h>
>   #include <Library/PcdLib.h>
>   #include <Library/UefiBootServicesTableLib.h>
> -#include <Library/XenPlatformLib.h>
>   #include <IndustryStandard/Acpi.h>
>   
>   typedef struct {
> @@ -46,12 +45,6 @@ BhyveInstallAcpiTable(
>     OUT  UINTN                         *TableKey
>     );
>   
> -EFI_STATUS
> -EFIAPI
> -InstallXenTables (
> -  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
> -  );
> -
>   EFI_STATUS
>   EFIAPI
>   InstallAcpiTables (
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index d8792812ab..25420d8261 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -219,7 +219,6 @@
>     S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
>     SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
>     OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> -  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
>   
>   
>   !if $(TPM_ENABLE) == TRUE
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> index 8239ca05ac..e0327202a5 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.h
> +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> @@ -98,28 +98,11 @@ InstallClearCacheCallback (
>     VOID
>     );
>   
> -EFI_STATUS
> -InitializeXen (
> -  VOID
> -  );
> -
> -BOOLEAN
> -XenDetect (
> -  VOID
> -  );
> -
>   VOID
>   AmdSevInitialize (
>     VOID
>     );
>   
> -extern BOOLEAN mXen;
> -
> -VOID
> -XenPublishRamRegions (
> -  VOID
> -  );
> -
>   extern EFI_BOOT_MODE mBootMode;
>   
>   extern BOOLEAN mS3Supported;
> 

Reviewed-by: Peter Grehan <grehan@freebsd.org>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76439): https://edk2.groups.io/g/devel/message/76439
Mute This Topic: https://groups.io/mt/83497982/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants
Posted by Ard Biesheuvel 2 years, 9 months ago
On Sat, 12 Jun 2021 at 23:08, Rebecca Cran <rebecca@bsdio.com> wrote:
>
> Several Xen remnants were left over from adapting the Ovmf code for
> Bhyve. Remove them.
>
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>

Hi Rebecca,

This fails to apply. Is it perhaps conflicting with your TPM removal patch?

> ---
>  OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 -------
>  OvmfPkg/Bhyve/BhyveX64.dsc                   |  1 -
>  OvmfPkg/Bhyve/PlatformPei/Platform.h         | 17 -----------------
>  3 files changed, 25 deletions(-)
>
> diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> index 994ee2c7cd..87c9bdafba 100644
> --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> @@ -18,7 +18,6 @@
>  #include <Library/DebugLib.h>
>  #include <Library/PcdLib.h>
>  #include <Library/UefiBootServicesTableLib.h>
> -#include <Library/XenPlatformLib.h>
>  #include <IndustryStandard/Acpi.h>
>
>  typedef struct {
> @@ -46,12 +45,6 @@ BhyveInstallAcpiTable(
>    OUT  UINTN                         *TableKey
>    );
>
> -EFI_STATUS
> -EFIAPI
> -InstallXenTables (
> -  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
> -  );
> -
>  EFI_STATUS
>  EFIAPI
>  InstallAcpiTables (
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index d8792812ab..25420d8261 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -219,7 +219,6 @@
>    S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
>    SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
>    OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> -  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
>
>
>  !if $(TPM_ENABLE) == TRUE
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> index 8239ca05ac..e0327202a5 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.h
> +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> @@ -98,28 +98,11 @@ InstallClearCacheCallback (
>    VOID
>    );
>
> -EFI_STATUS
> -InitializeXen (
> -  VOID
> -  );
> -
> -BOOLEAN
> -XenDetect (
> -  VOID
> -  );
> -
>  VOID
>  AmdSevInitialize (
>    VOID
>    );
>
> -extern BOOLEAN mXen;
> -
> -VOID
> -XenPublishRamRegions (
> -  VOID
> -  );
> -
>  extern EFI_BOOT_MODE mBootMode;
>
>  extern BOOLEAN mS3Supported;
> --
> 2.32.0
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76599): https://edk2.groups.io/g/devel/message/76599
Mute This Topic: https://groups.io/mt/83497982/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants
Posted by Laszlo Ersek 2 years, 9 months ago
On 06/12/21 23:07, Rebecca Cran wrote:
> Several Xen remnants were left over from adapting the Ovmf code for
> Bhyve. Remove them.
> 
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>  OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 -------
>  OvmfPkg/Bhyve/BhyveX64.dsc                   |  1 -
>  OvmfPkg/Bhyve/PlatformPei/Platform.h         | 17 -----------------
>  3 files changed, 25 deletions(-)
> 
> diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> index 994ee2c7cd..87c9bdafba 100644
> --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> @@ -18,7 +18,6 @@
>  #include <Library/DebugLib.h>
>  #include <Library/PcdLib.h>
>  #include <Library/UefiBootServicesTableLib.h>
> -#include <Library/XenPlatformLib.h>
>  #include <IndustryStandard/Acpi.h>
>  
>  typedef struct {
> @@ -46,12 +45,6 @@ BhyveInstallAcpiTable(
>    OUT  UINTN                         *TableKey
>    );
>  
> -EFI_STATUS
> -EFIAPI
> -InstallXenTables (
> -  IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
> -  );
> -
>  EFI_STATUS
>  EFIAPI
>  InstallAcpiTables (
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index d8792812ab..25420d8261 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -219,7 +219,6 @@
>    S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
>    SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
>    OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> -  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
>  
>  
>  !if $(TPM_ENABLE) == TRUE
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> index 8239ca05ac..e0327202a5 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.h
> +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> @@ -98,28 +98,11 @@ InstallClearCacheCallback (
>    VOID
>    );
>  
> -EFI_STATUS
> -InitializeXen (
> -  VOID
> -  );
> -
> -BOOLEAN
> -XenDetect (
> -  VOID
> -  );
> -
>  VOID
>  AmdSevInitialize (
>    VOID
>    );
>  
> -extern BOOLEAN mXen;
> -
> -VOID
> -XenPublishRamRegions (
> -  VOID
> -  );
> -
>  extern EFI_BOOT_MODE mBootMode;
>  
>  extern BOOLEAN mS3Supported;
> 

(1) If we go for simple "xen" matches in source code, this looks mostly
okay, although I see two comments that could be fixed up additionally, in
- PlatformPei/Platform.c
- SmbiosPlatformDxe/SmbiosPlatformDxe.c

(pathnames relative to OvmfPkg/Bhyve)


(2) I hinted at a larger possible cleanup in commit e43cca74ad02
("OvmfPkg/Bhyve: make "PcdPciDisableBusEnumeration" Fixed-at-Build",
2021-06-04).

If you locate "PcdPciDisableBusEnumeration" instances under
OvmfPkg/Bhyve, and substitute constant TRUE for them, a bunch of already
dead code in OvmfPkg/Bhyve/AcpiPlatformDxe is *shown dead* too, and you
can excise it.

That does not make this patch wrong, of course.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76844): https://edk2.groups.io/g/devel/message/76844
Mute This Topic: https://groups.io/mt/83497982/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-