From patchwork Tue Feb 14 14:07:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13140212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5329EC05027 for ; Tue, 14 Feb 2023 14:08:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8B526B0074; Tue, 14 Feb 2023 09:07:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E3AC66B0075; Tue, 14 Feb 2023 09:07:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D037C6B007B; Tue, 14 Feb 2023 09:07:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C3D2F6B0074 for ; Tue, 14 Feb 2023 09:07:59 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7C6B3140DE4 for ; Tue, 14 Feb 2023 14:07:59 +0000 (UTC) X-FDA: 80466076278.12.66569E9 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf10.hostedemail.com (Postfix) with ESMTP id 8E096C000C for ; Tue, 14 Feb 2023 14:07:56 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fb1OpkD1; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676383677; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aVaGmk1yURtbn3M9+0tmntSpCwDmHKgnlgIcC5ybYRY=; b=iylJAe7tmOGMg+JYxYV/6Vn69htheSsXhe1k/bmSYFJ70xMHzHfBZ6oLF3z+iP2rL2iHxx 2NEROgO3N/EkAUjCMrOPNSaqIoLfghwnlfKG98GOfcYqMQF67IBFiZlRLyZv1d8lNQvZrS 0D1jU3aNC8lX6ewjovG22pc+kIGqZYg= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fb1OpkD1; spf=pass (imf10.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676383677; a=rsa-sha256; cv=none; b=fPrwx0Of/KpcleFibwZ6DVVD3CjG8moIeteOo8Ra8hbnMUq4sR0Q48ZQdLG5oCQwQ/+b2o s3tKlo+YN/c99UhTkjJwaxTjtFrPxKKzD4PUHrGR0BybO+UHBJhQgIA2CjBAZy2JqBoMqY nHKZQ1G5k9YTjWeplN+oi4fus4PUW5g= 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 sin.source.kernel.org (Postfix) with ESMTPS id B9391CE2050; Tue, 14 Feb 2023 14:07:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E66BFC433A0; Tue, 14 Feb 2023 14:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676383667; bh=hilxX2cQjknwppv7cWUkYn/TC2HNghGbRCGtPZUipXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fb1OpkD1Rcgt+yjx6j0dskJpmYd7Wcm79sGSRVdoifLSQVDsuflzPNK9L15x5pkRv lCXqi9/drSZIXX8jqhBIK6zQ2s7M82tSH7IVmllUviRrFkH9LQovRU98TBMC83lLMz 0gQVQRezqi1LsB9rh2ixY3CfTMSRMqnXqyYZZgn55tOVjr6AalSV851qW1rMEzN2vD 0gbR2lNgvjhFTyt6QFQQ+Wk0UPfnS6RMem7wYAiZchjU8qBEGsjYXSG9xXeSy5vCgy kG0arrNCXb/+ylN6xHu64RF8d0QYnn7414CBeGgFnQC5aXXlPTugLBq2WS4pZBf3J2 vV9SkD2uB11Aw== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Greg Ungerer , Guenter Roeck , "Mike Rapoport (IBM)" , Rich Felker , Yoshinori Sato , linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org, linux-sh@vger.kernel.org Subject: [PATCH 1/2] m68k/nommu: add missing definition of ARCH_PFN_OFFSET Date: Tue, 14 Feb 2023 16:07:28 +0200 Message-Id: <20230214140729.1649961-2-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230214140729.1649961-1-rppt@kernel.org> References: <20230214140729.1649961-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: kz7tj3rhmpdygg19czshi6quouiupbop X-Rspamd-Queue-Id: 8E096C000C X-HE-Tag: 1676383676-653500 X-HE-Meta: U2FsdGVkX1+XS7jMVMT5yU6Lf6koq/L1eQY5hHgGclXrFScHeWLw6VW5tdMaVk//LK59C/fDrXsObn53+d8UykwNEoqiKC74e/GCODdoUqShsXssIa0q4l8L7bjd6d1u0hcSa+tQ+yf/a4GWN4Xxkk2zaR9bymXjxpfJ6DyiEscvUZOtpEijYMiKtsY1ogZ+l+iWSqEG9ipCVKh5cf9W4BxGf790fLRSm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KnVhx11ryuoZDxGdC0jn7eQO9u0r/Uxmj6OOtPTLKnBtP3vD9Fify22/nGIifWqUBTg1LEsuHkL/Fvd4QrKsQWFPMb6ViCgAZr/owbJj9daXH22i3b4M3cSNz9JtTD/Zd6y9736NnLK4f29VDFhw5Lhpws4CHzLjg1rbbyPM5pKcdcNid03A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Mike Rapoport (IBM)" On m68k/nommu RAM does not necessarily start at 0x0 and when it does not pfn_valid() uses a wrong offset into the memory map which causes silent boot failures. Define ARCH_PFN_OFFSET to make pfn_valid() use the correct offset. Reported-by: Guenter Roeck Fixes: d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU") Signed-off-by: Mike Rapoport (IBM) Acked-by: Greg Ungerer Reviewed-by: David Hildenbrand --- arch/m68k/include/asm/page_no.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index 43ff6b109ebb..060e4c0e7605 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h @@ -28,6 +28,8 @@ extern unsigned long memory_end; #define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \ ((unsigned long)(kaddr) < memory_end)) +#define ARCH_PFN_OFFSET PHYS_PFN(PAGE_OFFSET_RAW) + #endif /* __ASSEMBLY__ */ #endif /* _M68K_PAGE_NO_H */ From patchwork Tue Feb 14 14:07:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13140211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2830C61DA4 for ; Tue, 14 Feb 2023 14:07:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 42A736B0073; Tue, 14 Feb 2023 09:07:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DAB76B0074; Tue, 14 Feb 2023 09:07:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A3966B0075; Tue, 14 Feb 2023 09:07:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1B6A36B0073 for ; Tue, 14 Feb 2023 09:07:54 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EDC0DC078A for ; Tue, 14 Feb 2023 14:07:53 +0000 (UTC) X-FDA: 80466076026.29.83E7904 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 4C6681A0032 for ; Tue, 14 Feb 2023 14:07:52 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=s9uEH0FY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676383672; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hhMq3S/oK3zmHM6mECWJ3kOuXpuXOpWnzY9XqYs6QPk=; b=VoLhexEJfHLLpE9l5sOt5CimEmKTTqPNYR7OwS4JSCLY52bv7pg9pLRNRrV0crgyDZnJSJ pKRgEfwBT7xUSF9FweSztCk649s7bwqsvmPGsAkH/9oSSoVtpuVDuVVJs5i82p5nd/ko9J ErdLNMyNTLOKQ3hVzVqDSkGQfPGPi6s= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=s9uEH0FY; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676383672; a=rsa-sha256; cv=none; b=vTEWx0v6Hf69laqMgrv4tTQ26bw0z7x+0U7lWLuMDohjfbMOl1ApGr7YWpuc46U3s/xbmQ T3EumBLvQkBhG+cpIKu5N3rd4o+O4+mO4UkAYq0e6rqClPTy+p1ZNhS4n3TPUOmvQ5kn1A hMgtwRbkE5Dj/iKoNP/eASutrzSDBDo= 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5DB59616A0; Tue, 14 Feb 2023 14:07:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D563C4339B; Tue, 14 Feb 2023 14:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676383670; bh=OaKxI8asQTEjsEh6yfL74O5y0APlN8V2pOfAUwHuYPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s9uEH0FY0E59Lne0jrBhkQf1M8apaJ4Q5qecHu2ul3FABQgIuCLiaX67MlXCfJKIP REV6oT63TsGh2uzEnR6pEqfoZS/Mv7zRh0jY/1seyA7HVtaFiEkwLPSSIQymvZhD5j vC2hiiI/90K3ubqTQezm+4Z8s6GsfriFu3fYHCGHgITD9g9h8cIqdv5DgxHYPrg1hg 7FkupLjpl02YxWT7EReno9nxekdM9ZnEy7IPxyjT7xBJ0MY/nWbprKqXaRz3c9bqGI J5CcAY5uJxb5lb/c/PCC4VM2plmW+gV10L7/SI1cUyuoL+hPjrQuQO771g7J/kD01N b4DjHYylyTrCw== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Greg Ungerer , Guenter Roeck , "Mike Rapoport (IBM)" , Rich Felker , Yoshinori Sato , linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mm@kvack.org, linux-sh@vger.kernel.org Subject: [PATCH 2/2] sh: initialize max_mapnr Date: Tue, 14 Feb 2023 16:07:29 +0200 Message-Id: <20230214140729.1649961-3-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230214140729.1649961-1-rppt@kernel.org> References: <20230214140729.1649961-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4C6681A0032 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: z5cnsi8zsryqb9cjewmqi6njbfcw1wk8 X-HE-Tag: 1676383672-906664 X-HE-Meta: U2FsdGVkX190mPOU6SlXWWEDbEDgLZMpFRSIM60yI76YgbZcAuQdY/OjMimtKSe+gnOFknWitp/gyeQea4y9ZStTAxXWbe2Wv/0Lq1sitEJ3UoL/adYbXQLmzKs7IRKYunJx7jIEHhCgpaX+cKOji2Tj9qHuUzJ3o42NWKbC3HznXATFsIgvUI5UPD0qHGmZSKzRoEzC/IQyHGlLfHChGCooQDHsaxBKTBfvTHT3j+lt9ZsQFEgPfCGmAEt4B8B+EDSa1Y53Zb578xrSXskSrTcirI31ROOD/15RRgA8Gn7Uv50yqnjUV7jrvbnVtRRIxlvqNCH7rMLuNzD/X86gQWxXywvaMw/CXYIGCXDWG3odSsJVoouEom3X/hmFPtyL3omEy19IOYC/+9KIRb7HLIwotzQL0AjJbTGhVipJ7PiyLq6JLJfeWwAGlPFik+rY00euVaRAhcl/524LrkXnCTZugQ3KSGvjDo+V2O1JrK/kfPUQYVcz3hfF3W1HK5VOolju0SDHgT9y1TnUO+zw1hwxlsqvtd1Fi1bdRL382faXaVIIOUAGG5ahLfQaS7vjPCGRb8yEjcFMRTbmNmUe19kK2tPD7WQer3jp17DP3cctBMiqc3TXg+VU8lPTZ7FodF9XlGhIdv8oeTHeYOS4KJDUcv4nnguO8CKJJymXIScFLKzdIDXQ/xSNi+9GfzwcWzRziqFksSogGhwuSJgZvWjkmbXi2a+vynbPdNWMNYzpC8oroqeveYJtnQ7LHMEMASRp0SZ/B0OU8owCtpFJYMswqoOxwoIsAUPxVe62YNEO8SJDEOvTEzDe4I4kmqKxH9W4raNf2I7VZnr2kSZfJf98lkexmQ95AhEZ+FPX8ZUUycrNQTDmacL/q7zTiZmNJVAoJmggJ+jfM2j9oc/7UCiuxjLkE6k8iMWi+TuhHIyBT7rqGLxBARwprYTJUiwnz6Md7oqL2tLQS3DCah0 tvA3yUnG 1tXRscsSiugSW5ySmaEI8gce1c2oNwZ6xdEewZz95JS0bUoucjA2rKE3LmaVo3KLNQSgwBzhQtNiK9DVVdmPJebBa4X7ZQXhKythf7jz6SkTxfdCckTQDPnlZcoYNx1TGODXqUzkAmc8UwUiJlSm4/PGFVnBeiM5W0mZbP47nlUnRZ4rHXXnjRaL8qYbzc3LLT7tkRmMgOHnq5Wiq4Zk0D/wU5njgM+aRMTvGz0fs9EKmtwE0j11///V3D2TjyKyenvXkC5khK5bUMTHWSoB1tKa7RW2MX5rySLv0S/m0cEILyXxPQcjZk0CroszEP12G7XiBk6dVtR8SYXYvv51hBHaW1pXdRVvRIrzZmhAkNWR9SjZIwGQvGBmClD7HsUo3mDw8sZDSSNigG1FlTJNMz0muIQgICiyY3KlQmoWGCU9v6g/iSeC462OE7En1z2SkT/8gnQBSx22Vq3o+Vy0lL1SwvA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Mike Rapoport (IBM)" sh never initializes max_mapnr which is used by the generic implementation of pfn_valid(). Initialize max_mapnr with set_max_mapnr() in sh::paging_init(). Reported-by: Guenter Roeck Fixes: e5080a967785 ("mm, arch: add generic implementation of pfn_valid() for FLATMEM") Signed-off-by: Mike Rapoport (IBM) Acked-by: John Paul Adrian Glaubitz Reviewed-by: David Hildenbrand --- arch/sh/mm/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 506784702430..bf1b54055316 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -301,6 +301,7 @@ void __init paging_init(void) */ max_low_pfn = max_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT; min_low_pfn = __MEMORY_START >> PAGE_SHIFT; + set_max_mapnr(max_low_pfn - min_low_pfn); nodes_clear(node_online_map);