From nobody Tue Feb 10 04:17:30 2026 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+106474+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+106474+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1687968510; cv=none; d=zohomail.com; s=zohoarc; b=hFRzzebquB20rckHqENYee6cTqIsOiI0UHCLh5DQH6ESsQu29bj8KjK8hA6S831nT6y3dqrhUAoave+XvURgDrrfZYWgMEZjnKe/4KsSiBrLygXfzbnFaE9SDYqmJ2BGIyiTO/PjClqIt4gfMUQ0PEDwREgiojup7MuH9AEp6WQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687968510; 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=3IRZGqB2qepUblyeo3Ygxwiz8yMZcna+FErG1OYKBsE=; b=AJrmZKiIhOZlg/fJQxk3HCypvyn4qvQBRAQPoT662NW3f+eGDAS47Iq2RMhfi/8oOBCXMwCss8yCs+FYLvmCg4gYerlnmUQQVIbsT1TdJkfVx76XUXxDn7zhx5Ac7PCTn/VcqydMt8+P6mMuRfLq43gotokR1cB4KEQl7Bmf25Q= 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+106474+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 1687968510615794.0254702158833; Wed, 28 Jun 2023 09:08:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DvMmYY1788612xXh3sev1xli; Wed, 28 Jun 2023 09:08:30 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web10.20756.1687968508643159489 for ; Wed, 28 Jun 2023 09:08:28 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 3B9C5260249; Wed, 28 Jun 2023 18:08:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hf4PnNQRqyVb; Wed, 28 Jun 2023 18:08:25 +0200 (CEST) X-Received: from applejack.lan (83.21.150.32.ipv4.supernova.orange.pl [83.21.150.32]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 7FE9E26024B; Wed, 28 Jun 2023 18:08:23 +0200 (CEST) From: "Marcin Juszkiewicz" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Shashi Mallela , Marcin Juszkiewicz Subject: [edk2-devel] [PATCH edk2-platforms v1 2/2] Platform/QemuSbsa: handle lack of ITS in MADT Date: Wed, 28 Jun 2023 18:08:10 +0200 Message-ID: <20230628160810.676882-3-marcin.juszkiewicz@linaro.org> In-Reply-To: <20230628160810.676882-1-marcin.juszkiewicz@linaro.org> References: <20230628160810.676882-1-marcin.juszkiewicz@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,marcin.juszkiewicz@linaro.org X-Gm-Message-State: 7hSUhiaIWmDa5xnCOjSMwPs8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687968510; bh=egj0imJiG6IvLgg7CRzVDwA4PpvDAU929eooL8sr2V8=; h=Cc:Date:From:Reply-To:Subject:To; b=oFzS5UXBh6YkMcGwnBR19fDmeAQ8NkCAjwP4sp3ubtv3X3d/Tpw9Okwb6fvJV4AEynu fVyLxhkO/dlP42JlL6kP/ZVoKwwqFT4hyTX36H/TjqehUbf+A1dzK6YGujPpWx7c47czU koacw05IMmIhG+qPTz815tnGtUM02khscAU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687968511943100005 Content-Type: text/plain; charset="utf-8" If system does not have GIC ITS present then do not add ITS information in MADT. Signed-off-by: Marcin Juszkiewicz --- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index 961482269678..d5da3be272fc 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -56,6 +56,7 @@ AddMadtTable ( UINT8 *New; UINT32 NumCores; UINT32 CoreIndex; + UINTN GicItsBase; =20 // Initialize MADT ACPI Header EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header =3D { @@ -91,10 +92,7 @@ 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_5_GIC_ITS_STRUCTURE Gic_Its =3D SBSAQEMU_MADT_GIC_ITS_INIT(0); - - DEBUG ((DEBUG_ERROR, "itsBaseAddr is 0x%4x\n", PcdGet64 (PcdGicItsBase))= ); + GicItsBase =3D PcdGet64 (PcdGicItsBase); =20 // Get CoreCount which was determined eariler after parsing device tree NumCores =3D PcdGet32 (PcdCoreCount); @@ -103,8 +101,16 @@ 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_5_GIC_ITS_STRUCTURE); + sizeof (EFI_ACPI_6_0_GICR_STRUCTURE); + + // Initialize GIC ITS Structure + EFI_ACPI_6_5_GIC_ITS_STRUCTURE Gic_Its =3D SBSAQEMU_MADT_GIC_ITS_INIT(0); + + if (GicItsBase > 0) { + + DEBUG ((DEBUG_ERROR, "itsBaseAddr is 0x%8x\n", GicItsBase)); + TableSize +=3D sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE); + } =20 Status =3D gBS->AllocatePages ( AllocateAnyPages, @@ -144,9 +150,11 @@ 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_5_GIC_ITS_STRUCTURE)); - New +=3D sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE); + if (GicItsBase > 0) { + // GIC ITS Structure + CopyMem (New, &Gic_Its, sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE)); + New +=3D sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE); + } =20 AcpiPlatformChecksum ((UINT8*) PageAddress, TableSize); =20 --=20 2.41.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 (#106474): https://edk2.groups.io/g/devel/message/106474 Mute This Topic: https://groups.io/mt/99833913/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-