Message ID | 20230214140729.1649961-2-rppt@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2994953wrn; Tue, 14 Feb 2023 06:11:13 -0800 (PST) X-Google-Smtp-Source: AK7set/mixjed+ommmwKXsCB0KMuye4MZy7IMq0U/Ayy+bt9lFiciWOO1IWk4H/01O7F/bzBe9m9 X-Received: by 2002:a62:18c6:0:b0:593:2289:f01c with SMTP id 189-20020a6218c6000000b005932289f01cmr1815857pfy.25.1676383873047; Tue, 14 Feb 2023 06:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676383873; cv=none; d=google.com; s=arc-20160816; b=l+rRjgVnIdDJttOsqEyG7QJ/cvaxvDiDOD98XmlwsYbXS5JKcA44BHvN+rE2r+CZUy UtX6Ww7NSvnSkCzYGmlVODijVC1XR66ru7aJxTESQbOaIU/3/Xqe81L8kr67UL180IYp ivugZfpyCa+F8+9FtF5ddsEWDoV4Bu9kTGNtLdTIic7qHBUurU8omV/UxN5hdXhfxPqi ukxlDXoM1KW7N5MLkuusoBcejO2xp0+avJvjnL510S9Sfo3UUOA4HJONTB35bDyKXzRl W/ygPvhqUy+lGO5XzmmU8dyhMRwpMSXyCzQg6ASCf4sJNHhTpL4o8QJ0OGIKpMLV6sI8 z7Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aVaGmk1yURtbn3M9+0tmntSpCwDmHKgnlgIcC5ybYRY=; b=TNJuL59ZXvpk9m1vnJ0e94E3PIxQw6SHnYR2drPibCBde/Za02N64M4Mh5Ey6yqgG2 SaTjr6StuGWoANZOeZ7ria8UODvRgYNZFSc6MfQTDCyc35YqYkRHs9O5tpLR7RPMY8EE pmS2F43koofKwCfq9gZJZDi1OBB/yW2jNyJJhBNvFNSUkJkhCIR62iZckxn5SdCjHx5V xSNXt8Mf6kwUekaLrJofD8E78WMJOwVkMK5aKG14ANkNuLyo8nKc8KgyWbW5POauyY5c 4DcguW4PsacYOD9EIjqU+CHWUxFCwDU9XNM59HPBDqAa/xGVTaG7y9BQPI0gv5Fxz2IR rCcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fb1OpkD1; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020aa79435000000b0059072f087b7si1504007pfo.135.2023.02.14.06.11.00; Tue, 14 Feb 2023 06:11:13 -0800 (PST) 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=Fb1OpkD1; 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 S233250AbjBNOKK (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 14 Feb 2023 09:10:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233244AbjBNOJs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Feb 2023 09:09:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA6429419; Tue, 14 Feb 2023 06:09:09 -0800 (PST) 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 A219B615EA; Tue, 14 Feb 2023 14:07:47 +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 <rppt@kernel.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: Arnd Bergmann <arnd@arndb.de>, Geert Uytterhoeven <geert@linux-m68k.org>, Greg Ungerer <gerg@linux-m68k.org>, Guenter Roeck <linux@roeck-us.net>, "Mike Rapoport (IBM)" <rppt@kernel.org>, Rich Felker <dalias@libc.org>, Yoshinori Sato <ysato@users.sourceforge.jp>, 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757815896448312730?= X-GMAIL-MSGID: =?utf-8?q?1757815896448312730?= |
Series |
fixups for generic implementation of pfn_valid()
|
|
Commit Message
Mike Rapoport
Feb. 14, 2023, 2:07 p.m. UTC
From: "Mike Rapoport (IBM)" <rppt@kernel.org> 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 <linux@roeck-us.net> Fixes: d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU") Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> --- arch/m68k/include/asm/page_no.h | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 15/2/23 00:07, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" <rppt@kernel.org> > > 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 <linux@roeck-us.net> > Fixes: d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU") > Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> Acked-by: Greg Ungerer <gerg@linux-m68k.org> > --- > 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 */
On 14.02.23 15:07, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" <rppt@kernel.org> > > 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 <linux@roeck-us.net> > Fixes: d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU") > Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> > --- Reviewed-by: David Hildenbrand <david@redhat.com>
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 */