Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5164397pxb; Tue, 28 Sep 2021 11:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/yvLH8o135lPMbjgzmGTlp+QTZMB3x8pBqqETVY7dXjCPfNWfgULGrxSn036qrmv3NIF5 X-Received: by 2002:a05:6402:8c5:: with SMTP id d5mr9420412edz.122.1632855264006; Tue, 28 Sep 2021 11:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632855263; cv=none; d=google.com; s=arc-20160816; b=DTZP4LvJSbM61gWm74hCtp3s7mdqe+QwXQv9/NcdAVIR6bqcPNWhN4c8Keo+QVWlXL /sMqQdaWMebtK70NGb3qi7VGIhxfBFnYSOqQ2WNUsm9wO51tOsONm1LpKchsX3kvKzP/ geEiV1q3/+PyLwTTli7MXNY2CkfpN4rNa/CUJVDMR7iKw5kVsjQ/4RdKNahP0gmYVqWe qb9ZL2ygbmGd6QL0Tlk8Tcz81kO/wexMR9+57NiS7+MVNO0Puu2oM5nVV/NJfk9IERiX Pgf3nSFAwMtzv8l77GfzWlGFTRZegtyisqV5qqBkO678ni0xRgLa1snJCgy0ERRO74ss GCUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GMMRKpJEtRdcqo7mQHQKLh9TwKsB1pEChAZ7QINVZTE=; b=QWetwn2v3tNWorKBGGbAwzgOOdAgDA2IRXnMTwfAStjdKqbJZjPqF2B0q0UQvUJPc8 UABQd8fJ7gi83R3aKWpovnV0iXgrh+mCXVVsTrR01aeoeN6miL62XWuf9D2PCi9JsqmP MQASy+XwvdZYfC/D+FbNvxtQExQw6QfnRvHUXr6DCxI7+t6Pn0AppdHM2jBGzVi5VYkb m2VSNn5/XzLrpwsKupLHwxnmmCQE4nmVE+qqKCV+O7BvbKI0v89H9lhXUaWiYOo2nZQa pVSuG2XgC2EpxSQMfnpHBibmepXHrYO7RFaaRstq/9OB66Pp5k/6XIfrMzrFp7NVpE+A tlNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=dhzyjelv; 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=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os8si9006353ejb.418.2021.09.28.11.53.59; Tue, 28 Sep 2021 11:54:23 -0700 (PDT) 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=@quicinc.com header.s=qcdkim header.b=dhzyjelv; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242315AbhI1Sxj (ORCPT + 99 others); Tue, 28 Sep 2021 14:53:39 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:40652 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242305AbhI1Sxi (ORCPT ); Tue, 28 Sep 2021 14:53:38 -0400 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 Content-Type: text/plain 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.7.4