Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp546676pxj; Tue, 18 May 2021 09:01:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqCaoGAvTpbKKCWm8ELHHAGXeF7b6Ct2n0ucSMnTZC3HTnIUobAHwZNQRQFuMZzuJ1Wd8b X-Received: by 2002:a05:6402:134d:: with SMTP id y13mr7891305edw.287.1621353661563; Tue, 18 May 2021 09:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621353661; cv=none; d=google.com; s=arc-20160816; b=m7fF/yORFkGuWQ0tyWvTVnm1/WDQbtmSbykDzssKSx2IKo9xt/aYo9p0NdU3dpkYPU yBkCMkin2e9AuIkWl7ZCB3FCz+g30kw8oqYL1LNvOXH0Zk/oUPy1/3v34ye0WQdXvlIU mOZL4dV4dKyniiiuN3ul4cZjwnL7FtgD0ueCxIXdM2u4i77JkOwnKy0SUAOjFzRbUlsw dMkMgYUi1Vgc08UH3bEfafTrqQa/QYtzDJ1MW+MpoFmsfmdEmIvWIekwJ/LZ1F4uFhUW nNyjphiFmOEb4wheqGW6rghnBugh9GBzyj6uTRyHaaDHqIqRDdU+QHzpmOjCu1Ib7aOs svVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ISIrvrfRkLfMjt0MGC02xWI7/A2aun7nwoNAoVh0ivA=; b=LHNQc+zJIj7OWr26RIhYVhJLxnStfdAN/Gy7Q8SmYVZ0LIEM8OgOkuwCxmQufb9eiA eZHGgXlH/X+NSynaE3EZB9LYV23RsradWLOQyypCTqzxRKSrPgy+66LKkBjiNyMa4syo DDxnwMqycrjbNHng+oz11j4M9r4YAolxuf0Qroln4LfGe/rjOVGESVTetSXyG9oXHRZ9 kg9PQwhlcGHIE9IQUJBiahL8xqFF6CbbH8kyTnKi7eV/spddCENmVBd+Vs6zKOS27YFF i6HEjnGpBh8hU+vDwHSS0RvZcCPrgdlYw89wU7OjHi4IJQXMgloH8Fqp3ei32pChpF+w jtkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WeyrGT2G; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si18373470edn.213.2021.05.18.09.00.27; Tue, 18 May 2021 09:01:01 -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=@linuxfoundation.org header.s=korg header.b=WeyrGT2G; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344143AbhEQP7H (ORCPT + 99 others); Mon, 17 May 2021 11:59:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:43488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245742AbhEQPjf (ORCPT ); Mon, 17 May 2021 11:39:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4477561CFB; Mon, 17 May 2021 14:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262479; bh=NjA1dweoYFafyPsVsG2C6HmvH3v42wGI6CA5LFo+kfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WeyrGT2GPaGV43HUaE6uCfwXLjB8gUiZboZe63DeIbE5IIOMC2iEOz4IyycFAOAoI Rn/jbVGmdo2fgT0p/+DYAT2xHa0lS8lil6R5yHaNmLb1HtnYq4+prdtBddghyHfTtT 7l4H5BF3LhUAI+kXhoADmME8QV/WbGVVT2IAxdss= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Isaev , Mike Rapoport , Vineet Gupta Subject: [PATCH 5.10 196/289] ARC: mm: Use max_high_pfn as a HIGHMEM zone border Date: Mon, 17 May 2021 16:02:01 +0200 Message-Id: <20210517140311.712058384@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Isaev commit 1d5e4640e5df15252398c1b621f6bd432f2d7f17 upstream. Commit 4af22ded0ecf ("arc: fix memory initialization for systems with two memory banks") fixed highmem, but for the PAE case it causes bug messages: | BUG: Bad page state in process swapper pfn:80000 | page:(ptrval) refcount:0 mapcount:1 mapping:00000000 index:0x0 pfn:0x80000 flags: 0x0() | raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000 | raw: 00000000 | page dumped because: nonzero mapcount | Modules linked in: | CPU: 0 PID: 0 Comm: swapper Not tainted 5.12.0-rc5-00003-g1e43c377a79f #1 This is because the fix expects highmem to be always less than lowmem and uses min_low_pfn as an upper zone border for highmem. max_high_pfn should be ok for both highmem and highmem+PAE cases. Fixes: 4af22ded0ecf ("arc: fix memory initialization for systems with two memory banks") Signed-off-by: Vladimir Isaev Cc: Mike Rapoport Cc: stable@vger.kernel.org #5.8 onwards Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/mm/init.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -158,7 +158,16 @@ void __init setup_arch_memory(void) min_high_pfn = PFN_DOWN(high_mem_start); max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz); - max_zone_pfn[ZONE_HIGHMEM] = min_low_pfn; + /* + * max_high_pfn should be ok here for both HIGHMEM and HIGHMEM+PAE. + * For HIGHMEM without PAE max_high_pfn should be less than + * min_low_pfn to guarantee that these two regions don't overlap. + * For PAE case highmem is greater than lowmem, so it is natural + * to use max_high_pfn. + * + * In both cases, holes should be handled by pfn_valid(). + */ + max_zone_pfn[ZONE_HIGHMEM] = max_high_pfn; high_memory = (void *)(min_high_pfn << PAGE_SHIFT); kmap_init();