Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp199128rdb; Thu, 21 Dec 2023 06:56:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkKmy1gKnAzPCdxJwpOsdayKRv3BZJbOwPe8yQBZQ4iqZg0el7KsYjqlGm2uF//rFZGSbu X-Received: by 2002:aa7:cd81:0:b0:54c:553e:b851 with SMTP id x1-20020aa7cd81000000b0054c553eb851mr10390512edv.84.1703170614822; Thu, 21 Dec 2023 06:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703170614; cv=none; d=google.com; s=arc-20160816; b=cVMz47wZQoVat7jGnrxl/xvcB6yn80EDZijSEEzuUEL8F54rRVvwo7caz9uA5vy33M Y7SGDg27V/0NhRCzSuT2pT2KFUQM0pd8aqqlRA3K/pWoIQ8wBPf7ZI7yOuLYITcKy3/4 9pBsEwKRlrASAwWWx1CSuyYJ59jSDiJDmkl0xukpPuI2fzHjTRl59mUhRk4caKIq3pRE matoTjEKRDy57pAnIVADafXMmDPeFBmyI4s0UQbUJjRCyzZ5AH+UDkyFCwHd6lVxFezx uh9YwGXu+iIbksJpyUbmmRTJ8T9paJJK0omIQE9rC5v5wALHhEFYPLZQMIp5FLlE5Ljp jb3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=UW0hIacWwRClFrr/8DcW2x4bNn0lL9O1wZbhzx3d2L8=; fh=pu/A85zsGu0DCJAgbKdIb9gu40lqw7OO7XHS2zcqkmc=; b=lh73UYAzgAJ4+rbWe5Z+JmEjsSOhuY0uvl5Ih1ooNEye3XIWtTOwCoVaMcZ3Ak5XP1 ddccYuEPYa3mrJ/P3pJYwAvQ77yCByopLwWX7nMvsDypA6LHfv0l8HJ2IMCkVktBhHJK uHJxTo6LKsHg1SLW4Nxz1t5NcUsUfRm6ygc6uZYxn/ptZl2btU3J28rezFwfkqwvlkJu kjmjZ7MuvmlUSbAQT3q77MprjaCW/HS7hf/eMX28G/hx8xTeRwC+VGzpIx2DNvRZcTcs U93RpfigngUX+Bjrwh5Ug3x5eaAVOaGRYkh27tBbWuHY9BTcnOnrHjN29r41OSfTNjUv wdIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8597-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk2-20020a0564021d8200b00553a2b5acb0si925772edb.435.2023.12.21.06.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 06:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8597-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 80B021F24DDF for ; Thu, 21 Dec 2023 14:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ED49360BF; Thu, 21 Dec 2023 14:56:13 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07753360AE; Thu, 21 Dec 2023 14:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1rGKSq-0002PT-00; Thu, 21 Dec 2023 15:55:56 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id F34F9C028A; Thu, 21 Dec 2023 15:38:01 +0100 (CET) Date: Thu, 21 Dec 2023 15:38:01 +0100 From: Thomas Bogendoerfer To: Serge Semin Cc: Jiaxun Yang , Andrew Morton , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Christophe Leroy , Baoquan He , Chao-ying Fu , Yinglu Yang , Tiezhu Yang , Mike Rapoport , Matthew Wilcox , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/6] MIPS: mm: Fix some memory-related issues Message-ID: References: <20231202111430.18059-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231202111430.18059-1-fancer.lancer@gmail.com> On Sat, Dec 02, 2023 at 02:14:17PM +0300, Serge Semin wrote: > Just recently I've rebased my MIPS32-related work from kernel 6.5-rc4 onto > the latest kernel 6.7-rc1 and immediately got into a bootup-time > mm-related bug (see patches 3-4 in this series). After fixing it I decided > it was time to submit for review the generic MIPS code fixes which I have > been collecting in my local repo for the last year. I was going to submit > them a bit later after I finished working on a patchset with my SoC > arch-specific changes, but since it was getting bigger and bigger, it > turned to be reasonable to spill out the generic part of series right away > especially seeing it might get to be useful in the most recent kernel. > > So this series starts with the MIPS-specific dmi_early_remap() > implementation fix. It is utilized by the DMI driver in the framework of > the dmi_setup() method, which is called at the very early boot stage - in > setup_arch((). No VM and slab available at that stage which is required > for the ioremap_cache() to properly work. Thus it was a mistake to have > the dmi_early_remap() macro-function defined as ioremap_cache(). It should > have been ioremap() in first place. > > After that goes a fix for the high-memory zone PFNs calculation procedure > on MIPS. It turned out that after some not that recent commit the > IO-memory or just non-memory PFNs got to the high-memory even though they > were directly reachable, thus should have been left in the normal zone. > > Then a series of fixes for the recently discovered mm-bug is presented. > Any attempt to re-map the IO-memory with the cached attribute caused the > bootup procedure to crash with the "Unhandled kernel unaligned access" > message. After some digging I found out that the problem was in the > uninitialized IO-memory pages. Please see the patch "mips: Fix max_mapnr > being uninitialized on early stages" description for the detailed > explanation of the problem and suggested fix. > > After that goes a patch which adds the slab availability check into the > ioremap_prot() method. Indeed VM mapping performs the slab allocation in > the framework of the get_vm_area() method. Thus any other than uncached > IO-remappings must be proceeded only at the stages when slab is available. > A similar fix was just recently added to the generic version of > ioremap_prot() in the framework of commit a5f616483110 ("mm/ioremap: add > slab availability checking in ioremap_prot"). > > The patchset is closed with a small improvement which sets the MIPS > board/machine name to the dump-stack module in order to print > arch-personalized oopses in the same way as it's done on ARM, ARM64, > RISC-V, etc. > > That's it for today.) Thanks for review in advance. Any tests are very > welcome. > > Link: https://lore.kernel.org/linux-mips/20231122182419.30633-1-fancer.lancer@gmail.com/ > Changelog v2: > - Drop the patches: > [PATCH 5/7] mm/mm_init.c: Extend init unavailable range doc info > [PATCH 6/7] mm/mm_init.c: Append '\n' to the unavailable ranges log-message > since they have been picked up by Andrew. (@Andrew) > - Replace ioremap_uc() with using ioremap() due to having the former one > deprecated. (@Arnd) > - Add a new patch: > [PATCH v2 5/6] mips: mm: add slab availability checking in ioremap_prot > picked up from the generic ioremap_prot() implementation. > - Extend early DMI mem remapping patch log with a note regarding the unsynched > caches concern. (@Jiaxun) > > Signed-off-by: Serge Semin > Cc: Alexey Malahov > Cc: Arnd Bergmann > Cc: Aleksandar Rikalo > Cc: Aleksandar Rikalo > Cc: Dragan Mladjenovic > Cc: Christophe Leroy > Cc: Baoquan He > Cc: Chao-ying Fu > Cc: Yinglu Yang > Cc: Tiezhu Yang > Cc: Mike Rapoport > Cc: Matthew Wilcox (Oracle) > Cc: Marc Zyngier > Cc: linux-mips@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > > Serge Semin (6): > mips: dmi: Fix early remap on MIPS32 > mips: Fix incorrect max_low_pfn adjustment > mips: Fix max_mapnr being uninitialized on early stages > mips: Optimize max_mapnr init procedure > mips: mm: add slab availability checking in ioremap_prot > mips: Set dump-stack arch description > > arch/mips/include/asm/dmi.h | 2 +- > arch/mips/kernel/prom.c | 2 ++ > arch/mips/kernel/setup.c | 4 ++-- > arch/mips/mm/init.c | 16 +++++++++------- > arch/mips/mm/ioremap.c | 4 ++++ > 5 files changed, 18 insertions(+), 10 deletions(-) series applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]