Bug 283037 - update sys/contrib/edk2 to the latest version
Summary: update sys/contrib/edk2 to the latest version
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: vendor
Depends on:
Blocks:
 
Reported: 2024-11-29 09:09 UTC by Haowu Ge
Modified: 2024-12-01 01:38 UTC (History)
4 users (show)

See Also:


Attachments
upgrade edk2 (988.24 KB, patch)
2024-11-30 01:12 UTC, yu shan wei
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Haowu Ge 2024-11-29 09:09:18 UTC
hello all:
Currently, the version in sys/contrib/edk2 is stable202005. 
Is it possible to upgrade to the latest version edk2-stable202411? 
The new version of edk2 supports the LoongArch architecture,  
and we are attempting to enable FreeBSD support for the LoongArch architecture. 
Thank you.

https://github.com/tianocore/edk2/releases
Comment 1 yu shan wei 2024-11-30 01:12:03 UTC
Created attachment 255535 [details]
upgrade edk2
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2024-11-30 05:51:40 UTC
^Triage: reclassify this a bit.  Also add "vendor" Keyword.
Comment 3 Warner Losh freebsd_committer freebsd_triage 2024-11-30 21:50:57 UTC
Which files were you hoping would be updated?

Using the normal update instructions, I have:
 sys/contrib/edk2/MdePkg/Include/Base.h                                |  712 ++++++-----
 sys/contrib/edk2/MdePkg/Include/Guid/HiiFormMapMethodGuid.h           |    2 +-
 sys/contrib/edk2/MdePkg/Include/Guid/PcAnsi.h                         |   12 +-
 sys/contrib/edk2/MdePkg/Include/Guid/WinCertificate.h                 |   32 +-
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi10.h             |  473 +++----
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi20.h             |  348 ++---
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi30.h             |  464 +++----
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi40.h             | 1042 +++++++--------
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi50.h             | 1517 +++++++++++-----------
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi51.h             | 1631 +++++++++++------------
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Acpi60.h             | 1905 +++++++++++++--------------
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/AcpiAml.h            |  305 ++---
 sys/contrib/edk2/MdePkg/Include/IndustryStandard/Bluetooth.h          |   18 +-
 sys/contrib/edk2/MdePkg/Include/Library/BaseLib.h                     | 2848 ++++++++++++++++++++++-------------------
 sys/contrib/edk2/MdePkg/Include/Library/DebugLib.h                    |  237 +++-
 sys/contrib/edk2/MdePkg/Include/Library/DevicePathLib.h               |   38 +-
 sys/contrib/edk2/MdePkg/Include/Library/MemoryAllocationLib.h         |    2 +-
 sys/contrib/edk2/MdePkg/Include/Library/PcdLib.h                      |  848 ++----------
 sys/contrib/edk2/MdePkg/Include/Library/PrintLib.h                    |  151 +--
 sys/contrib/edk2/MdePkg/Include/Library/UefiBootServicesTableLib.h    |    4 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/DebugPort.h                  |   21 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/DevicePath.h                 |  592 ++++-----
 sys/contrib/edk2/MdePkg/Include/Protocol/DevicePathFromText.h         |   11 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/DevicePathToText.h           |   12 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/DevicePathUtilities.h        |   33 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/SimpleTextIn.h               |   19 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/SimpleTextInEx.h             |  124 +-
 sys/contrib/edk2/MdePkg/Include/Protocol/SimpleTextOut.h              |   96 +-
 sys/contrib/edk2/MdePkg/Include/Uefi.h                                |    1 -
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiBaseType.h                   |  145 ++-
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiGpt.h                        |   36 +-
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h | 1480 ++++++++++-----------
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiMultiPhase.h                 |   58 +-
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiPxe.h                        |  608 +++++----
 sys/contrib/edk2/MdePkg/Include/Uefi/UefiSpec.h                       |  489 +++----
 sys/contrib/edk2/MdePkg/MdeLibs.dsc.inc                               |   40 +
 sys/contrib/edk2/MdePkg/MdePkg.ci.yaml                                |  198 +++
 sys/contrib/edk2/MdePkg/MdePkg.dec                                    |  240 +++-
 sys/contrib/edk2/MdePkg/MdePkg.dsc                                    |  210 +++
 sys/contrib/edk2/MdePkg/MdePkg.uni                                    |  421 ++++++
 40 files changed, 9185 insertions(+), 8238 deletions(-)

which looks a lot like the diff you posted... Is that right (or close to right)?
Comment 4 Warner Losh freebsd_committer freebsd_triage 2024-11-30 23:00:53 UTC
Also, if there's a way to follow along via qemu I'd like to do that since I'm sure there will be boot loader things that come up....
Comment 5 Haowu Ge 2024-12-01 00:20:57 UTC
(In reply to Warner Losh from comment #4)

Is this response directed at me?

Yes, we are indeed trying to use QEMU for related work. 
 
I noticed that the EDK2 version included in the basic system
is from several years ago, so I suggested updating EDK2 to the latest version.
The latest version has added support for LoongArch,
which could potentially be helpful for me.
Comment 6 Haowu Ge 2024-12-01 01:18:02 UTC
(In reply to Warner Losh from comment #3)

I confirmed with yushanwei that he made it earlier on the edk2 master branch.
I reviewed it, and this patch version is definitely lower than the released "edk2-stable202411".

The last commit of "edk2-stable20241" modified "RETURN_ERROR(StatusCode)",
so its version is definitely lower than "edk2-stable20241".
https://github.com/tianocore/edk2/commit/1a89d9887ff41e804610c5687e646fe30af2d7b2

```
@@ -992,138 +1056,138 @@ typedef UINTN RETURN_STATUS;
   @retval FALSE         The high bit of StatusCode is clear.
 
 **/
-#define RETURN_ERROR(StatusCode)     (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
+#define RETURN_ERROR(StatusCode)  (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
 
 ///
 /// The operation completed successfully.
 ///
```

You can directly use your version update, 
or I can create a new patch with "edk2-stable20241". 
Thank you.
Comment 7 Warner Losh freebsd_committer freebsd_triage 2024-12-01 01:20:28 UTC
I'm really asking if you need new files imported inaddition to updating the subset of files included.
Comment 8 Haowu Ge 2024-12-01 01:38:02 UTC
(In reply to Warner Losh from comment #7)

Currently, MdePkg/Include/Protocol/MpService.h is still needed,
but I am not sure if this will conflict with the current FreeBSD import specifications,
so you can also update according to the original standard for now.