Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9106085pxu; Mon, 28 Dec 2020 06:47:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2nGCVwkZGkHuJSsPP9g12gncVpd1hlQmBSc0MAgpO9qcQotgMuAjuwHk7Mr87fM66Y211 X-Received: by 2002:a05:6402:d08:: with SMTP id eb8mr43242913edb.271.1609166859181; Mon, 28 Dec 2020 06:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166859; cv=none; d=google.com; s=arc-20160816; b=LkbICN6Hp7+D+Zfu6WxO9zIEYU+9FEZj+nDcnzDPDgmus3nTgo0GueErCGNAwMG3X6 37YoLtuGbs2R53vg6iXJmA4u7wRjj3ezAAbZM6dlwgYVpIJA+/gC19sh21qD0ZYmO5br 3Q5jHNZ1zhgDyN18mGYo1kUTPMB1zVSUNAwibpv3Q1dEWAx5OITsgan+qj8sZCjy+sJG pNqTH2yEmuaVa9MPmAHHhX0c73eM6Yy3gvme4Ci6h2vn07nvvMRuyF9AN3AwyL5jwZPp 5kumRLORbg3Af5uLkl/wrLchrAPvEHqsDWrbk1S9Dkoa4b6MPs7k56SxDL0/eseSJleN GxbA== 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=aPNfOw/O5hIW3we7uFaAFmTYag8KKjFgD6C66RvU334=; b=BQKZ0GF3Zk4Q+cGn2rJwaV+DS9alJYeUi9D6kXxQZXzL0QfmP/UYlyDmXDH4X26IKQ onlwhKRtQXfyzKlqQyTMmlMUVbqKHqQab/gfbLeu3VzKIAIMEl/htcaIwNxYJm7zjRu+ fXQvM3eoi+uvCoxjZIVJ51n7TsXOvBaIJkMCGFapJckGt3f7t/3ce8qJeIG7XTrtovYv RwK61FhYAKcvvplVVlYcX+/tymGT0GedC+NshEbIt3jgXSfYG0+5rRlVK3ZK5E/VsfTH z/4GEwIRlPWwzjWdKibkcEgMp9sCjwllo0HHpsVXUE+o30cr9jLvymWVxd+lJhHrt+Ji X1Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yUup/evK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm7si20375192edb.185.2020.12.28.06.47.16; Mon, 28 Dec 2020 06:47:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yUup/evK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2506315AbgL1Omi (ORCPT + 99 others); Mon, 28 Dec 2020 09:42:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:35440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502321AbgL1O1h (ORCPT ); Mon, 28 Dec 2020 09:27:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 260E822B3B; Mon, 28 Dec 2020 14:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165616; bh=jsXIYmTeoZcSyAe/wWWFr28PMJlixSJ1U0qNOZYhKUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yUup/evK+yO8p/XW6C26QLNnB0lh8o1nR14XkFh/o8TAApmho1bgZbtAINX8LF4JL 3m4sG9e+svt0eyJB3a4pAFpiaJoVX6WqVVxJNG99UiFqN8c1mmagSwr2B38BInefTt GNuvS3Wb56B2EMxRqjsPWGMpm95HPHqCiWcgkhVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bin Meng , Mike Rapoport , Atish Patra , Palmer Dabbelt Subject: [PATCH 5.10 594/717] RISC-V: Fix usage of memblock_enforce_memory_limit Date: Mon, 28 Dec 2020 13:49:52 +0100 Message-Id: <20201228125049.370627127@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Atish Patra commit de043da0b9e71147ca610ed542d34858aadfc61c upstream. memblock_enforce_memory_limit accepts the maximum memory size not the maximum address that can be handled by kernel. Fix the function invocation accordingly. Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") Cc: stable@vger.kernel.org Reported-by: Bin Meng Tested-by: Bin Meng Acked-by: Mike Rapoport Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman --- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -174,7 +174,7 @@ void __init setup_bootmem(void) * Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed * as it is unusable by kernel. */ - memblock_enforce_memory_limit(mem_start - PAGE_OFFSET); + memblock_enforce_memory_limit(-PAGE_OFFSET); /* Reserve from the start of the kernel to the end of the kernel */ memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);