From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web08.7263.1613832245902102343 for ; Sat, 20 Feb 2021 06:44:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AAM/lecF; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D8D964EE1 for ; Sat, 20 Feb 2021 14:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613832245; bh=QMjKNyugzyU2M6dkQfJQ+LRO7Q/JxUlHwGuFkbBrofI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AAM/lecFSjmS/TiMUA3IRE1RpOJtSOZioxNOLi4DJIsU/amAHjxQ2sAybMhqKzddy Birm3fhZdu1oyI913M/LzTaZXHclFkmbnwzyCkJEkmNngg7NvPEp0bttVCha6Yx3yq n/iDQ2wd6UnBSws1AGpcFCUSzMAoGzGDdZmuolXyWoG/raLwLZA+DKo4HusyPgyKo+ RLmGWzP6+kFhQN7lbRD3HpzFi1zEtBIxJ+DXkVN1xtjp6tHM3MCcXbT5k/E2Ekrs7t YSGssRPXM23TGhbvh6naLvO820m6H/HnLyR//lzG6vgHaNeKeHZC6X0aNv72NItWCS PqAlPIzZb0MZg== Received: by mail-ot1-f51.google.com with SMTP id s107so7873958otb.8 for ; Sat, 20 Feb 2021 06:44:05 -0800 (PST) X-Gm-Message-State: AOAM533TT/BF8TaReCRWcvVtDGBRS0QQ/O/57hg1Cx5wYK/RTXFNkZ3o /Ynli1EMfNwX2vtLpJjko55DTUcsg6sfC6B4SkA= X-Google-Smtp-Source: ABdhPJz6ZQw89YmpZ8EdI8V5jIfOccdIZUgq1UVVlwp5eK5s6L/iAAqv+7ZtHDR+iwjyxWuFXAzC1d73vlV/ScWVKkw= X-Received: by 2002:a05:6830:1285:: with SMTP id z5mr10960056otp.90.1613832244654; Sat, 20 Feb 2021 06:44:04 -0800 (PST) MIME-Version: 1.0 References: <20210217060744.307354-1-lintonrjeremy@gmail.com> In-Reply-To: From: "Ard Biesheuvel" Date: Sat, 20 Feb 2021 15:43:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled. To: Andrei Warkentin Cc: jlinton , "devel@edk2.groups.io" , "pete@akeo.ie" , "samer.el-haj-mahmoud@arm.com" , "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , Jeremy Linton Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 17 Feb 2021 at 07:22, Andrei Warkentin wrot= e: > > Reviewed-by: Andrei Warkentin > _ Pushed as 2cad1bd782b5..41b54dbb6803 Thanks all _______________________________ > From: jlinton > Sent: Wednesday, February 17, 2021 12:07 AM > To: devel@edk2.groups.io > Cc: pete@akeo.ie ; Andrei Warkentin = ; samer.el-haj-mahmoud@arm.com ; leif@nuviain= c.com ; ardb+tianocore@kernel.org ; Jeremy Linton > Subject: [PATCH v2] Platform/RaspberryPi: Only enable IORT when 3G limit = is disabled. > > 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://nam04.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit= hub.com%2Fpftf%2FRPi4%2Fissues%2F123&data=3D04%7C01%7Cawarkentin%40vmwa= re.com%7C0c1dc1458ac14a84867b08d8d30a613a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f= 0%7C0%7C1%7C637491388819273969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAi= LCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=3DVlStuFf%2= F5bvIAMarB%2F2djY64J7GDa1zEVMB61%2Fwjgn8%3D&reserved=3D0 > > Fixes: dac891da5cf3 ("Platform/RaspberryPi/AcpiTables: add a IORT ACPI ta= ble 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/Platfor= m/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")); > > > > 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 and other older OSs > > + if (PcdGet32 (PcdRamLimitTo3GB) || !PcdGet32 (PcdRamMoreThan3GB)) { > > + return FALSE; > > + } > > } > > > > return TRUE; > > -- > 2.13.7 >