Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp862114iol; Thu, 9 Jun 2022 16:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2EiXXJB811fLb3alSSTdJyWVHT0BQA98sXQp06SFngy+inuFENqU78bZxUN3SwDGldjGk X-Received: by 2002:a17:906:e2d3:b0:711:d2e5:cc48 with SMTP id gr19-20020a170906e2d300b00711d2e5cc48mr19371334ejb.9.1654815985756; Thu, 09 Jun 2022 16:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654815985; cv=none; d=google.com; s=arc-20160816; b=YamEQ+9k2lbcS3wqia/vWWXOGtpxOw0icITjiKHA2ztWL6ykQh92qpntO07FA+2O3v X42JtMnS2z4XeIT3IFtWbd2KTZgvYp9Rn2rzyNqtHOkkNv7g/XAu16YfscyyMjfKQg2x d0N7ZhWkm09hiHG2rX9zmgquwApwgCng0rxTGKr8sHbq5hQ9cKel2R6iiidZXYAPtGBq Cuam4ZWQ6Rf0lknx2xduheUMda8WZZzeAHQOo/GesxUhl2PRhYVpGaadu1uegXoQVOOQ uGxh9nq6zMxjRZmeE57Wu8aoJCm/cTB4TKDNcVRTyN/jS6cpWoL9Q92i+vFImZvqDtAa Gi6g== 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=lMRvrgvWVnXuo55kNtb1WMBLzRJpfMjKamUhe0dB9OQ=; b=FqKY4hlw5gCg+1qrT31OSmYBo9dLelrLXHuXgLx+3WiSaZoeR/c6KtxwPWn450dBvU +Phfr4jlajpOpsq09jqK29E0t80WjVpUiUDWp/rOE6PJg4+HeYFKuhfZ8K6w/6CHs9ff ApdIIMju6D/4RQ1Vld9oji3yzKkdJusOr1NremHQM38YYGflaB0z5Ec0HoFJ2y2zpJe0 yIM3qQeVg2wOU0r+yFdpcTUE7AzB669qIFxVQFs4AZD9OTVxyonOpVdg+nJIiSMAuGaZ oDHkYkdt8r4eAhmByleyWhDOkFfKd3TjiQBfHbdxT+/13M2kPUApvJ0p5dipwdcGoBhl pHcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PwhGrfYr; 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 bs1-20020a056402304100b0043139ef9f58si5768506edb.245.2022.06.09.16.05.57; Thu, 09 Jun 2022 16:06:25 -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=PwhGrfYr; 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 S240263AbiFIWY2 (ORCPT + 99 others); Thu, 9 Jun 2022 18:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbiFIWY1 (ORCPT ); Thu, 9 Jun 2022 18:24:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945CF2122A4 for ; Thu, 9 Jun 2022 15:24:26 -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 47F3AB83099 for ; Thu, 9 Jun 2022 22:24:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 973AFC34114; Thu, 9 Jun 2022 22:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654813464; bh=vspykPiylcjgEjkFhXI0pGm+yV8L27ibQgb31xTuVlQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PwhGrfYrEtq143rPkBC+5E4Q9Wmc4A4J7GUMIMVaT0tU+zzohnuB7QuzWm7k9zyFa JdGsAM4BuS6dDii5IrbA0d6p4/ZfyOw62jY+uep5NffX2J5qMJR7z1KMigkUFRnjB9 JgTisM/PdBgXZbMxYe6PIEe8dflv/4LI0mDIYsxX2rROps6RfPrlgQSpeXV3ZMSdDv PGbIQWET4qtq7zW12rOxvE25HEoFqImGv62R6naU5fGsG62vB5fIHF3q4qdQEBtRUO 0+QNW9e78nBqlwZ2ohToyhaQaQZSXZdU6p2Cvd8ncxvSmKcAxXnUeXoPh4F1+yES7X 33TuAQBZ5RXvQ== Received: by pali.im (Postfix) id 870602558; Fri, 10 Jun 2022 00:24:20 +0200 (CEST) Date: Fri, 10 Jun 2022 00:24:20 +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: <20220609222420.ponpoodiqmaqtwht@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220520123002.rd46p5ty6wumi7cc@pali> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-8.3 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 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? > 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 > > >>>>