Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5164085pxb; Tue, 28 Sep 2021 11:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHY9hc2ZGNv08aU8Lwp6GXYQ0yhyqo13381T3d75CqM73hzumVL62BhNuAKkrxNPm2VGEN X-Received: by 2002:a17:906:2bc3:: with SMTP id n3mr8334791ejg.548.1632855234974; Tue, 28 Sep 2021 11:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632855234; cv=none; d=google.com; s=arc-20160816; b=qlLcGJJtZJ5cQyAUsg1DcvZjcbkmmoOiVMN1PtqDOd8LaEtSgQms6Uq8HF1rDvmxZG bNXrhpTKF6deOr0bsEVNQHpmOdC40C5CA+UJiccAIvvwM7KzijaTPD+fki/68lCe0pOf 3/UHDTwvWZy6tPqMw8U4/5MTrz4ArYm+b3LiyJryBA+lZpi5IWw5G1f7rbi5OXPRLZ38 G1s965aizwt4QXWADQj5ZOEjWgW7ud1m4X6CcizDf4sCUdJxADmHdAUHD1BBDqjQZn/6 4/jvPXxoJhxg06LSzaS8HXlLDGWVYT29YUVbhpSqosIiROa4ZAJRNosm6ymPmKU7ZtA/ sLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=i7LKpC2fde133igJaoJ2gVd1E/F2FN0XTx3T9Dr3+Dw=; b=0zYYW0vDXfhXn49of5ERYkPADD3+y9+4YxD6j882OiryNn6zT2gLU1TIa5CEBU+ei8 NSSYNRZ8cm8WvmF+IrAdDdSzeAZmc77GUScQCiCk8KbEvMXdBGU52fpinY6a8rF5TYGw 9my0RZmSALtV+zUmZyIr0MPiO073gIdvxDqx3TaWKKFlZnEQyKyO/zp3ym4ABUynN+fe L5UPpDqXm54V9QkQZu/63wmtHHSbc1CwuOzo/unCdTOp3gB7+uq6FWvXSM64QEliAY1M bXEihb6LMKq0/UssCY7Vs5r+NI1qwboUkLq7Raj9eIKfCtNfHDRs2xVR3oAXCFZtl0Wz f4zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=aP0bzvjc; 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 j24si8962921edt.521.2021.09.28.11.53.30; Tue, 28 Sep 2021 11:53:54 -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=aP0bzvjc; 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 S242196AbhI1Sxh (ORCPT + 99 others); Tue, 28 Sep 2021 14:53:37 -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 S230109AbhI1Sxg (ORCPT ); Tue, 28 Sep 2021 14:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632855117; x=1664391117; h=from:to:cc:subject:date:message-id:mime-version; bh=i7LKpC2fde133igJaoJ2gVd1E/F2FN0XTx3T9Dr3+Dw=; b=aP0bzvjc5Y21uUiYRrTaW8Kofu5Tq58ucs82DeT3lZ7TYbc+1avbGwIU Tavchfir8GJgWwsXWCTelSlkxN5hBCEMoiQzdd+XkOBW3/ky0kwMEcp8x PM2p49URcmEckIABdNZ2AY83rsYO2yLxfc2ISHc5nqPukfJvyXtdIj5li s=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 28 Sep 2021 11:51:57 -0700 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 11:51:56 -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:55 -0700 From: Chris Goldsworthy To: Andrew Morton CC: David Hildenbrand , Catalin Marinas , Will Deacon , "Sudarshan Rajagopalan" , Georgi Djakov , , , , Chris Goldsworthy Subject: arm64: mm: update max_pfn after memory hotplug Date: Tue, 28 Sep 2021 11:51:48 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 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 Follow up of RFC patch: https://lore.kernel.org/linux-mm/a3bf84c4-8f35-f273-145c-55928a06f332@quicinc.com/T/#m219937b1acdd40318bbe90ab39f187804775eb74 On arm64 we set max_pfn at boot in arch/arm64/mm/init.c. If you hotplug in memory after booting up, max_pfn is not updated. This breaks diagnostic functions executed from user space like read_page_owner(): https://elixir.bootlin.com/linux/v5.14.7/source/mm/page_owner.c#L472 or kpageflags_read() (see how get_max_dump_pfn() is used): https://elixir.bootlin.com/linux/v5.14.7/source/fs/proc/page.c#L47 Thus, this patch updates max_pfn and max_low_pfn in arm64's arch_add_memory() function, mirroring what is updatated during boot: https://elixir.bootlin.com/linux/v5.14.7/source/arch/arm64/mm/init.c#L448 Quick reference for David's Acked-by, with a follow-up discussion on max_low_pfn: https://lore.kernel.org/linux-mm/a3bf84c4-8f35-f273-145c-55928a06f332@quicinc.com/T/#m7d30b3afa632a4fa836f5fe55f4ee8e7bbc83e5d https://lore.kernel.org/linux-mm/a3bf84c4-8f35-f273-145c-55928a06f332@quicinc.com/T/#m0d0e509375af1504d25451d079c5cbd6e7aa513b Sudarshan Rajagopalan (1): arm64: mm: update max_pfn after memory hotplug arch/arm64/mm/mmu.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4