Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4138390pxb; Mon, 21 Feb 2022 13:04:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrpj/ChqK9zgJwVq1+WBeCKH5IxnCwz62wcL8T6iEDwELqlY+SAShqtKUAOED6DRW5+xUA X-Received: by 2002:a63:4c0d:0:b0:373:9b10:886e with SMTP id z13-20020a634c0d000000b003739b10886emr17348222pga.307.1645477456185; Mon, 21 Feb 2022 13:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645477456; cv=none; d=google.com; s=arc-20160816; b=OvyQBGnECGoZBb8We3+gBnSaJDU5URZEOAtl1HWQ6uvV0j8Cu7HQefnMuddyo95V8g DurkeoLyyg8EMOLPk8gLOMyKedsGLi8N/zB/qJP9aL3/rhpxrEOWujgN72dG6xn9Y5IR Jd4XJou5kT8ceexbBpF6HKe0bnNsYmBmqgxQs4BRV6bHqqMUfJUgRqkBc71F3aIXR4R/ HONegYOsL0dzstE40LPPeI+Bocs9oPDP/47OHamYPKlLlGuP+EfKG167lc6ntu/fdzgd iuSNQYrpBctaItFw6xH9xE3xe3FRY5N5OWn8ch/kwokPANw2/8/GlGyUmk0sMz4NvNai Q60w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PJDrYsdGD2tc2S3Kuwehq8t4svxiUJoCbOy7mHtn3bs=; b=hPFXIRRPxMfy0mEodPlSHYeH0j4WNQVV04p6//02l//DpVm3zxSp/y7QbtL+hVMRoV k4rnai9rictLE38VNYuarfJIho/hMWc0cLAuHYShVX4T5lSvfZiqLKNGijbrBjVG0yLV 3ec9vORZyvddCkXKYrJq7ZVtqOgneBH7TfcYx/I5mErbDXOEsdP9AtfnAhZxJsXnk2qO qnuPsOOZ/FHnaYRz/XlBqCtkupjw2yHMpduS5DqyDNGiSdpHcCyf+QT1b4DHwevGBuIq 6Y/zM2y7Tk8w9B3DLklj2/oqcvv9aGbag2bIciz4kedG+9wUhXkUZc4lsN1yH1kJRK/o UTxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="B/0X5lvr"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu1-20020a17090b388100b001bc5887d953si438321pjb.86.2022.02.21.13.03.59; Mon, 21 Feb 2022 13:04:16 -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=@linuxfoundation.org header.s=korg header.b="B/0X5lvr"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347585AbiBUJH4 (ORCPT + 99 others); Mon, 21 Feb 2022 04:07:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348487AbiBUJCy (ORCPT ); Mon, 21 Feb 2022 04:02:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDC12C678; Mon, 21 Feb 2022 00:58:14 -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 BB84B6112B; Mon, 21 Feb 2022 08:57:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3071C340E9; Mon, 21 Feb 2022 08:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433876; bh=jth1zaFSPBq8shktgRO3aI+1QIAjT7qWetuzUubsnf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B/0X5lvriF0seuspW9Y2Bd1sQDvHcWFu4j4ifQjkZMoMo/dVN9Fbe5DZdVMGcUidc V4GYtAlQHk8j3KA27QRsq9OSHku8izXdVmjGc1FXhw0USBuTu0nfqkgHPd10T+WnF+ nFzd0iXpAz4AIuX7r3gVOFqLP1Rqa1gaFtAHXKRY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John David Anglin , Helge Deller Subject: [PATCH 5.4 05/80] parisc: Drop __init from map_pages declaration Date: Mon, 21 Feb 2022 09:48:45 +0100 Message-Id: <20220221084915.762531012@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: John David Anglin commit 9129886b88185962538180625ca8051362b01327 upstream. With huge kernel pages, we randomly eat a SPARC in map_pages(). This is fixed by dropping __init from the declaration. However, map_pages references the __init routine memblock_alloc_try_nid via memblock_alloc. Thus, it needs to be marked with __ref. memblock_alloc is only called before the kernel text is set to readonly. The __ref on free_initmem is no longer needed. Comment regarding map_pages being in the init section is removed. Signed-off-by: John David Anglin Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- arch/parisc/mm/init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -347,9 +347,9 @@ static void __init setup_bootmem(void) static bool kernel_set_to_readonly; -static void __init map_pages(unsigned long start_vaddr, - unsigned long start_paddr, unsigned long size, - pgprot_t pgprot, int force) +static void __ref map_pages(unsigned long start_vaddr, + unsigned long start_paddr, unsigned long size, + pgprot_t pgprot, int force) { pgd_t *pg_dir; pmd_t *pmd; @@ -485,7 +485,7 @@ void __init set_kernel_text_rw(int enabl flush_tlb_all(); } -void __ref free_initmem(void) +void free_initmem(void) { unsigned long init_begin = (unsigned long)__init_begin; unsigned long init_end = (unsigned long)__init_end; @@ -499,7 +499,6 @@ void __ref free_initmem(void) /* The init text pages are marked R-X. We have to * flush the icache and mark them RW- * - * This is tricky, because map_pages is in the init section. * Do a dummy remap of the data section first (the data * section is already PAGE_KERNEL) to pull in the TLB entries * for map_kernel */