Skip to content

Commit 5a1c723

Browse files
pierregondoismergify[bot]
authored andcommitted
ArmVirtPkg: Kvmtool: Rely on InterruptMap to generate PCI related tables
Kvmtool always generates a PCI host device tree node. Thus PCI related ACPI tables are always generated. Rely on the presence of PCI devices in the interrupt-map information instead. Reported-by: Sarah Walker <[email protected]> Signed-off-by: Pierre Gondois <[email protected]>
1 parent 8c20804 commit 5a1c723

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManager.c

+27-22
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ GetStandardNameSpaceObject (
641641
EFI_STATUS Status;
642642
EDKII_PLATFORM_REPOSITORY_INFO *PlatformRepo;
643643
UINTN AcpiTableCount;
644+
BOOLEAN PciSupportPresent;
644645
CM_OBJ_DESCRIPTOR CmObjDesc;
645646

646647
if ((This == NULL) || (CmObject == NULL)) {
@@ -649,8 +650,9 @@ GetStandardNameSpaceObject (
649650
return EFI_INVALID_PARAMETER;
650651
}
651652

652-
Status = EFI_NOT_FOUND;
653-
PlatformRepo = This->PlatRepoInfo;
653+
Status = EFI_NOT_FOUND;
654+
PlatformRepo = This->PlatRepoInfo;
655+
PciSupportPresent = TRUE;
654656

655657
switch (GET_CM_OBJECT_ID (CmObjectId)) {
656658
case EStdObjCfgMgrInfo:
@@ -667,12 +669,12 @@ GetStandardNameSpaceObject (
667669
AcpiTableCount = ARRAY_SIZE (PlatformRepo->CmAcpiTableList);
668670

669671
//
670-
// Get Pci config space information.
672+
// Get Pci interrupt map information.
671673
//
672674
Status = DynamicPlatRepoGetObject (
673675
PlatformRepo->DynamicPlatformRepo,
674676
CREATE_CM_ARCH_COMMON_OBJECT_ID (
675-
EArchCommonObjPciConfigSpaceInfo
677+
EArchCommonObjPciInterruptMapInfo
676678
),
677679
CM_NULL_TOKEN,
678680
&CmObjDesc
@@ -683,31 +685,34 @@ GetStandardNameSpaceObject (
683685
// present, Kvmtool was launched without the PCIe option.
684686
// Therefore, reduce the table count by 3.
685687
//
686-
AcpiTableCount -= 3;
688+
AcpiTableCount -= 3;
689+
PciSupportPresent = FALSE;
687690
} else if (EFI_ERROR (Status)) {
688691
ASSERT_EFI_ERROR (Status);
689692
return Status;
690693
}
691694

692-
//
693-
// Get the Gic version.
694-
//
695-
Status = DynamicPlatRepoGetObject (
696-
PlatformRepo->DynamicPlatformRepo,
697-
CREATE_CM_ARM_OBJECT_ID (EArmObjGicDInfo),
698-
CM_NULL_TOKEN,
699-
&CmObjDesc
700-
);
701-
if (EFI_ERROR (Status)) {
702-
ASSERT_EFI_ERROR (Status);
703-
return Status;
704-
}
705-
706-
if (((CM_ARM_GICD_INFO *)CmObjDesc.Data)->GicVersion < 3) {
695+
if (PciSupportPresent) {
707696
//
708-
// IORT is only required for GicV3/4
697+
// Get the Gic version.
709698
//
710-
AcpiTableCount -= 1;
699+
Status = DynamicPlatRepoGetObject (
700+
PlatformRepo->DynamicPlatformRepo,
701+
CREATE_CM_ARM_OBJECT_ID (EArmObjGicDInfo),
702+
CM_NULL_TOKEN,
703+
&CmObjDesc
704+
);
705+
if (EFI_ERROR (Status)) {
706+
ASSERT_EFI_ERROR (Status);
707+
return Status;
708+
}
709+
710+
if (((CM_ARM_GICD_INFO *)CmObjDesc.Data)->GicVersion < 3) {
711+
//
712+
// IORT is only required for GicV3/4
713+
//
714+
AcpiTableCount -= 1;
715+
}
711716
}
712717

713718
Status = HandleCmObject (

0 commit comments

Comments
 (0)