From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4333CC433F5 for ; Wed, 11 May 2022 14:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbiEKOki (ORCPT ); Wed, 11 May 2022 10:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiEKOkh (ORCPT ); Wed, 11 May 2022 10:40:37 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCCF96CA80; Wed, 11 May 2022 07:40:36 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 63DE168CFE; Wed, 11 May 2022 16:40:33 +0200 (CEST) Date: Wed, 11 May 2022 16:40:33 +0200 From: Christoph Hellwig To: Mike Rapoport Cc: Christoph Hellwig , Conor.Dooley@microchip.com, sfr@canb.auug.org.au, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: linux-next: Tree for May 3 Message-ID: <20220511144033.GA1478@lst.de> References: <505d41d1-1bc8-c8bc-5ebb-8a2b7934f3de@microchip.com> <20220511062232.GA32524@lst.de> <102578f2-5c10-e9c2-c1ef-e76ba90d011e@microchip.com> <20220511064832.GA761@lst.de> <2c0e2fbe-4e45-4acc-c2a7-4f4dcf9161a3@microchip.com> <20220511123724.GA25121@lst.de> <20220511141034.GA31732@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Wed, May 11, 2022 at 05:37:50PM +0300, Mike Rapoport wrote: > Presuming that devices see [0x1000200000-0x103fffffff] as > [0x200000-0x3fffffff] we may try something like > > min = memblock_start_of_DRAM(); > max = min + 0xffffffff; > > if (flags & SWIOTLB_ANY) > max = MEMBLOCK_ALLOC_ACCESSIBLE; > > tlb = memblock_alloc_try_nid(bytes, PAGE_SIZE, min, max, NUMA_NO_NODE); While there is still no guarantee the first 32-bits worth of DRAM are actually mapped to a usable address, this looks like a much better default than what we have right now.