From 43130ae4034cdcf0fa0ff928105fbe3e52d9f628 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 24 Jul 2024 23:04:35 +0200 Subject: [PATCH] ArmPkg: Convert PcdMonitorConduitHvc to FixedAtBuild Feature PCDs and fixed-at-build PCDs are identical in concept, but the latter are accessible from assembler, whereas the former are not. So convert the SMCCC conduit selection PCD to fixed-at-build so we can make use of this in a subsequent patch. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Ard Biesheuvel --- ArmPkg/ArmPkg.dec | 10 +++++----- ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c | 2 +- ArmVirtPkg/ArmVirt.dsc.inc | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index c0861140e8..49cbffa5fc 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -135,11 +135,6 @@ # Define if the GICv3 controller should use the GICv2 legacy gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042 - ## Define the conduit to use for monitor calls. - # Default PcdMonitorConduitHvc = FALSE, conduit = SMC - # If PcdMonitorConduitHvc = TRUE, conduit = HVC - gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047 - # Whether to remap all unused memory NX before installing the CPU arch # protocol driver. This is needed on platforms that map all DRAM with RWX # attributes initially, and can be disabled otherwise. @@ -229,6 +224,11 @@ # gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable|FALSE|BOOLEAN|0x0000052 + ## Define the conduit to use for monitor calls. + # Default PcdMonitorConduitHvc = FALSE, conduit = SMC + # If PcdMonitorConduitHvc = TRUE, conduit = HVC + gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047 + [PcdsFixedAtBuild.common, PcdsPatchableInModule.common] gArmTokenSpaceGuid.PcdFdBaseAddress|0|UINT64|0x0000002B gArmTokenSpaceGuid.PcdFvBaseAddress|0|UINT64|0x0000002D diff --git a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c index 741f5c6157..72f71296e5 100644 --- a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c +++ b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c @@ -26,7 +26,7 @@ ArmMonitorCall ( IN OUT ARM_MONITOR_ARGS *Args ) { - if (FeaturePcdGet (PcdMonitorConduitHvc)) { + if (FixedPcdGetBool (PcdMonitorConduitHvc)) { ArmCallHvc ((ARM_HVC_ARGS *)Args); } else { ArmCallSmc ((ARM_SMC_ARGS *)Args); diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 038931562c..eb0bca24ea 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -289,8 +289,6 @@ gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE - gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE - [PcdsFeatureFlag.AARCH64] # # Activate AcpiSdtProtocol @@ -298,6 +296,8 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE [PcdsFixedAtBuild.common] + gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE + !ifdef $(FIRMWARE_VER) gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)" !endif