From patchwork Wed Nov 22 18:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465342 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TFneLshP" Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B423E101; Wed, 22 Nov 2023 10:24:26 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c88b7e69dfso1049621fa.0; Wed, 22 Nov 2023 10:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677465; x=1701282265; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yjHlY+dwgtlGLlPuvunFHNqCcfV7AAmhZsbau9o57nI=; b=TFneLshPOYhMYydbFoqoDC0+aUnlWtda4nBQBx89mhakocuYN98Wsh0gTgCf2IbxMA CRKoVW1kLaJOQeL6nD/nmRb1MEbJonmA5c14vFrAbJ1si60oFkum8MDFZna+irO0dG02 d9Os6/Wkj/p/Lrvdc+v2s5W9zhifiKuVT3JuU6PDzvjZPdy8oospaGV7XZVN/kBs0Wz/ Vk5VAEGN7nTY9RyEA//o81DDtyUdDd5lliM0J2K6BZJdYqQV+teT6AiL1aGkmQONJgA5 QEt0Qr1LJKATM+B3GyOV1lsWQXLWz1wzRUUmQaYHHByY5SYG1v9ZfDDz+p+Fx7qpLXbI lAnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677465; x=1701282265; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yjHlY+dwgtlGLlPuvunFHNqCcfV7AAmhZsbau9o57nI=; b=c4p8OUYoHCGolknF9Qiy9QC39xabTSZsDJNcz5f6IXy8h+V7bunF/ak0sHLt+scNWq wkzhQBLVhK08B9kyNCjy7ov1+nfowFm18oM/N2xs9yn8AEEIjkVWIvewzsywS88LfAj0 ClNVZy/ixIxC8znWbO6WMHCEKjbqTj7b0d1oK61tH4g8KiOCPs/gYVwV/p1e2EkJBRV1 L++EKvsIojDXrNw2J/XxnNjBleJKNhYXLBUb6K9KeHoQGbC14QcWiih/kCe4GLwJMVpy lHk5ecbo/VwTUh5aW/DB7DfHxNf+ECa69uSL1+XNttRBkSVffFfE9GD48Kczk4qo9gdT N5gA== X-Gm-Message-State: AOJu0YwVI37vrmoopDY2MJdQrsxjExVhc2V8ARtsgpXWcft2ToEov7R5 y5NLpar6nl+qHSrd2xB+bfo= X-Google-Smtp-Source: AGHT+IFXwabmg+qbE103kF3TmOv1sYfzVGr6ur/Y2zlrmwFdEQbij6rj3CZvgc4sXeVNfM5Rzy7XRQ== X-Received: by 2002:a2e:91c7:0:b0:2c5:24a8:c22d with SMTP id u7-20020a2e91c7000000b002c524a8c22dmr2198720ljg.3.1700677464782; Wed, 22 Nov 2023 10:24:24 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id f6-20020a2eb5a6000000b002bcbb464a28sm12020ljn.59.2023.11.22.10.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:23 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox , Tiezhu Yang , Huacai Chen , Yinglu Yang , Jiaxun Yang Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] mips: dmi: Fix early remap on MIPS32 Date: Wed, 22 Nov 2023 21:23:59 +0300 Message-ID: <20231122182419.30633-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 dmi_early_remap() has been defined as ioremap_cache() which on MIPS32 gets to be converted to the VM-based mapping. DMI early remapping is performed at the setup_arch() stage with no VM available. So calling the dmi_early_remap() for MIPS32 causes the system to crash at the early boot time. Fix that by converting dmi_early_remap() to the uncached remapping which is always available on both 32 and 64-bits MIPS systems. Fixes: be8fa1cb444c ("MIPS: Add support for Desktop Management Interface (DMI)") Signed-off-by: Serge Semin --- arch/mips/include/asm/dmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/dmi.h b/arch/mips/include/asm/dmi.h index 27415a288adf..525aad1572d1 100644 --- a/arch/mips/include/asm/dmi.h +++ b/arch/mips/include/asm/dmi.h @@ -5,7 +5,7 @@ #include #include -#define dmi_early_remap(x, l) ioremap_cache(x, l) +#define dmi_early_remap(x, l) ioremap_uc(x, l) #define dmi_early_unmap(x, l) iounmap(x) #define dmi_remap(x, l) ioremap_cache(x, l) #define dmi_unmap(x) iounmap(x) From patchwork Wed Nov 22 18:24:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465343 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZNIGol0I" Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA6FE1AE; Wed, 22 Nov 2023 10:24:28 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-507a98517f3so12128e87.0; Wed, 22 Nov 2023 10:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677467; x=1701282267; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zoxEo8hjT6ynXu2QIn5RXNLR4Bk19U6JI/QFXIIvaMA=; b=ZNIGol0IPG9+W79uNm45b8lsJeh1v+cJiBrLTfwS2Hn4zMPeKmenOj1urrx1Xyg40e +PpI8Gu9Cdg4BrPr0Kr2FvCGKKMKyg/VCCHEDOcTwD4A8KVuuMB2NI99yLW5RXkWJPnS sRlza8SmcLpEIo/vXy+bH9uA/2vc89gYENjhkkdZh20q9gHL+ZmTBAUhLh3mjeE+B8LZ 5VeoUj5V552+kN+nr9UgYRM5Pvz4GZtJzJwKCfKkg17UQs1cHbvrZF0vkVup/IY1QWZW QIw68DhJpzZnBixKymGJMm3LE10akMiBz5UMzeOLkOf/gPqsNmt0/nCktJk6/Qd8Hk7g hO2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677467; x=1701282267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zoxEo8hjT6ynXu2QIn5RXNLR4Bk19U6JI/QFXIIvaMA=; b=fdfR+1Hfz1Q3JPqakkFkZrzuFqRNGV/6aZczvO+/fn3s9WlbnCpk54OF7juRXX0vJ8 psoWPgxqv4gGMYvroBuF2AkLoMmyMp5mi1Elh/6DQsg7kBoL9O5UM70btQiVKrj1Yx3F vavEzSvpF5rJLioDlM4ab/fpSzj7jO+3upfe9++9BKZ51VGk3WTitNu6a/t9JcAo9HlT z7xnpuGJV2BvR60BUlq2IUGfcgddPiJuDrZP3q1owvL0wXak6LFPRpUzXeSecA/H3w7C jf16QsPq8DALrCl9OmGkGxXgKZ6BPpDQsaqxuZEiPkFQX7rY2iKM/jxrFpzjCJ/n5OUt tdpw== X-Gm-Message-State: AOJu0YxVWHkshNK6JRDXMCr7btnQbGzf87LivephDZa4FVnmW5pzoEoN 5EiMvlREtosp+pAAgCnur9k= X-Google-Smtp-Source: AGHT+IEJYIyKQ6273MpBJbASGCHCzwBZ+jikHTC5hvZZZ0ytWLeA/63OtAlK6bjHb9mLuZPFtzvyfA== X-Received: by 2002:a05:6512:3591:b0:50a:abf9:27ff with SMTP id m17-20020a056512359100b0050aabf927ffmr1805249lfr.62.1700677466786; Wed, 22 Nov 2023 10:24:26 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id o2-20020a056512050200b005009c4ba3f0sm1928839lfb.72.2023.11.22.10.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:26 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox , Jiaxun Yang , Paul Burton Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] mips: Fix incorrect max_low_pfn adjustment Date: Wed, 22 Nov 2023 21:24:00 +0300 Message-ID: <20231122182419.30633-3-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 max_low_pfn variable is incorrectly adjusted if the kernel is built with high memory support and the later is detected in a running system, so the memory which actually can be directly mapped is getting into the highmem zone. See the ZONE_NORMAL range on my MIPS32r5 system: > Zone ranges: > DMA [mem 0x0000000000000000-0x0000000000ffffff] > Normal [mem 0x0000000001000000-0x0000000007ffffff] > HighMem [mem 0x0000000008000000-0x000000020fffffff] while the zones are supposed to look as follows: > Zone ranges: > DMA [mem 0x0000000000000000-0x0000000000ffffff] > Normal [mem 0x0000000001000000-0x000000001fffffff] > HighMem [mem 0x0000000020000000-0x000000020fffffff] Even though the physical memory within the range [0x08000000;0x20000000] belongs to MMIO on our system, we don't really want it to be considered as high memory since on MIPS32 that range still can be directly mapped. Note there might be other problems caused by the max_low_pfn variable misconfiguration. For instance high_memory variable is initialize with virtual address corresponding to the max_low_pfn PFN, and by design it must define the upper bound on direct map memory, then end of the normal zone. That in its turn potentially may cause problems in accessing the memory by means of the /dev/mem and /dev/kmem devices. Let's fix the discovered misconfiguration then. It turns out the commit a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") didn't introduce the max_low_pfn adjustment quite correct. If the kernel is built with high memory support and the system is equipped with high memory, the max_low_pfn variable will need to be initialized with PFN of the most upper directly reachable memory address so the zone normal would be correctly setup. On MIPS that PFN corresponds to PFN_DOWN(HIGHMEM_START). If the system is built with no high memory support and one is detected in the running system, we'll just need to adjust the max_pfn variable to discard the found high memory from the system and leave the max_low_pfn as is, since the later will be less than PFN_DOWN(HIGHMEM_START) anyway by design of the for_each_memblock() loop performed a bit early in the bootmem_init() method. Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 2d2ca024bd47..0461ab49e8f1 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -321,11 +321,11 @@ static void __init bootmem_init(void) panic("Incorrect memory mapping !!!"); if (max_pfn > PFN_DOWN(HIGHMEM_START)) { + max_low_pfn = PFN_DOWN(HIGHMEM_START); #ifdef CONFIG_HIGHMEM - highstart_pfn = PFN_DOWN(HIGHMEM_START); + highstart_pfn = max_low_pfn; highend_pfn = max_pfn; #else - max_low_pfn = PFN_DOWN(HIGHMEM_START); max_pfn = max_low_pfn; #endif } From patchwork Wed Nov 22 18:24:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465344 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VFJLe2aY" Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15081E7; Wed, 22 Nov 2023 10:24:31 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-507a62d4788so11286e87.0; Wed, 22 Nov 2023 10:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677469; x=1701282269; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wyLQCKiJ2VFITvxQw03Yt4z2bmF2c1oQIabjn568Vj0=; b=VFJLe2aYfzRUmE2Yo3oC4pDVpfPTXgIY8DuwVkLTT/CtMJfKIw+cmvcXxGG2O5V0Im Y3TuxTL0Tem7EnkyAb+JLaV9+agNGcdYNeZmwI60gSCGfnUXDJm1w48bl97TCH3fUvdx n9OCX5wnDavCVb6+SuhuH1QrgCnwFncGP/lQrYSKO8CQbE/2vOpip4bFDOXLTglF5BoZ gXuBaSaoRhRBswzfLZtmUS85zcik0KhxjY2RKuUDVQuK9/4yBryf+wRs7CxPD+F6+qBK 9kfrSortyBs3GVPEvEiyI3+MxJDp0tktiqa9SDSFkRz1DYdfj1sGNd8uWzryT1CS1JNi pSPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677469; x=1701282269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wyLQCKiJ2VFITvxQw03Yt4z2bmF2c1oQIabjn568Vj0=; b=GlDt2opA6LK5qPZkeYKD7mptHuucHFq53fmePeyyjEguoOUzn+zt610h/F3jBip5S6 OegCjjbNlONPJSdbsWPgiPt8PUOjKBJp4re1CeHMtC4ponyuPZcb0L3C4a/ZveRAQkgF t6DcNpVecAG8JUAhrNbNoMDeOrc7n5gGO2UECROB9qCSbXTvrkWin8sUHIlTKggZj8C0 BSt2fnQZ8eHw/8esJIHMMJdW2XiuyvMrNXBftdnoWSPf/uPs4F2BnJ9mXJhNSL9pkXI/ Jmsb4l47ZFj+CYS/kTXmEIJC3w3CdX7GTAm+MquPVwQ67rSWqZCYZjQUN/4yPH6EU0us FGrg== X-Gm-Message-State: AOJu0YwCvy9jmZ97leRqDq+bS9Yx4uyCtYkXhJFuCCON8/FsLPmvyeNS 2LRsdbPppG/l6oDJ2V9i/zQ= X-Google-Smtp-Source: AGHT+IHtCn8A+p6OVWkqu13c1CgByHGQ/x6y5cHnYmQZd4VzgkmBIX01gu2cG3MkZsPP1Mx6p/2Fdg== X-Received: by 2002:a05:6512:15a3:b0:508:26b2:7803 with SMTP id bp35-20020a05651215a300b0050826b27803mr3009239lfb.69.1700677469095; Wed, 22 Nov 2023 10:24:29 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id s7-20020a19ad47000000b0050aa9df16fbsm1363250lfd.179.2023.11.22.10.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:28 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 3/7] mips: Fix max_mapnr being uninitialized on early stages Date: Wed, 22 Nov 2023 21:24:01 +0300 Message-ID: <20231122182419.30633-4-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 max_mapnr variable is utilized in the pfn_valid() method in order to determine the upper PFN space boundary. Having it uninitialized effectively makes any PFN passed to that method invalid. That in its turn causes the kernel mm-subsystem occasion malfunctions even after the max_mapnr variable is actually properly updated. For instance, pfn_valid() is called in the init_unavailable_range() method in the framework of the calls-chain on MIPS: setup_arch() +-> paging_init() +-> free_area_init() +-> memmap_init() +-> memmap_init_zone_range() +-> init_unavailable_range() Since pfn_valid() always returns "false" value before max_mapnr is initialized in the mem_init() method, any flatmem page-holes will be left in the poisoned/uninitialized state including the IO-memory pages. Thus any further attempts to map/remap the IO-memory by using MMU may fail. In particular it happened in my case on attempt to map the SRAM region. The kernel bootup procedure just crashed on the unhandled unaligned access bug raised in the __update_cache() method: > Unhandled kernel unaligned access[#1]: > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc1-00307-g0dff108838c9-dirty #2056 > ... > Call Trace: > [<8011ef9c>] __update_cache+0x88/0x1bc > [<80385944>] ioremap_page_range+0x110/0x2a4 > [<80126948>] ioremap_prot+0x17c/0x1f4 > [<80711b80>] __devm_ioremap+0x8c/0x120 > [<80711e0c>] __devm_ioremap_resource+0xf4/0x218 > [<808bf244>] sram_probe+0x4f4/0x930 > [<80889d20>] platform_probe+0x68/0xec > ... Let's fix the problem by initializing the max_mapnr variable as soon as the required data is available. In particular it can be done right in the paging_init() method before free_area_init() is called since all the PFN zone boundaries have already been calculated by that time. Cc: stable@vger.kernel.org Signed-off-by: Serge Semin --- Note I don't really know since what point that problem actually exists. Based on the commits log it might had been persistent even before the boot_mem_map allocator was dropped. On the other hand I hadn't seen it actually come out before moving my working tree from kernel 6.5-rc4 to 6.7-rc1. So after updating the kernel I got the unhandled unaligned access BUG() due to the access to compound head pointer the __update_cache() method (see the commit log). After enabling the DEBUG_VM config I managed to find out that the IO-memory pages were just left uninitialized and poisoned: > page:81367080 is uninitialized and poisoned (pfn 8192) > page dumped because: VM_BUG_ON_PAGE(PagePoisoned(p)) > Kernel bug detected[#1]: > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc1-00298-g88721b1a9ad5-dirty > $ 0 : 00000000 812d0000 00000034 dced7cdf > $ 4 : dced7cdf 00594000 10000000 ffff00fe > $ 8 : 8196bfe0 00000000 00000001 818458c0 > $12 : 00000000 00000000 00000000 00000216 > $16 : 00002800 81227b80 00000000 00000000 > $20 : 00000000 00000000 00000000 00000000 > $24 : 0000022b 818458c0 > $28 : 81968000 8196be68 00000000 803a0920 > Hi : 00000000 > Lo : 00000000 > epc : 8039d2a4 BUG+0x0/0x4 > ra : 803a0920 post_alloc_hook+0x0/0x128 > Status: 10000003 KERNEL EXL IE > Cause : 00800424 (ExcCode 09) > PrId : 0001a830 (MIPS P5600) > Modules linked in: > Process swapper/0 (pid: 1, threadinfo=81968000, task=819a0000, tls=00000000) > Stack : 00000000 8101ccb0 00000000 8196bd00 00000000 80359768 818a8300 00000001 > 81139088 8114438c 8042e4f8 81297a2c 81297a2c 81255e90 819a1b50 dced7cdf > 81297a2c 81297a2c 00000000 81227b80 00000000 81241168 811394b0 00000000 > 81140000 80e2cee0 00000000 00000000 00000000 00000000 00000000 819b0000 > 81140000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ... > Call Trace: > [<8039d2a4>] BUG+0x0/0x4 > [<803a0920>] post_alloc_hook+0x0/0x128 > > Code: 01001025 03e00008 24020001 <000c000d> 2403003c 27bdffd0 afb2001c 3c12812f 8e4269e4 Which in its turn made me digging deeper into the way the MMIO-space pages are initialized. That's how I got into the pfn_valid() and init_unavailable_range() working improperly on my setup. Anyway none of the problems above I spotted on kernel 6.5-rc4. So what actually triggered having them finally popped up isn't that easy to be foundn seeing the involved code hasn't changed much. --- arch/mips/mm/init.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 5dcb525a8995..6e368a4658b5 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -422,7 +422,12 @@ void __init paging_init(void) (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10)); max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; } + + max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; +#else + max_mapnr = max_low_pfn; #endif + high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); free_area_init(max_zone_pfns); } @@ -458,13 +463,6 @@ void __init mem_init(void) */ BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (PFN_PTE_SHIFT > PAGE_SHIFT)); -#ifdef CONFIG_HIGHMEM - max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; -#else - max_mapnr = max_low_pfn; -#endif - high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); - maar_init(); memblock_free_all(); setup_zero_pages(); /* Setup zeroed pages. */ From patchwork Wed Nov 22 18:24:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465345 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="blYM6Upj" Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4307D5E; Wed, 22 Nov 2023 10:24:32 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50a6ff9881fso10412927e87.1; Wed, 22 Nov 2023 10:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677471; x=1701282271; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Uth/Y2BnPWq3gQU+80s2O0ynUT/ngATxDsls3eMwpZI=; b=blYM6UpjStu3K+0aiGxyNx3p0Ijh8X+fQhPk1e3mSuLxJNLIlZqeeMDHwpryxlHr3u Gv2DiOpHID+SM7Y4nB950JsClp4jP94ID/YV6lmXw46aINc4YHD/W6biIwWwuEvgZl8X hIINPi/g2H33W+OFut49wPfbO786ucJZB36QJxIobGQzkYPugG87nNi92WmmFLJGZGor U/qEzhrNYkThGCWDyo1byycinGcWIVGVbOCkz2XhNlQ+IQHaX10eKmKmp8ChC6vtN2CY xARi64x5GXk1f1U9cmyVKemvjeIL1kqYpw+I6v2EUA8jhNF8ysFYK0NeIaae1jhYaDMf 6E3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677471; x=1701282271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uth/Y2BnPWq3gQU+80s2O0ynUT/ngATxDsls3eMwpZI=; b=RIqDr3BCnDH6wLZjrUKR26U/vs4fdZSRA9ZgbOlFuJEuEVHipxrCtD05vYDn++I1Nx lmRxlZjpO9/xejL22erCsunepagO8V+6/UNjoZeZQXN5L3n4WdVfSq/fIGMlESSm5oss 2hSW2wMccFGZYKE2sX5L3I6KyOt1A3H+5pLkTSEU/xOdSEUWWrptaRdpQd8gLgfXLKYR gTUYBU3x+eFOpl5O6v1E9U8acvhbhekKA8Lh9pWdreOk2g9QUVWZbpKSYPxzFUZIrO+m 95EuDcLgzNlPk0OsHCJG/Q69HPcfhCWYchlsQ1sd1ow2tHxIUlZXTmeqQF+SnKKP9+78 cFsQ== X-Gm-Message-State: AOJu0Yw/QlIr0XaBbNZ5Ext0eQLINknBUGgzXdsIEAb74zrJ1buuMN3P BrvZAH8+tSkZDk9dOszyhos= X-Google-Smtp-Source: AGHT+IEWqYrpMTLtxw6L9izmb8PcfN1bR92Xt7CidFbWzvvA08wTTg9UoMDWL2iVdmmyJOFzTDnDHg== X-Received: by 2002:a05:6512:3083:b0:508:1470:6168 with SMTP id z3-20020a056512308300b0050814706168mr1101474lfd.57.1700677470889; Wed, 22 Nov 2023 10:24:30 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id d14-20020ac25ece000000b00509447753c5sm1926536lfq.308.2023.11.22.10.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:30 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] mips: Optimize max_mapnr init procedure Date: Wed, 22 Nov 2023 21:24:02 +0300 Message-ID: <20231122182419.30633-5-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 max_mapnr defines the upper boundary of the pages space in the system. Currently in case if HIGHMEM is available it's calculated based on the upper high memory PFN limit value. Seeing there is a case when it isn't fully correct let's optimize out the max_mapnr variable initialization procedure to cover all the handled in the paging_init() method cases: 1. If CPU has DC-aliases, then high memory is unavailable so the PFNs upper boundary is determined by max_low_pfn. 2. Otherwise if high memory is available, use highend_pfn value representing the upper high memory PFNs limit. 3. Otherwise no high memory is available so set max_mapnr with the low-memory upper limit. Signed-off-by: Serge Semin --- Since I haven't seen any problem the denoted misconfiguration on my setup the patch isn't marked as fixes, but as an optimization. --- arch/mips/mm/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 6e368a4658b5..b2dce07116e8 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -421,9 +421,13 @@ void __init paging_init(void) " %ldk highmem ignored\n", (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10)); max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; - } - max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; + max_mapnr = max_low_pfn; + } else if (highend_pfn) { + max_mapnr = highend_pfn; + } else { + max_mapnr = max_low_pfn; + } #else max_mapnr = max_low_pfn; #endif From patchwork Wed Nov 22 18:24:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465346 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dn2gSdh0" Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A6610C2; Wed, 22 Nov 2023 10:24:34 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c8879a1570so1049281fa.1; Wed, 22 Nov 2023 10:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677473; x=1701282273; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NrrDffuKyIXgLjHrahGVH1z8qYKZoBaB1/UsWeUkuOI=; b=Dn2gSdh0Ed7bGir0riAhxGH/5IKZkgRJFxHezNMqJQdxieVQIJm24ZA9o2rzMJQkq3 fSkraeyEoy5BQHZClfbqCeuJz5L43JLIDDR3KcnuVZFLYyTt+to5o4U6GoI5yVJbaVlM eaCAXTyp6lM2gZt/JQFRYjUh1o3+ckjO6oFpGt0c22BzjkSgasKDH/kDUrAiHEh5oe4k l5wPmwozXrPtODp+iytZj1KPSNAoRw+ikoOamBFWbEExaGk7LjZRK6A0iZjNzl+LtG92 LAqmw1mEtTa1dUwWKvE/UBD47CQs/V9AZnoUsSpi+hEB+YMoqEOMc/GR0yarVMDaazTr s6ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677473; x=1701282273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NrrDffuKyIXgLjHrahGVH1z8qYKZoBaB1/UsWeUkuOI=; b=IisMH87luUvOD+zg0ObK5aBCH4HlTW7WsgE/LxEZq3teOcI34K3xulHpO3qZECi548 qpG184PhqTdg0EM23NrhGxCxzmrWDExpaqNm+7VInfXnfsHikvLEm8me4dGdz/4J0t00 kMbgQ3IPfTHOBblIcQ3osOjXAmLJuK6yST6hPlRj4YzN3hOOext2bzJOEV3eJb7APMIn TA9oOrapGyENg1iFNVksb/OwfruJMXIlG/wgWiSp0gaz6GLP3e+74jvmoqLZpCR/ozyw J0qd+Sv1sQKvzQQsohLv8AHPKv9FJV8lNn82MhE6cfcTk4uFSCFFY2RfYXPqC1oOfw+1 C5vA== X-Gm-Message-State: AOJu0Yx0QTtSIluDZfJAwQWy6vAZ8t7VH4fMIXak/ZCTIkWFJ1W135LC hgsjorPOQLBTQ5p/9rIoE/M= X-Google-Smtp-Source: AGHT+IHlyJFYDUK09NiVpLzUjfThYPAyTd5SkNxX1GDZ7WAcgUV7PWYzLSbmzPwSJEKgWLIIXW4sAQ== X-Received: by 2002:a2e:2a83:0:b0:2c7:4220:56f3 with SMTP id q125-20020a2e2a83000000b002c7422056f3mr2440133ljq.42.1700677473058; Wed, 22 Nov 2023 10:24:33 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8653000000b002bfec05a693sm12343ljj.22.2023.11.22.10.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:32 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] mm/mm_init.c: Extend init unavailable range doc info Date: Wed, 22 Nov 2023 21:24:03 +0300 Message-ID: <20231122182419.30633-6-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Besides of the already described reasons the pages backended memory holes might be persistent due to having memory mapped IO spaces behind those ranges in the framework of flatmem kernel config. Add such note to the init_unavailable_range() method kdoc in order to point out to one more reason of having the function executed for such regions. Signed-off-by: Serge Semin --- Please let me know if the IO-space pages must be initialized somehow differently rather relying on free_area_init() executing the init_unavailable_range() method. --- mm/mm_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/mm_init.c b/mm/mm_init.c index 077bfe393b5e..3fa33e2d32ba 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -796,6 +796,7 @@ overlap_memmap_init(unsigned long zone, unsigned long *pfn) * - physical memory bank size is not necessarily the exact multiple of the * arbitrary section size * - early reserved memory may not be listed in memblock.memory + * - memory mapped IO space * - memory layouts defined with memmap= kernel parameter may not align * nicely with memmap sections * From patchwork Wed Nov 22 18:24:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465347 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IruV7NVz" Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D2410D5; Wed, 22 Nov 2023 10:24:36 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c4fdf94666so984031fa.2; Wed, 22 Nov 2023 10:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677475; x=1701282275; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Du+BFHRvMyqAEjBg6RSkcIbKkpwDLrCm/CbvmyChoXU=; b=IruV7NVzKskCqLWX31NWw9KJ9LqADYT1YUG7em2E7u+vp2MnnDrDoh3jelpnQ8/msS U88F8/4RrHwgb5T3JtdPF55JsyCNkRgtMVut6OkXz1etB28E3uRGn5TBFoFuZWGbvHj3 gWcAJRFML2huyZwMEjfT0twK6ywZiomuf+KqQ996BBqLeL8XtgfaRFIWl9k6unXC4O3E awP16Xxb/Zpkl/MN7Tsxu9j1OZMrF5GB/sVrjA1uNXkxhYzATM1mlfHeRXAMZiv9vqiC Bg2qBY1hOVJCV6cGdnPjYhWhhSI7EaREIpTWSpE52aqiXrLoNa5SL/QfG4W3m72z1295 8Y6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677475; x=1701282275; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Du+BFHRvMyqAEjBg6RSkcIbKkpwDLrCm/CbvmyChoXU=; b=r5UGVCWDXia5Cxcn/XYt2I+3Bg5HCluctM2GC44d9b2+2beT0iXur15RrylE3+NKkL h5ArGAnXUE80zmzEh3iAiCOSP2VEafcgrmQcQE9sB7QkboxsOj2MiMznC3EqDtOLGFc3 ijrpYlql91rrLS+t6Qg3VbXFrCckcBLyUL8Wic7xE/Iadam/hQEeKevU6CuipTHotcyv Pn3PKyw1fxSG/kvaY/h8hsuDT3td8YlN8VICaA7xpVTXdMgSUPlx5tZWbthQysO2cxyr 2eKYOU8+/E3upAb03bB9dRxM/mbVTMhQYA4/Nb75zFnmOGFsdKgOJT7gwIfOtayWrfk3 V4Yw== X-Gm-Message-State: AOJu0YxkrCviWh0Nf1RQ0oGj+yYfG9VRCeFrgXafXwR4+nPpljwDB1wb W6nVBRGYY5kUj42jc9nT6z8= X-Google-Smtp-Source: AGHT+IFKWUisXZgCOFxFmnquMptaMMQFLtq166qNTXQ2pfa0VVlheCvm7EXFGBwSINIn8btqNBHhmQ== X-Received: by 2002:a2e:86d5:0:b0:2c8:73b7:5a1c with SMTP id n21-20020a2e86d5000000b002c873b75a1cmr2181439ljj.3.1700677474971; Wed, 22 Nov 2023 10:24:34 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id n16-20020a05651c001000b002c884919bdfsm12238lja.10.2023.11.22.10.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:34 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] mm/mm_init.c: Append '\n' to the unavailable ranges log-message Date: Wed, 22 Nov 2023 21:24:04 +0300 Message-ID: <20231122182419.30633-7-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Based on the init_unavailable_range() method and it's callee semantics no multi-line info messages are intended to be printed to the console. Thus append the '\n' symbol to the respective info string. Signed-off-by: Serge Semin Reviewed-by: Mike Rapoport (IBM) --- mm/mm_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 3fa33e2d32ba..db8b91175834 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -827,7 +827,7 @@ static void __init init_unavailable_range(unsigned long spfn, } if (pgcnt) - pr_info("On node %d, zone %s: %lld pages in unavailable ranges", + pr_info("On node %d, zone %s: %lld pages in unavailable ranges\n", node, zone_names[zone], pgcnt); } From patchwork Wed Nov 22 18:24:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13465348 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DlWSmf+8" Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C143A2; Wed, 22 Nov 2023 10:24:39 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c50305c5c4so1013661fa.1; Wed, 22 Nov 2023 10:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700677477; x=1701282277; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ygdtXD6vQmhTkyIIFbEZLW4cEgmK3nTQybwd/aOy/dw=; b=DlWSmf+8f7QUpkhL5IcS9u0DvbcRC+XQ2AlTWBtvdwo6I7b9ZyEr4vo3GD+Ogt7xl/ kEi6YuCS0Na4VtPiUpZVeFdeb+7xr5TtvfLLtveGP+3wfwK3Qj7xbDsq+JijgqcoMvzB HJ91BZuP1gXhOCvD1KRu0J4wHtZDb86i46ivcPCc9ZCHkEgGl3mJdYwNWWlcpwRld1lq zh/6sXcFw2nQkvz54rJgbI9LMhY5teVDWWXDzQAZTY9Ucrv4TvsPkipmFwUFM8ElctwC Iv9lotx5l+Tgp/U0ZHnQs2gnm8c8W5vfjmd7eOCnHbR+XXv2c7MA2W2VngqHqkyl6JzT ECVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700677477; x=1701282277; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ygdtXD6vQmhTkyIIFbEZLW4cEgmK3nTQybwd/aOy/dw=; b=t9zj5TJn0HAptGgV9zU4uTLn62sTHZX+tEUnUc7Yto2zrrddJBBnImdoe0lb3AF2t5 vYUzz+b9RoFsy0jFv/FogP1Q5JADKl79wY64j7D7ETFjS2mhP3cvtv+rRLQQXaSC+FOa 5W8u2zTXs1T0GTxeEifivNT81hWDM0cLlnUqm7qw0phMBT9yfFgytU+OW8jxR5wkxUsM YQvCmR+jgjY0wLnyjjYllEINKKGIwR1AJxCbGcF7hLm9VZF7+xecYHN0inqm92p1bDL6 QACVpt8ayPTHzbAWxc8ZMxXegTpGq3IBx17RLv6aeI+qoedk14K7eTGmtSjOSvm9Dnzj X3oQ== X-Gm-Message-State: AOJu0YycL3Mg0WYFsTTT7WS1l2DtlEJz58aDeaINd87eNlTY7wgTiuLV f2phgWK1i6RQEnfrUxMLmvI= X-Google-Smtp-Source: AGHT+IGOQXheOS+Gt4rJnqKjpbv7GijHFeJguvjzbMNW2BiOOY31AXGILBqTgE/H996cdvS6H0FlrA== X-Received: by 2002:a2e:9d54:0:b0:2c5:15dc:ba99 with SMTP id y20-20020a2e9d54000000b002c515dcba99mr2236124ljj.51.1700677477316; Wed, 22 Nov 2023 10:24:37 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id w5-20020a2ea3c5000000b002b9e5fe86dasm11422lje.81.2023.11.22.10.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:24:36 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Andrew Morton , Mike Rapoport , Matthew Wilcox Cc: Serge Semin , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] mips: Set dump-stack arch description Date: Wed, 22 Nov 2023 21:24:05 +0300 Message-ID: <20231122182419.30633-8-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231122182419.30633-1-fancer.lancer@gmail.com> References: <20231122182419.30633-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In the framework of the MIPS architecture the mips_set_machine_name() method is defined to set the machine name. The name currently is only used in the /proc/cpuinfo file content generation. Let's have it utilized to mach-personalize the dump-stack data too in a way it's done on ARM, ARM64, RISC-V, etc. Signed-off-by: Serge Semin --- arch/mips/kernel/prom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index f88ce78e13e3..6062e6fa589a 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c @@ -28,6 +28,8 @@ __init void mips_set_machine_name(const char *name) strscpy(mips_machine_name, name, sizeof(mips_machine_name)); pr_info("MIPS: machine is %s\n", mips_get_machine_name()); + + dump_stack_set_arch_desc(name); } char *mips_get_machine_name(void)