Skip to content

Commit

Permalink
Merge branch 'master' into httpbootcallback-uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 15, 2024
2 parents 733d4aa + 1f32b5a commit c411076
Show file tree
Hide file tree
Showing 18 changed files with 574 additions and 65 deletions.
34 changes: 34 additions & 0 deletions MdePkg/Include/Library/FdtLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,40 @@ FdtSubnodeOffsetNameLen (
IN INT32 NameLength
);

/**
Returns number of reserved ranges.
@param[in] Fdt The pointer to FDT blob.
@return The number of reserved ranges.
**/
INTN
EFIAPI
FdtNumRsv (
IN CONST VOID *Fdt
);

/**
Returns reserved ranges.
@param[in] *Fdt The pointer to FDT blob.
@param[in] Index Reserved entry index in the table.
@param[out] Addr Address returned
@param[out] *Size Pointer to size of the address range
@return Returns reserved range.
**/
INTN
EFIAPI
FdtGetMemRsv (
IN CONST VOID *Fdt,
IN INTN Index,
OUT UINT64 *Addr,
OUT UINT64 *Size
);

/**
Returns a offset of first node which includes the given property name and value.
Expand Down
41 changes: 41 additions & 0 deletions MdePkg/Library/BaseFdtLib/FdtLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**/

#include <libfdt/libfdt/libfdt.h>
#include <Uefi/UefiBaseType.h>

/**
Convert UINT16 data of the FDT blob to little-endian
Expand Down Expand Up @@ -205,6 +206,46 @@ FdtNextSubnode (
return fdt_next_subnode (Fdt, Offset);
}

/**
Returns number of reserved mem nodes
@param[in] Fdt The pointer to FDT blob.
@return total reserved mem nodes
**/
INTN
EFIAPI
FdtNumRsv (
IN CONST VOID *Fdt
)
{
return fdt_num_mem_rsv (Fdt);
}

/**
Returns reserved ranges.
@param[in] *Fdt The pointer to FDT blob.
@param[in] Index Reserved entry index in the table.
@param[out] Addr Address returned
@param[out] *Size Pointer to size of the address range
@return Returns reserved range.
**/
INTN
EFIAPI
FdtGetMemRsv (
IN CONST VOID *Fdt,
IN INTN Index,
OUT EFI_PHYSICAL_ADDRESS *Addr,
OUT UINT64 *Size
)
{
return fdt_get_mem_rsv (Fdt, Index, Addr, Size);
}

/**
Returns a offset of first node which includes the given name.
Expand Down
5 changes: 5 additions & 0 deletions OvmfPkg/CpuHotplugSmm/CpuHotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ EjectCpu (
//
QemuSelector = mCpuHotEjectData->QemuSelectorMap[ProcessorNum];
if (QemuSelector == CPU_EJECT_QEMU_SELECTOR_INVALID) {
/* wait until BSP is done */
while (mCpuHotEjectData->Handler != NULL) {
CpuPause ();
}

return;
}

Expand Down
15 changes: 15 additions & 0 deletions OvmfPkg/Library/PlatformInitLib/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <Guid/SystemNvDataGuid.h>
#include <Guid/VariableFormat.h>
#include <OvmfPlatforms.h>
#include <Library/TdxLib.h>

#include <Library/PlatformInitLib.h>

Expand Down Expand Up @@ -563,6 +564,20 @@ PlatformMaxCpuCountInitialization (
UINT16 BootCpuCount = 0;
UINT32 MaxCpuCount;

if (TdIsEnabled ()) {
BootCpuCount = (UINT16)TdVCpuNum ();
MaxCpuCount = TdMaxVCpuNum ();

if (BootCpuCount > MaxCpuCount) {
DEBUG ((DEBUG_ERROR, "%a: Failed with BootCpuCount (%d) more than MaxCpuCount(%u) \n", __func__, BootCpuCount, MaxCpuCount));
ASSERT (FALSE);
}

PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber = MaxCpuCount;
PlatformInfoHob->PcdCpuBootLogicalProcessorNumber = BootCpuCount;
return;
}

//
// Try to fetch the boot CPU count.
//
Expand Down
2 changes: 0 additions & 2 deletions OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
PcdLib
PciLib
PeiHardwareInfoLib

[LibraryClasses.X64]
TdxLib

[Guids]
Expand Down
1 change: 1 addition & 0 deletions OvmfPkg/OvmfPkgIa32.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf

[LibraryClasses.common.SEC]
Expand Down
32 changes: 32 additions & 0 deletions UefiPayloadPkg/Include/Guid/PciSegmentInfoGuid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @file
This file defines the hob structure for PCI Segment related information.
Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef UPL_PCI_SEGMENT_INFO_GUID_H_
#define UPL_PCI_SEGMENT_INFO_GUID_H_

///
/// UPL Pcie Segment Information Hob GUID
///
extern EFI_GUID gUplPciSegmentInfoHobGuid;

#pragma pack(1)
typedef struct {
UINT16 SegmentNumber; ///< Segment number.
UINT64 BaseAddress; ///< ECAM Base address.
} UPL_SEGMENT_INFO;

typedef struct {
UNIVERSAL_PAYLOAD_GENERIC_HEADER Header;
UINTN Count;
UPL_SEGMENT_INFO SegmentInfo[0];
} UPL_PCI_SEGMENT_INFO_HOB;
#pragma pack()

#define UNIVERSAL_PAYLOAD_PCI_SEGMENT_INFO_REVISION 1

#endif
3 changes: 2 additions & 1 deletion UefiPayloadPkg/Library/FdtParserLib/FdtParseLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
gEfiGraphicsDeviceInfoHobGuid
gUniversalPayloadAcpiTableGuid
gUniversalPayloadSerialPortInfoGuid
gUplPciSegmentInfoHobGuid

[Pcd.IA32,Pcd.X64]
[Pcd.IA32,Pcd.X64,Pcd.RISCV64]
gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
gUefiPayloadPkgTokenSpaceGuid.PcdHandOffFdtEnable
Expand Down
Loading

0 comments on commit c411076

Please sign in to comment.