Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1038592pxb; Fri, 1 Oct 2021 01:58:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv+ELH9D8z2lgwkiHR8n0EaFQGcw2mYgCKgMJYdunBFb7bQx61mDpvmGaxAYtyhtqdVBQm X-Received: by 2002:a63:f5e:: with SMTP id 30mr8621325pgp.283.1633078698209; Fri, 01 Oct 2021 01:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633078698; cv=none; d=google.com; s=arc-20160816; b=ssm9Gh8qt34LHglDrMh/FnC5+PTZUMcdQJGY3/sBstGNmDSRWs5HIJhF794TaDue+W /efccJoKbBdyv6heeGtRnHn0kb3FVtoOjZwdbQV21Y65m5utBK9a7+em5v9cw3f8uhW/ z5Yk+BSbjzoqHSPBm3o+qgmD1t1DmqKhruI/7ydC5TIT8yL4PUh8eZ53VoPPkf8io7kn SHa3oM+TMENPn/ddljl9COTFI31IzpGC4Gksg6O64R6OZ/v0gmwNrTSyYeUda8nma+zG NjgmSZIuHVweZSOsr7KJ5LSc8csB7Q54+zQZ07RAG2ehkgl1Mjqw9rOwZcF+Uzt4KhK0 MlEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=HtykHeLavEhyzYKIiWrakiAMWHAjQlQOYEhcITXO75U=; b=BgXZfeCFb6EICw2pAk7edOiuoBMqKMuqDUbXRdm/ke3L+hLq6NL85/o80r+fMOyBqb umI9077BiT6O/ZCCNYFWerkWq3ShCnAhTpMAz7awV+db1JkSDOM6sosE8+hIRZVXqG4d 5Z6gdKqugYTraXtjOzZdIk4JLBETDTKok3tXD3RFFa4yV/FCkM0UQXRD9tV0XhogXJsK ibbFVUJCOIdnVLAHFdjMGD0XWma/X9aVSxFkeyOKcdHafPttDrt807TpsBECfCh1BVKc 9OHBcLUrruM9ZoX6ADSz/KAXmPZlGYByfuZFD7kqHvJhmsuBMyKSFYm7MQfQRe8VPab5 CaJQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si7740544plg.230.2021.10.01.01.58.04; Fri, 01 Oct 2021 01:58:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229730AbhJAIxN (ORCPT + 99 others); Fri, 1 Oct 2021 04:53:13 -0400 Received: from foss.arm.com ([217.140.110.172]:38072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbhJAIxK (ORCPT ); Fri, 1 Oct 2021 04:53:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F708101E; Fri, 1 Oct 2021 01:51:25 -0700 (PDT) Received: from [10.163.74.5] (unknown [10.163.74.5]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 91BE03F70D; Fri, 1 Oct 2021 01:51:21 -0700 (PDT) Subject: Re: [PATCH] arm64: mm: update max_pfn after memory hotplug To: Chris Goldsworthy , Andrew Morton Cc: David Hildenbrand , Catalin Marinas , Will Deacon , Sudarshan Rajagopalan , Georgi Djakov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Florian Fainelli References: From: Anshuman Khandual Message-ID: <31f656c6-bee0-fc23-8ab7-3d62fd5aaeca@arm.com> Date: Fri, 1 Oct 2021 14:22:28 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/29/21 12:21 AM, Chris Goldsworthy wrote: > 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 As these variables need to be updated in the platform. 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; > } > >