From patchwork Thu Sep 23 22:54:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Goldsworthy X-Patchwork-Id: 12513759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98908C4332F for ; Thu, 23 Sep 2021 22:55:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 341396124C for ; Thu, 23 Sep 2021 22:55:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 341396124C 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 CAF1D6B0071; Thu, 23 Sep 2021 18:55:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0E566B0073; Thu, 23 Sep 2021 18:55:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD6C8900002; Thu, 23 Sep 2021 18:55:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id A06276B0071 for ; Thu, 23 Sep 2021 18:55:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 583F2182C1541 for ; Thu, 23 Sep 2021 22:55:00 +0000 (UTC) X-FDA: 78620345160.01.85AE389 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by imf28.hostedemail.com (Postfix) with ESMTP id DD9C890000A1 for ; Thu, 23 Sep 2021 22:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632437700; x=1663973700; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=nzSKhDY13mK++9t7Je2bVwF1BfPMf2B+QPve7nlub6g=; b=JQ3izuF4vwPa4wyzRhjYciIn7yLVU2dKygOB6S/W2z+piF6QQlP+a3R7 Euo/ni30euyVxhMJB7HK3u9PS/8FZgNkH2RPX+yrAzAkO29+kse7X3apY i1dW84L2AItLMXdmo5yRdlaB3pxOjg5GdDEUsOyhgsnc3R7QjX9UoKvKW E=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 23 Sep 2021 15:54:59 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 15:54: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; Thu, 23 Sep 2021 15:54:57 -0700 From: Chris Goldsworthy To: Catalin Marinas , Will Deacon , Andrew Morton CC: David Hildenbrand , , , , Sudarshan Rajagopalan , Chris Goldsworthy Subject: [RFC] arm64: mm: update max_pfn after memory hotplug Date: Thu, 23 Sep 2021 15:54:48 -0700 Message-ID: <595d09279824faf1f54961cef52b745609b05d97.1632437225.git.quic_cgoldswo@quicinc.com> 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: imf28.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=JQ3izuF4; spf=pass (imf28.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: DD9C890000A1 X-Stat-Signature: tek88j6y7q7yxykuoedjo4tqf3k8baii X-HE-Tag: 1632437699-156128 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. Signed-off-by: Sudarshan Rajagopalan Signed-off-by: Chris Goldsworthy Acked-by: David Hildenbrand Tested-by: 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; }