From nobody Thu May 9 00:51:50 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+71032+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+71032+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1612219481; cv=none; d=zohomail.com; s=zohoarc; b=S1Vba+qSLVlnij1AwineTqiA48pfLV9TtvuuMoRpngxQGvo+6PbAmKrYpM4xjtvXsmIca+SZW/EYIAO99hSFSxlrFdr4YUKUrb8qsnkvfIIqwk2QV8iZBCs52lJ8Ayrr+cQBf1aoJm//ZvyPGeFZkmfsKL3+9fL9GjMWgY2brzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612219481; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=rFWFHR0SnFVpxNGYfec123ash+7BJJdra8cffe43EUA=; b=GGFZivQLTc3ECoL7dwozAWS+AUeoNsIGH2WsNRskF9FqjgqLXGcS0yn0BM6GokSAE2xKII28CRccnQyg8SywIf1yt/Mxp+vfBEjY/O5uV46AdTT6ulwsGl1snP8mKs2MCUZpRtmsKURhgXk//BJrRF+olq02VsWTld8f8p6JPjI= 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+71032+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1612219481435928.7805116215466; Mon, 1 Feb 2021 14:44:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1GTtYY1788612xMNQySMZUBJ; Mon, 01 Feb 2021 14:44:41 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.43262.1612219480132605143 for ; Mon, 01 Feb 2021 14:44:40 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3470014F6; Mon, 1 Feb 2021 14:44:39 -0800 (PST) X-Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 214B73F718; Mon, 1 Feb 2021 14:44:39 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: pete@akeo.ie, awarkentin@vmware.com, samer.el-haj-mahmoud@arm.com, leif@nuviainc.com, ard.biesheuvel@arm.com, Jeremy Linton Subject: [edk2-devel] [BUG/PATCH] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled. Date: Mon, 1 Feb 2021 16:44:37 -0600 Message-Id: <20210201224437.2001658-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,jeremy.linton@arm.com X-Gm-Message-State: 3qDYcTrMiByhKZTvK2LEMDPwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1612219481; bh=vQNMFLIKNl2yNsA2CsregxO3TlCOtCz9+2PbMY78wdM=; h=Cc:Date:From:Reply-To:Subject:To; b=I2o0W+WQqpgOKVYhqKarRQw6i+eC/I/T0s0Ydk7dgnXvZMGA0zQ/uJxkDW/DW/jO8Gx 9Ceoh1N8BtQ/0tHBiYxj4UdA5h53R5Tul7ssCw8i5WgP45M0/Ic2/SVpL9ZdRDb+i8a58 65m6UtMO8A2fvlW9pZZOXSVhnIpJwCz4bnQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The 3G limit, and the 2G IORT are intended to solve the same linux problem, and limit PCI DMA operations to the first 3G of RAM. Older linux kernels, as used with RHEL/Centos, trigger an assertion* when a DMA operation starts that doesn't fit within the 2G range specified by the IORT. The simple solution is to only enable the IORT when the 3G flag is disabled. * https://github.com/pftf/RPi4/issues/123 Fixes: dac891da5cf3 ("Platform/RaspberryPi/AcpiTables: add a IORT ACPI tabl= e to limit XHCI DMA") Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 26 +++++++++++++++++-= ---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 19ef950f10..9581bc41e1 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -217,13 +217,23 @@ SetupVariables ( ASSERT_EFI_ERROR (Status); } =20 - if (mModelFamily >=3D 4 && mModelInstalledMB > 3 * 1024) { + if (mModelFamily >=3D 4) { + if (mModelInstalledMB > 3 * 1024) { + /* + * This allows changing PcdRamLimitTo3GB in forms. + */ + Status =3D PcdSet32S (PcdRamMoreThan3GB, 1); + ASSERT_EFI_ERROR (Status); + } else { + Status =3D PcdSet32S (PcdRamMoreThan3GB, 0); + ASSERT_EFI_ERROR (Status); + } + /* - * This allows changing PcdRamLimitTo3GB in forms. + * Enable the "3G ram limit" on 2GB device because we + * are going to utlize that limit as a new/old kernel + * flag and also disable the IORT if the 3G limit is set. */ - Status =3D PcdSet32S (PcdRamMoreThan3GB, 1); - ASSERT_EFI_ERROR (Status); - Size =3D sizeof (UINT32); Status =3D gRT->GetVariable (L"RamLimitTo3GB", &gConfigDxeFormSetGuid, @@ -755,6 +765,12 @@ HandleDynamicNamespace ( DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n")); =20 return FALSE; + case SIGNATURE_32 ('I', 'O', 'R', 'T'): + // only enable the IORT on machines with >3G and no limit + // to avoid problems with rhel/centos + if (PcdGet32 (PcdRamLimitTo3GB)) { + return FALSE; + } } =20 return TRUE; --=20 2.13.7 -=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 (#71032): https://edk2.groups.io/g/devel/message/71032 Mute This Topic: https://groups.io/mt/80300339/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-