Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5194123pxb; Tue, 28 Sep 2021 12:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlH0EM8eiP7K3MSEZpowi8aE6FRDNXwNT6T5P8ulvt/kY+bSoavnjTFFxFAZH2TWMbLJqm X-Received: by 2002:a17:906:318f:: with SMTP id 15mr8807134ejy.206.1632857811577; Tue, 28 Sep 2021 12:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632857811; cv=none; d=google.com; s=arc-20160816; b=TsZ5TJ6FSt4b4WNKLo9yqon1ViPUUlZALvFQ4JAONwrwzC3nYHM9TGUFFwa/Xbq/9s ngEe7eb3byTqt8RO6a8p1ZToWwlDrsqptsEqb2c6mhZHh5q3ijGcaO84z3eYCUVo7Scs wFSwFgCarCwZlIizqZPSyl0hjgDqn44SlFBgRWg8PR12/QAUUlfyxQms33Hh0wulsuLm w0Bwn0KWP7oqtvRXrNbeXvZFtI8rIrN3ynEthR7iZ7DZgFpOf7VmVHoU/fdDM//Ycl/P R4aIHuaIS8vytobHM7j99MKSy0RXfFmh/g28Duuyeq5j1hXj2rgqmC4h6lM+WeaL1ePM aY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=I3lA1xehKn8cMjMnSUrKM01iaV9gThDho652gL/f/XI=; b=HDaPcFJV1+kX0dNSxbKUIByg4ozBWaMtFeR3EYyf2DBqA0qUBgmJg4d9fDkXFdnZbC nav8Q6sW/iFdJCf6SSa9AmdenPw0yGBUeVyUy1wXNjQgV3pW/hebI8+t2XgqrH92YFxw cv2ddydc5O/mABK8RYX6apB1egAwV1Z4vf0DPWTCXgvvHLpIbAxLYUs3MfSeFy8Pg9ER rEEn4+2mJjZEWPdDCqVkE3AW5fan8DHoPWS7shoHa6XLHU001D05emXOXXyS0KQ+OXoE UwWBg4pVZMTp5HSXGYQIH+U/I3fPG5XDSYwSKmIrVFrHGyubqy1f08BzcXAAQcrRwOGH XfAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=thvAjuWg; 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 i11si28686030edb.132.2021.09.28.12.36.27; Tue, 28 Sep 2021 12:36:51 -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=thvAjuWg; 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 S242487AbhI1TgY (ORCPT + 99 others); Tue, 28 Sep 2021 15:36:24 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:29453 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242415AbhI1TgY (ORCPT ); Tue, 28 Sep 2021 15:36:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632857684; x=1664393684; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=I3lA1xehKn8cMjMnSUrKM01iaV9gThDho652gL/f/XI=; b=thvAjuWgN2cL3dAZgbMB2iJsSY+jk9PqY/pEGgfy74rhvxVJHxZ7EtE1 aE+sLQOpj/pbE8a12ZGG7h5n/wC1iOB935SAtIpEZtgQn9bJ5cOhyXuKF T2onSFVIJDQXXty4NXRNVTEFesaqdfVpSVfJUvovmexpysWSdNAD2Mo3M w=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 28 Sep 2021 12:34:44 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 12:34:44 -0700 Received: from [10.251.44.228] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) 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 12:34:41 -0700 Message-ID: <61e2f232-4abe-bb10-fff5-cabe8da5a7a9@quicinc.com> Date: Tue, 28 Sep 2021 22:34:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH] arm64: mm: update max_pfn after memory hotplug Content-Language: en-US To: Chris Goldsworthy , Andrew Morton CC: David Hildenbrand , Catalin Marinas , Will Deacon , "Sudarshan Rajagopalan" , , , , Florian Fainelli References: From: Georgi Djakov In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/28/2021 9:51 PM, 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 Tested-by: Georgi Djakov > 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; > } > >