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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A897C3527A for ; Mon, 15 Nov 2021 20:01:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F3561B60 for ; Mon, 15 Nov 2021 20:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348984AbhKOUBa (ORCPT ); Mon, 15 Nov 2021 15:01:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:43724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239245AbhKOSCu (ORCPT ); Mon, 15 Nov 2021 13:02:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 214BF632DA; Mon, 15 Nov 2021 17:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636997837; bh=eG9j6xrVgPLLX3Z+sb3gZLBMmYe4uiFbhuijqRHNX3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QHw/6Gq9G5eZBbSFwQm3gpa85X/xSazJMxLbIAr4I7MaccDSme0ld389PsevIHat9 mObFvgOGdxt9yknPxF64jRfAHjqHxHrULMiWUR6w/mxsHoLuWy+o/GuJuTlmdUP3Ic OMo5zsosAU3bOxIkZ/QpLYHJJMZvY/a2wrwOB4pg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudarshan Rajagopalan , Chris Goldsworthy , David Hildenbrand , Florian Fainelli , Georgi Djakov , Will Deacon , Sasha Levin Subject: [PATCH 5.10 286/575] arm64: mm: update max_pfn after memory hotplug Date: Mon, 15 Nov 2021 18:00:11 +0100 Message-Id: <20211115165353.674982441@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165343.579890274@linuxfoundation.org> References: <20211115165343.579890274@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: Sudarshan Rajagopalan [ Upstream commit 8fac67ca236b961b573355e203dbaf62a706a2e5 ] After new memory blocks have been hotplugged, max_pfn and max_low_pfn needs updating to reflect on new PFNs being hot added to system. Without this patch, debug-related functions that use max_pfn such as get_max_dump_pfn() or read_page_owner() will not work with any page in memory that is hot-added after boot. Fixes: 4ab215061554 ("arm64: Add memory hotplug support") Signed-off-by: Sudarshan Rajagopalan Signed-off-by: Chris Goldsworthy Acked-by: David Hildenbrand Cc: Florian Fainelli Cc: Georgi Djakov Tested-by: Georgi Djakov Link: https://lore.kernel.org/r/a51a27ee7be66024b5ce626310d673f24107bcb8.1632853776.git.quic_cgoldswo@quicinc.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/mm/mmu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 58dc93e566179..2601a514d8c4a 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1492,6 +1492,11 @@ int arch_add_memory(int nid, u64 start, u64 size, if (ret) __remove_pgd_mapping(swapper_pg_dir, __phys_to_virt(start), size); + else { + max_pfn = PFN_UP(start + size); + max_low_pfn = max_pfn; + } + return ret; } -- 2.33.0