From mboxrd@z Thu Jan 1 00:00:00 1970 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 F0F4CC433EF for ; Tue, 28 Sep 2021 18:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D806561246 for ; Tue, 28 Sep 2021 18:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242329AbhI1Sxk (ORCPT ); Tue, 28 Sep 2021 14:53:40 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 54FC5C433EF for ; Tue, 28 Sep 2021 18:53:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25C5761209 for ; Tue, 28 Sep 2021 18:53:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 25C5761209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8Kd95YBfpPSwAHlTMHBxuQvK5ocUoKoNDNifO/2sTWo=; b=ffx6m1MOWphVz2 oj9ov2HCTuNQmucsFGE7V5GB7dCmm4kcbMDsq3paEJu/x2OX8X1dBlNzeqoLcslk4zZb//FdHrEs3 TpRVfW0ZXLtFFLOVgh9/qkaOzq4Z+eEFcR6wJHDPkg+Oerb8ClTvKfzYVYhMBIaw1sSnEH+QvsBdg yO3/hAbG4Mxq5sVejaG/JQnu6t16Qn81lmAr1lhEzSwSQ9npfkJU7uC+ovbGNFx22Mk1D8DccODhN gYx9DjhCHx44ZHITKNo3TBxGY6tY7E2wY9Be2pS8nrGdjsqz1Wkh4OtUK12w1kzVDu09KTsz/awsm f00+kRTjbzxzNU2+r/cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVICw-008Wcu-Q7; Tue, 28 Sep 2021 18:52:02 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVICt-008WbW-3Z for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 18:52:00 +0000 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:58 -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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_115159_230982_E231FB75 X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel