From nobody Mon Nov 25 03:51:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78784+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78784+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1628221797; cv=none; d=zohomail.com; s=zohoarc; b=kuIV77DUXi2G/aP3kjUhTESft3m79zcypssTUxefqWmDtpnLJi0AkcHuA2DnWlggql+Jl2YBSFjE5ZQgR5Xy1pKvlp3h2FnQnF8lBhooOqpoXVmYHzGlBHMLRlYl4b3KByWVXxZuX+mVYNP2lXxCpLpW3EcjN6OgaGfZgyZYBEM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628221797; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ll171LLOQBcvhEfOT+gFiDG4Z9owBcXrtQD+qCrUAoQ=; b=DzOzui/SRUYpv++8gNYV4dpy/rvUG+v1vC0gdeKVx61cID8HeSsv+aQ9ygX8hheJNo5qp2y1EA1jcuLy07cWWdP9WEekRs/bD23zjfDiwDP99d7Lc4/X1/v46GaJRRmZcenxuOiWls8arz6hFWmDtgSoFqE/5N9fRQjqHnPUzWY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78784+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628221797554914.2379091264755; Thu, 5 Aug 2021 20:49:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id A0nmYY1788612x3TF7fwNHnV; Thu, 05 Aug 2021 20:49:57 -0700 X-Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by mx.groups.io with SMTP id smtpd.web10.621.1628221796139515657 for ; Thu, 05 Aug 2021 20:49:56 -0700 X-Received: by mail-qk1-f176.google.com with SMTP id a19so8625892qkg.2 for ; Thu, 05 Aug 2021 20:49:56 -0700 (PDT) X-Gm-Message-State: aVL9T6hQKVq5IUJzMLBILD33x1787277AA= X-Google-Smtp-Source: ABdhPJwmcWsUIsrzWhg9Q/4RrkE7nFj2tvA0am6pN5C4zFPWgMRmGyybYDxD+N4Iv7pv383IhZVMGw== X-Received: by 2002:a37:a407:: with SMTP id n7mr6904375qke.471.1628221795332; Thu, 05 Aug 2021 20:49:55 -0700 (PDT) X-Received: from localhost.localdomain (bras-base-stsvon1503w-grc-22-142-114-143-47.dsl.bell.ca. [142.114.143.47]) by smtp.googlemail.com with ESMTPSA id 71sm3129972qtc.97.2021.08.05.20.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 20:49:55 -0700 (PDT) From: "Shashi Mallela" To: leif@nuviainc.com, ardb+tianocore@kernel.org, graeme@nuviainc.com Cc: devel@edk2.groups.io Subject: [edk2-devel] [PATCH RESEND v1 2/2] Silicon/Qemu: Update MADT with GICv3 ITS info Date: Thu, 5 Aug 2021 23:49:52 -0400 Message-Id: <20210806034952.6808-3-shashi.mallela@linaro.org> In-Reply-To: <20210806034952.6808-1-shashi.mallela@linaro.org> References: <20210806034952.6808-1-shashi.mallela@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shashi.mallela@linaro.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628221797; bh=yErZG1fz2Wme/A/3NcrdusibYUGoXEjMRZ1ph9X3x0M=; h=Cc:Date:From:Reply-To:Subject:To; b=USDNDusMmEp36FA+4z/NtiRm+MDN+TmbS15L/5WxlltMXoL6G0xYnBCPAeV72pjLHfE wgtJpjvoUQe9vfdIhSC7ogUprCifAR9AFKqdSskpyjyWJsaiv3o6aDeb00I2zFVR9HWWV EACBuRosoI2PlswYEEdUU6JnE6m2gaWVbj4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628221799381100008 Content-Type: text/plain; charset="utf-8" For Qemu sbsa-ref platforms,to enable detection of GICv3 Interrupt Translation Service capability in the ACPI MADT,the GIC ITS structure is created with the relevant values for each of its fields.The existing MADT functionality is extended to include GIC ITS structure presence as well. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Graeme Gregory Signed-off-by: Shashi Mallela --- Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 3 +++ Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 2 ++ Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 2 ++ Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 10 +++= +++++++ Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 10 +++= ++++++- 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec b/Silicon/Qemu/SbsaQemu/Sbs= aQemu.dec index 9448852967b6..8654cc7c858c 100644 --- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec +++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec @@ -36,6 +36,9 @@ [PcdsFixedAtBuild.common] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize|0x10000|UINT3= 2|0x00000004 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x100000= 00000|UINT64|0x00000005 =20 + # ARM Generic Interrupt Controller ITS + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase|0|UINT64|0x0000000F + # PCDs complementing PCIe layout pulled into ACPI tables # Limit =3D Base + Size - 1 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciIoLimit|0x0000ffff|UINT32|0= x00000006 diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu= /SbsaQemu/AcpiTables/AcpiTables.inf index 9be34488eb7a..5616b73178ff 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -74,3 +74,5 @@ [FixedPcd] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciBase gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize + + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf index c6de685bd2c4..2eb6577fd077 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf @@ -65,3 +65,5 @@ [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision + + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h = b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h index 4d5b05ba17c6..5f9e9477bf6a 100644 --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h @@ -37,6 +37,16 @@ SBSAQEMU_MADT_GICR_SIZE /* DiscoveryRangeLength */ = \ } =20 +// Macro for MADT GIC ITS Structure +#define SBSAQEMU_MADT_GIC_ITS_INIT() { = \ + EFI_ACPI_6_0_GIC_ITS, /* Type */ = \ + sizeof (EFI_ACPI_6_0_GIC_ITS_STRUCTURE), /* Length */ = \ + EFI_ACPI_RESERVED_WORD, /* Reserved */ = \ + 0, /* GicItsId */ = \ + FixedPcdGet64 (PcdGicItsBase), /* PhysicalBaseAddress */ = \ + EFI_ACPI_RESERVED_DWORD /* Reserved */ = \ + } + #define SBSAQEMU_ACPI_SCOPE_OP_MAX_LENGTH 5 =20 #define SBSAQEMU_ACPI_SCOPE_NAME { '_', 'S', 'B', '_' } diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index b8901030ecd0..9d6a4b36cbe9 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -91,6 +91,9 @@ AddMadtTable ( // Initialize GIC Redistributor Structure EFI_ACPI_6_0_GICR_STRUCTURE Gicr =3D SBSAQEMU_MADT_GICR_INIT(); =20 + // Initialize GIC ITS Structure + EFI_ACPI_6_0_GIC_ITS_STRUCTURE Gic_Its =3D SBSAQEMU_MADT_GIC_ITS_INIT(); + // Get CoreCount which was determined eariler after parsing device tree NumCores =3D PcdGet32 (PcdCoreCount); =20 @@ -98,7 +101,8 @@ AddMadtTable ( TableSize =3D sizeof (EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADE= R) + (sizeof (EFI_ACPI_6_0_GIC_STRUCTURE) * NumCores) + sizeof (EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE) + - sizeof (EFI_ACPI_6_0_GICR_STRUCTURE); + sizeof (EFI_ACPI_6_0_GICR_STRUCTURE) + + sizeof (EFI_ACPI_6_0_GIC_ITS_STRUCTURE); =20 Status =3D gBS->AllocatePages ( AllocateAnyPages, @@ -138,6 +142,10 @@ AddMadtTable ( CopyMem (New, &Gicr, sizeof (EFI_ACPI_6_0_GICR_STRUCTURE)); New +=3D sizeof (EFI_ACPI_6_0_GICR_STRUCTURE); =20 + // GIC ITS Structure + CopyMem (New, &Gic_Its, sizeof (EFI_ACPI_6_0_GIC_ITS_STRUCTURE)); + New +=3D sizeof (EFI_ACPI_6_0_GIC_ITS_STRUCTURE); + AcpiPlatformChecksum ((UINT8*) PageAddress, TableSize); =20 Status =3D AcpiTable->InstallAcpiTable ( --=20 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78784): https://edk2.groups.io/g/devel/message/78784 Mute This Topic: https://groups.io/mt/84701318/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-