From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.4103.1613542081115683745 for ; Tue, 16 Feb 2021 22:08:01 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: gmail.com, ip: 217.140.110.172, mailfrom: lintonrjeremy@gmail.com) 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 5344C31B; Tue, 16 Feb 2021 22:08:00 -0800 (PST) Received: from u200856.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 080653F73B; Tue, 16 Feb 2021 22:08:00 -0800 (PST) From: jlinton To: devel@edk2.groups.io Cc: pete@akeo.ie, awarkentin@vmware.com, samer.el-haj-mahmoud@arm.com, leif@nuviainc.com, ardb+tianocore@kernel.org, Jeremy Linton Subject: [PATCH v2] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled. Date: Wed, 17 Feb 2021 00:07:44 -0600 Message-Id: <20210217060744.307354-1-lintonrjeremy@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeremy Linton The 3G limit, and the 2G IORT are intended to solve the same linux problem. They 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 at a range 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 and there is more than 3G installed. * 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 19ef950f10..578f5ead8f 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -755,6 +755,12 @@ HandleDynamicNamespace ( DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n"));=0D =0D return FALSE;=0D + case SIGNATURE_32 ('I', 'O', 'R', 'T'):=0D + // only enable the IORT on machines with >3G and no limit=0D + // to avoid problems with rhel/centos and other older OSs=0D + if (PcdGet32 (PcdRamLimitTo3GB) || !PcdGet32 (PcdRamMoreThan3GB)) {=0D + return FALSE;=0D + }=0D }=0D =0D return TRUE;=0D --=20 2.13.7