Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3128749pxj; Mon, 17 May 2021 18:32:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn/ZQFCac25gTiusUGJSznbx9OY83bEavNk5jczwzwugyawlAz7t714UzMZJhsTDKA6Aku X-Received: by 2002:a6b:b409:: with SMTP id d9mr2198234iof.57.1621301540075; Mon, 17 May 2021 18:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621301540; cv=none; d=google.com; s=arc-20160816; b=saThI0nrTmFsL0weUSr6tVQJ42dqndKE8rng9ch9Zm/9fQg1mkZUsro1OtSArvFv0J aRXt9uN/+pgZeIugZWeByRpDrT5CuMcvpQ91GTkS8UpxH/BXkas87h9t+dpHouBNHhPI S3qy2KLitTiv2FZH7wzD/9LeJoHO1brGA09wbtECli4pto4qG/Imvtyc//eDYdt9Ay3Z BSRs1szU3wuZo7j/i/fs/IlTnlsJiY4Ex6ydR1ZPTvIxa4h7vmEWxtQs1GrsKQ3pJSdy NPVjs3E+DaUHENe3FjmzdGRceX1yEHvjHmoTltTNkq/ZRg/e21joNVNlw1HLQafs59s4 BKUA== 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=8yAaS4f8eRc6kFr1UCdIbUAZNJidswgprkRfGXxuhmQ=; b=b3fOzhqHEV4c+d1kGcuSYQHnzBYDEt7BzBWmKiwIPTBL7Tjzksl0FFrobEW/aDtyxX 1pq5NI3sYvYu81nFkyNXPtN61rfaf5Bf2ax4VRhL5E1gxuwIUoNbW41mWCZjqxAPJd1G G1Ga6xv1zuP1+TkQjZlyumyhvQ3dpsgRXxh4oln5fx38E8tgtexnkvY2wobwIpP+QrSP USEr0ioT7spNnrcDmZ1WZRdawHW+jVZDY3X83Az/vURXRIzBBhhXFjVLc0tUsiCtyitA JLNsDn1MkHtf0FJwwaFJEkbw4aGU3Ut/PufnFIWt3wkUFId74x7WZwFtKKs8Ja5O+ZFU tSMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FF5qLBPs; 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 w3si20964993iov.75.2021.05.17.18.32.07; Mon, 17 May 2021 18:32:20 -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=FF5qLBPs; 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 S240459AbhEQOeU (ORCPT + 99 others); Mon, 17 May 2021 10:34:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:41298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239550AbhEQO3A (ORCPT ); Mon, 17 May 2021 10:29:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C3D6616EB; Mon, 17 May 2021 14:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260880; bh=NSsqVeWI/aMWf9NH32tBVF3Q4W4cpI/mjD7psRtOA+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FF5qLBPspfSrAMEe+ZtnOm0Ui/eBIWgyYGoSuOzAh4Bf7NWsDQVoVvedGTbnPCNz/ t/cwWv9mBxRnr6lQRPJPpGmbzj8J8xZu0rPSmqlNSiHeKg9OagHBsx7MbyBTOpz6PW ej8+X1o3q3y+jotCMP9joBa3kA8HQH6+cK30wloo= 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.12 250/363] ARC: mm: Use max_high_pfn as a HIGHMEM zone border Date: Mon, 17 May 2021 16:01:56 +0200 Message-Id: <20210517140311.046932754@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 @@ -157,7 +157,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);