[edk2-devel] [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses

Leif Lindholm posted 2 patches 1 year, 5 months ago
[edk2-devel] [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
Posted by Leif Lindholm 1 year, 5 months ago
gArmTokenSpaceGuid.PcdGicDistributorBase and
gArmTokenSpaceGuid.PcdGicRedistributorsBase are both defined as UINT64 in
ArmPkg.dec, but SbsaQemuAcpiDxe and its exported header file use
PcdGet32. While this currently works, it will break once these Pcds are
made dynamic - so fix.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h   | 2 +-
 Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
index 4d5b05ba17c6..dcafcbca5a48 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
@@ -33,7 +33,7 @@
    EFI_ACPI_6_0_GICR,                        /* Type */                        \
    sizeof (EFI_ACPI_6_0_GICR_STRUCTURE),     /* Length */                      \
    EFI_ACPI_RESERVED_WORD,                   /* Reserved */                    \
-   FixedPcdGet32 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */   \
+   FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */   \
    SBSAQEMU_MADT_GICR_SIZE                   /* DiscoveryRangeLength */        \
    }
 
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
index 7ba9e8e9deeb..58330a3e7005 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
@@ -83,7 +83,7 @@ AddMadtTable (
   EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
     EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
       0,
-      FixedPcdGet32 (PcdGicDistributorBase),
+      FixedPcdGet64 (PcdGicDistributorBase),
       0,
       3 /* GicVersion */
     );
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104808): https://edk2.groups.io/g/devel/message/104808
Mute This Topic: https://groups.io/mt/98854531/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
Posted by Sami Mujawar 1 year, 5 months ago
Hi Leif,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 12/05/2023 06:57 pm, Leif Lindholm via groups.io wrote:
> gArmTokenSpaceGuid.PcdGicDistributorBase and
> gArmTokenSpaceGuid.PcdGicRedistributorsBase are both defined as UINT64 in
> ArmPkg.dec, but SbsaQemuAcpiDxe and its exported header file use
> PcdGet32. While this currently works, it will break once these Pcds are
> made dynamic - so fix.
>
> Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Graeme Gregory <graeme@xora.org.uk>
> Cc: Radoslaw Biernacki <rad@semihalf.com>
> Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>   Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h   | 2 +-
>   Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> index 4d5b05ba17c6..dcafcbca5a48 100644
> --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> @@ -33,7 +33,7 @@
>      EFI_ACPI_6_0_GICR,                        /* Type */                        \
>      sizeof (EFI_ACPI_6_0_GICR_STRUCTURE),     /* Length */                      \
>      EFI_ACPI_RESERVED_WORD,                   /* Reserved */                    \
> -   FixedPcdGet32 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */   \
> +   FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */   \
>      SBSAQEMU_MADT_GICR_SIZE                   /* DiscoveryRangeLength */        \
>      }
>   
> diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> index 7ba9e8e9deeb..58330a3e7005 100644
> --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> @@ -83,7 +83,7 @@ AddMadtTable (
>     EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
>       EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
>         0,
> -      FixedPcdGet32 (PcdGicDistributorBase),
> +      FixedPcdGet64 (PcdGicDistributorBase),
>         0,
>         3 /* GicVersion */
>       );


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