Received: by 10.192.165.156 with SMTP id m28csp1085652imm; Wed, 11 Apr 2018 12:08:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+yozqFNw1/vDgwNPGeFi3tMOGrgVHk2HyuQaxrFCQ2x92WqVnyVwx/5lf8dlYqACxmd2Re X-Received: by 10.99.119.79 with SMTP id s76mr4219413pgc.291.1523473693942; Wed, 11 Apr 2018 12:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523473693; cv=none; d=google.com; s=arc-20160816; b=YotWE0dr/UILWXsKnPXpnD4Bb+b9wPeGVezrcGySkug3SrHtiD/Qh5NqB8R+UomKVf 2094YRVS8yRfxDfT/KmOwQjgPUW85SSEAhZmJOjmWD4JRCFTkLjN5hVOqXl/sKE0kWm9 qFoEQYxP1RqbWMwEeGGMZ+Yby4y5vHpCpMih9bk3C8FoOju6zFzwE9mmE5DlrxzcPx8O HvaYkGaoIWFk4fbvI9bLLQEou55w8NiPzvmMBenRiucY3vJUKsxCZgfw6A5GbSN1A/Ur AeLrsrgSMq1PDKC2GoeimFagzNZswvA6Zm9q6JdILOfVncFgUv3ZIyzWY7mBk+lImaTh XVsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=76oUaGNBpEtZGCiEBb2Kukh/b6klqUGmM4emU92mS6g=; b=OoSax+zyqaWpNKTksL+EaZgq1ezEG13gxY+Is0MwIJPnfgiNt+zVvie/dcCU+xL6tC hvPGai0dnSPF6gnqSlBklMriEPrMgtbAwMhcGccfH+CH0wy5/TiLDR+VQ/RWtIo4IjWS 66mHKlENRG7AdF4/VqcebFFcR1i0alL8XscVXqXNrpGU7fiYPW/oFzd9CS2QysCbMsdu /MwCPLQou5Dm+2khps3pwj11susONlVne3E0VtAGA02jdxDx1RA96IVI7tL00xtWYdNl r/RDyHsjaXZG6kWedmVDvURw9niuWyfOXW6EdjjsgBveUpbxjcnjrcV1B84ZLQbh/5UE o4lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5-v6si1585116plk.421.2018.04.11.12.07.36; Wed, 11 Apr 2018 12:08:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934818AbeDKTER (ORCPT + 99 others); Wed, 11 Apr 2018 15:04:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39776 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934800AbeDKTEO (ORCPT ); Wed, 11 Apr 2018 15:04:14 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E53B2BAC; Wed, 11 Apr 2018 19:04:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcin Nowakowski , linux-mips@linux-mips.org, Ralf Baechle , Sasha Levin Subject: [PATCH 4.9 219/310] MIPS: mm: adjust PKMAP location Date: Wed, 11 Apr 2018 20:35:58 +0200 Message-Id: <20180411183631.971996975@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marcin Nowakowski [ Upstream commit c56e7a4c3e77f6fbd9b55c06c14eda65aae58958 ] Space reserved for PKMap should span from PKMAP_BASE to FIXADDR_START. For large page sizes this is not the case as eg. for 64k pages the range currently defined is from 0xfe000000 to 0x102000000(!!) which obviously isn't right. Remove the hardcoded location and set the BASE address as an offset from FIXADDR_START. Since all PKMAP ptes have to be placed in a contiguous memory, ensure that this is the case by placing them all in a single page. This is achieved by aligning the end address to pkmap pages count pages. Signed-off-by: Marcin Nowakowski Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15950/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/pgtable-32.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/mips/include/asm/pgtable-32.h +++ b/arch/mips/include/asm/pgtable-32.h @@ -18,6 +18,10 @@ #include +#ifdef CONFIG_HIGHMEM +#include +#endif + extern int temp_tlb_entry; /* @@ -61,7 +65,8 @@ extern int add_temporary_entry(unsigned #define VMALLOC_START MAP_BASE -#define PKMAP_BASE (0xfe000000UL) +#define PKMAP_END ((FIXADDR_START) & ~((LAST_PKMAP << PAGE_SHIFT)-1)) +#define PKMAP_BASE (PKMAP_END - PAGE_SIZE * LAST_PKMAP) #ifdef CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)