Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5086304rwb; Mon, 8 Aug 2022 11:56:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6oAMaMOoIDPC6SbxbAjzYwRYtiqLBG+kIGD/EAGPT/9jnhlDDPdJ6XmChpIvVyvIGDNi8R X-Received: by 2002:a05:6402:d05:b0:435:b2a6:94eb with SMTP id eb5-20020a0564020d0500b00435b2a694ebmr18593835edb.87.1659984998609; Mon, 08 Aug 2022 11:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659984998; cv=none; d=google.com; s=arc-20160816; b=byHHdhP1jSorfbZnCJZZn4Pp0PS5m7E692XfccS/Dy0Ew+jLf+lLhr5EX29HBVov6y Hs3ExVNLC59bwU0E7cqAFHuAoiz4VAasMttDpll+af8LElnb7ZI08nVDlJtUPI94eII5 uwSSF0gNVTDIASKnnw1DmxaGxLV64uX0Y/1atBCN2KluKk4Tnz+3q1Jtacse/dtp2Qh5 TUEIVTp6Y42Bw6gZnyYxEjsjxoOEdICefUXTQpuDZMfoFnbLPMJsrKcWIITfK4pDGnaZ voeXaIpwqFW3aQI2C4G+U8B0WVvwSu0GmFTk0+lXfnXCrMJrcBZvv2ozN3BP1Pyab1uD 4q3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HhNb4DqslKQXOed7jGI3BJ61mKoWDMecIrYCXiXIbfU=; b=o+N/H5E4HCH6t9JHB7oGbgnr/Za2gH0x8Dia8pNp+trEcyPnenTCpaQcEpn5VR06DA qRy3O8vdriMBCcOOH4sij1YW78ommuGPl0WOxd9PbDJFeXXaW754Dz3ADcHPKMMGrWj5 xSj4XvkITFlw6bDzu2AjKEb1euEBDbMY+9Zp5SxAFg89ktLIcp4EaB/Zyhu5Cfm8hAll zGa2gPSYFWODEhfc6mQohbdizH+gUJ2YS6BKcZQ723FS4mZtvQk0szcGkvqk+PkP9a1X BIBfKB7Kowq7gyK82OrHAfmzxLUBzG+UrEZYgWU3NmJDIGsYckkN5ii9KiXLqM+Nx/m8 8Q6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cmhafj2K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a50d5c2000000b0043c158735basi6177068edj.467.2022.08.08.11.56.12; Mon, 08 Aug 2022 11:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cmhafj2K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238106AbiHHSkt (ORCPT + 99 others); Mon, 8 Aug 2022 14:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244031AbiHHSkm (ORCPT ); Mon, 8 Aug 2022 14:40:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A103DE2A for ; Mon, 8 Aug 2022 11:40:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33E35B81020 for ; Mon, 8 Aug 2022 18:40:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81C3DC433C1; Mon, 8 Aug 2022 18:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659984037; bh=NeZb0DNW+wBBbBivljipLAuWjXhHR+VkQ+vg21O7Lzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cmhafj2K0/21CO1Au6QseEfKeeWWpWSHPkUuM/MkUNqCmIFq6BrbRorJpBdVT5B6d mTrSAr2P7pe+p+tB1sUYRwU4EW/B1aK2A48tVkL+Einz/PL9D12IXCRrpvjLXk2ai2 rHGdDPul4hT4Yl+6+5Aqju/2OtjmvcOpf36JfLGdfsymogYti8tG2nw/GZ8kCEczUb rSYVchcwSpIp+mHy+6Uyin/v44RI2mpAEvHX3nTNuFaolvoQ9o/d+VyVFlTtbp3LzP 4tYxy9HA/les28+3BI5Pp73dDVwt/pK6ZqXuHysG4SiLhMrpWxbsBMbMZbgRTl27YG x+WAtk5W7PbbA== Received: by pali.im (Postfix) id 693D3F13; Mon, 8 Aug 2022 20:40:34 +0200 (CEST) Date: Mon, 8 Aug 2022 20:40:34 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: linux-mm@kvack.org Cc: Ash Logan , paulus@samba.org, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, robh+dt@kernel.org, benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, j.ne@posteo.net Subject: Re: [PATCH 11/12] powerpc: wiiu: don't enforce flat memory Message-ID: <20220808184034.lskqrk6z3gb5q76r@pali> References: <20220302044406.63401-1-ash@heyquark.com> <20220302044406.63401-12-ash@heyquark.com> <20220513224353.n56qg5fhstbaqhfz@pali> <20220520080454.c3cqodsdbfbkmg56@pali> <935b426a-6c64-beb0-907f-8c3f0a089ab7@heyquark.com> <20220520123002.rd46p5ty6wumi7cc@pali> <20220609222420.ponpoodiqmaqtwht@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220609222420.ponpoodiqmaqtwht@pali> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 10 June 2022 00:24:20 Pali Rohár wrote: > On Friday 20 May 2022 14:30:02 Pali Rohár wrote: > > + linux-mm > > > > Do you know what are requirements for kernel to support non-contiguous > > memory support and what is needed to enable it for 32-bit powerpc? > > Any hints? PING? > > Currently powerpc arch code does not support "memblock.memory.cnt > 1" > > except for WII which seems like a hack... See below. > > > > On Friday 20 May 2022 20:44:04 Ash Logan wrote: > > > On 20/5/22 18:04, Pali Rohár wrote: > > > > On Friday 20 May 2022 13:41:04 Ash Logan wrote: > > > >> On 14/5/22 08:43, Pali Rohár wrote: > > > >>> On Wednesday 02 March 2022 15:44:05 Ash Logan wrote: > > > >>>> pgtable_32.c:mapin_ram loops over each valid memory range, which means > > > >>>> non-contiguous memory just works. > > > >>> > > > >>> Hello! Does it mean that non-contiguous memory works for any 32-bit > > > >>> powerpc platform, and not only for wiiu? If yes, should not be > > > >>> non-contiguous memory support enabled for all 32-bit ppc boards then? > > > >> > > > >> Hi! Sorry for my delayed response. As best I can tell, it does indeed > > > >> Just Work, but I have only been able to test on wiiu which is missing a > > > >> lot of features other boards have (like PCI) - so it's possible there's > > > >> still an assumption elsewhere in the kernel that I haven't hit. > > > >> > > > >> As best I can tell, the Wii and Wii U are the only 32-bit powerpc boards > > > >> out there where it's even possible to have non-contiguous memory. > > > > > > > > What is the reason that those two boards are the **only**? Is there some > > > > specific requirement from bootloader or hardware to "enable" > > > > non-contiguous memory support? > > > > > > Not that I know of, I was just saying that I was only aware of those two > > > boards where the memory map isn't contiguous, and that is the only place > > > where it has been tested. Evidently you know of another board! > > > > > > > I'm interested in enabling non-contiguous memory support for P2020-based > > > > board as it has gaps in its 32-bit memory layout and which could be used > > > > for RAM mapping when 4GB DDR3 module is plugged in (default is 2GB). > > > > > > If it's like the Wii or Wii U (some memory at 0, a gap for MMIO or > > > whatever, then more memory at a higher address) then you should try a > > > patch along these lines, because barring the unknowns I mentioned before > > > it should work. At least as far as I'm aware ;) > > > > > > >>>> Signed-off-by: Ash Logan > > > >>>> --- > > > >>>> arch/powerpc/mm/init_32.c | 4 ++-- > > > >>>> 1 file changed, 2 insertions(+), 2 deletions(-) > > > >>>> > > > >>>> diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c > > > >>>> index 3d690be48e84..59a84629d9a0 100644 > > > >>>> --- a/arch/powerpc/mm/init_32.c > > > >>>> +++ b/arch/powerpc/mm/init_32.c > > > >>>> @@ -125,10 +125,10 @@ void __init MMU_init(void) > > > >>>> * lowmem_end_addr is initialized below. > > > >>>> */ > > > >>>> if (memblock.memory.cnt > 1) { > > > >>>> -#ifndef CONFIG_WII > > > >>>> +#if !defined(CONFIG_WII) && !defined(CONFIG_WIIU) > > > >>>> memblock_enforce_memory_limit(memblock.memory.regions[0].size); > > > >>>> pr_warn("Only using first contiguous memory region\n"); > > > >>>> -#else > > > >>>> +#elif defined(CONFIG_WII) > > > >>>> wii_memory_fixups(); > > > >>>> #endif > > > >>>> } > > > >>>> -- > > > >>>> 2.35.1 > > > >>>>