Received: by 10.192.165.156 with SMTP id m28csp1161548imm; Wed, 11 Apr 2018 13:37:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/cS66wZMaB2Ut+iJllqsff8SpyOEjiNtb95STMCQn6oY8qxRQDOiRAujsFBELUUbs8si40 X-Received: by 10.99.148.17 with SMTP id m17mr4550712pge.140.1523479043522; Wed, 11 Apr 2018 13:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523479043; cv=none; d=google.com; s=arc-20160816; b=GzBxcdQRokE5sRQZEYkLdKOf/7yf5bAZ9x8CTD1kCphpb8DY11RHPrClhJGwcxesbr dY0jNgHE2AZAYAh85Q8JVObJuMIvE8TVQTHgOS7hmCIjONDqa0FEtFDFsAggtPUxrxtK hTqOTn5vrM9QeZPGiuB0bA5fdRuGHSvJYg+SnFSWaYLo/qWgrWgmN8BrHdqML/GPxPmt KgPwY9+kRxlHAdCRWQDI7eNvcqe3SawOl+x0/ohqyjBbWiWlgGNiviMmGlQPxor0htO/ sHaZWxC62Eaf0MYiGaNh63LJqzAJfYv4w0LjBNeMTl3CzPVV15kOQkVx2xECmdERu3K4 j7IQ== 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=zcOo885mizTsskKZR2DH8DF5TVKNglehnmw67M9SO/k=; b=c+kEn8Lm4fRUTi4JNDJt4BXGUWMI9m2F3GP5r0dxcZsJBfneUjLdAx3gu6ftV9DNok BvsSKUxvH7jZ2T/zFtjX1b2eD5CuH7ILwJ58TXXeiPDY96sAHxgK+Gegzg+ZlMOd+9S2 MS4TOMcbEcW2kOl9dOo2t5U2aKC8r1CzBpyt1kYAXNW8657dOmzhhBfrJTAft9ItXVjs ZYkn9nVeOdBOqiMQBMNHvTFJzsnRRWxR2xghWMH3VEIw39MdCtjuwJR7Puxl6B+nLyvR ylNO7a8XJnKXSIczkjuyYWpYgIBVTP38z4H8wlL2I8ucrRY1pnt9JrwSMdanEehRO9EX psxg== 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 v7-v6si1778915plo.389.2018.04.11.13.36.47; Wed, 11 Apr 2018 13:37:23 -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 S932524AbeDKStc (ORCPT + 99 others); Wed, 11 Apr 2018 14:49:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60434 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451AbeDKSt3 (ORCPT ); Wed, 11 Apr 2018 14:49:29 -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 168F1B1E; Wed, 11 Apr 2018 18:49:28 +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.4 132/190] MIPS: mm: adjust PKMAP location Date: Wed, 11 Apr 2018 20:36:18 +0200 Message-Id: <20180411183600.007946835@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@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.4-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)