Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3297431lfo; Mon, 23 May 2022 01:01:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAfRX/sqTD8uOyxsvjXladQuZ5/3MPhEjkwxvF/quvmgTlVni/N+JT0HFPeyCs9qGLfKwB X-Received: by 2002:a17:90b:3ecd:b0:1dc:945e:41b1 with SMTP id rm13-20020a17090b3ecd00b001dc945e41b1mr24972912pjb.208.1653292892052; Mon, 23 May 2022 01:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653292892; cv=none; d=google.com; s=arc-20160816; b=MTq+ePV/CdWaCgbi+ZQWsZnvakOP6iqgGguNujoosvqKMeD3zOOd3yecrHcs2rRhSL xNi3t5T3HDu4m5pN3Ohnp5L7B8QfL1dlJhDW8doAwCspBtDDy8WvtLratCaQPvHvYmi3 qkJtoAspCk5wMY86EXDnYiiVqfucfxtMDvnNilXv/Vi+H4DXR44sTKFAcZDb7vDkkWeX brOW1y1BAoVepaWemSDzHcLicRoE3q4dGoGBPFl+bO/H33fcQQ5/iCml9VoFKNwHmqTI 1QJDhtP3a8/BmS5M58XYFa46jXJnWz2njCSVL61TJn5+oRbzep72+wWqN+TAGhLawEDm 3s5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pflrT3yeO7SXVaOs7fhvoBCGgtv4yST+kjtf0/Qu2Qs=; b=pu1JuMt4KJMBd5PGiZM1dCFMSGJfRpInvfCcS3nJIxPPlUTftEZxhhOTiPUbI3CNLR 6USB23MZG48RsYJU961BeXGPJQR9UK1bdtO+dp9vFlGxdgKuPS3jyfwqGbyWjSDznoDW lL49r7s8pXKu8WOBOYVIoNeka1rwHknsj+qnK5xCVVQx+gWgpbJtPq17fT6gp8Tgzv74 6VIe/k7K/V9qKCg5g5dGOa6S+VHPfVKzWcLaWAm0w/PzFvja5+c3bShGj+JgHW8AZGwn ZsIqrC0pWsqdkN9wPwFqm20FbSE1Qz3g6SO03fQP4iCSrvioV1B+PlvoKg5r+AVOKrOB sl0g== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x4-20020a631704000000b003c5ecccbaa7si8863554pgl.827.2022.05.23.01.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:01:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4F5925A793; Mon, 23 May 2022 00:01:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348251AbiETKqD (ORCPT + 99 others); Fri, 20 May 2022 06:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbiETKqB (ORCPT ); Fri, 20 May 2022 06:46:01 -0400 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC89110C for ; Fri, 20 May 2022 03:45:57 -0700 (PDT) Received: from relay4-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::224]) by mslow1.mail.gandi.net (Postfix) with ESMTP id DD46FD0993 for ; Fri, 20 May 2022 10:44:19 +0000 (UTC) Received: (Authenticated sender: ash@heyquark.com) by mail.gandi.net (Postfix) with ESMTPSA id 04FB3E000B; Fri, 20 May 2022 10:44:08 +0000 (UTC) Message-ID: <935b426a-6c64-beb0-907f-8c3f0a089ab7@heyquark.com> Date: Fri, 20 May 2022 20:44:04 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 11/12] powerpc: wiiu: don't enforce flat memory Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: 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 References: <20220302044406.63401-1-ash@heyquark.com> <20220302044406.63401-12-ash@heyquark.com> <20220513224353.n56qg5fhstbaqhfz@pali> <20220520080454.c3cqodsdbfbkmg56@pali> From: Ash Logan In-Reply-To: <20220520080454.c3cqodsdbfbkmg56@pali> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 >>>>