From patchwork Tue Sep 28 18:51:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Goldsworthy X-Patchwork-Id: 12523579 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 95E7BC4332F for ; Tue, 28 Sep 2021 18:52:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4690860EE9 for ; Tue, 28 Sep 2021 18:52:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4690860EE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id DDA8C6B0072; Tue, 28 Sep 2021 14:51:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D888A900002; Tue, 28 Sep 2021 14:51:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C275C6B0074; Tue, 28 Sep 2021 14:51:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id B66D36B0072 for ; Tue, 28 Sep 2021 14:51:59 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 72CF6182D10BE for ; Tue, 28 Sep 2021 18:51:59 +0000 (UTC) X-FDA: 78637876758.27.DD37D23 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by imf04.hostedemail.com (Postfix) with ESMTP id E7F8750000B2 for ; Tue, 28 Sep 2021 18:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632855119; x=1664391119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=GMMRKpJEtRdcqo7mQHQKLh9TwKsB1pEChAZ7QINVZTE=; b=dhzyjelv+DEK+X/QkIlKyIWXgfByWKSj0s9tDhj7vJ3vcT/rjjdRyvKt EQCHk+T0SjahooWTzGSmq/IfWsKeJe1H0G3zY8bxRSnCw6iuUisQA94HH 19/pWp0RPV+shIjq5VWTXYhzIoanPrS14F7zgZL14/FUP4vCkhxZqdrx2 8=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 28 Sep 2021 11:51:59 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 11:51:58 -0700 Received: from hu-cgoldswo-sd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Tue, 28 Sep 2021 11:51:57 -0700 From: Chris Goldsworthy To: Andrew Morton CC: David Hildenbrand , Catalin Marinas , Will Deacon , "Sudarshan Rajagopalan" , Georgi Djakov , , , , Chris Goldsworthy , Florian Fainelli Subject: [PATCH] arm64: mm: update max_pfn after memory hotplug Date: Tue, 28 Sep 2021 11:51:49 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=dhzyjelv; spf=pass (imf04.hostedemail.com: domain of quic_cgoldswo@quicinc.com designates 129.46.98.28 as permitted sender) smtp.mailfrom=quic_cgoldswo@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E7F8750000B2 X-Stat-Signature: piangxm93eobkts1w33e71uy6ekziw1c X-HE-Tag: 1632855118-674068 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: Sudarshan Rajagopalan 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 Reviewed-by: Anshuman Khandual --- 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 cfd9deb..fd85b51 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1499,6 +1499,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; }