Received: by 10.192.165.156 with SMTP id m28csp1101979imm; Wed, 11 Apr 2018 12:26:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+o3D0oegZ4oVVDiCHGj1ZNFfm6mMYR9YJwInNeDGi1IYghABTp9py7IBBPaUNWwsCzN8GU X-Received: by 2002:a17:902:70c4:: with SMTP id l4-v6mr6434079plt.382.1523474806281; Wed, 11 Apr 2018 12:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474806; cv=none; d=google.com; s=arc-20160816; b=MxLAIc8uTe8+Cn4EKy+JWb+/QqOiH+TiA3sHsRFFaGQfUs65QW8BxqDg+iB+hUuNEc FmKA+me0yKFcVk9LaWAcrrbngnwjVZVsrWrPMPjWgdx94DslsA9TrvNgRSGVVmPQu/a5 iy7Iu7d2bpK4tF7may3wRone3c96tS5sbDh3RkWISgAgo/SNYW8JcrIueQBbqT0RRh8v wynUUmXbugjki9XIbsQfbVIixBKZV9+seVkg3d4RCtLI/r5G1v14XkWsuGOa7tpSEyZP /Lha1TbnjpvKwbHwreoxyhRzQqvHmjHI5h5xLrb2DBp1cDZBRbQKs6melGnaUUtkwQ3N qVUg== 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=3BfR8bPdlwarG22d+ysi4bTBXQY9VuyFf3nbFdcJ9+0=; b=fDeA7ij7aGTSteQl4HIu18MhApLWASrBR/Jxxf4hT7e1qwV3VcUEQ2Msq7ZDvn+f+6 BY2AzBtdIbujPYOXCwOX4A8ZdNRyp1KKXunZ45V8FBO6MM/SlisxD6MU/Z1pa4mROgxN FrJcTkGTcEcfV/XhWv7kWzV2bI12gUMe8/SfZJMsshSib4uB4e2pBtM+q5C49h+9hFks tnzoDYmxjNJEJPMTc6EPNS6nvs6P98Np9SqYiJRB0Dk8tbKSk2D0LirD1Gq4vCmKDWD/ iMOwWlVYtIvebmn/ZsdhMDJCtCah/axoOImla9OpWzve5ZeiQiDJEIH3OxvHHNmFDs3S jpIg== 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 bc1-v6si1709331plb.689.2018.04.11.12.26.09; Wed, 11 Apr 2018 12:26:46 -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 S934804AbeDKTEN (ORCPT + 99 others); Wed, 11 Apr 2018 15:04:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39530 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934790AbeDKTEK (ORCPT ); Wed, 11 Apr 2018 15:04:10 -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 3BEDFEB7; Wed, 11 Apr 2018 19:04:10 +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 218/310] MIPS: mm: fixed mappings: correct initialisation Date: Wed, 11 Apr 2018 20:35:57 +0200 Message-Id: <20180411183631.932894172@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 71eb989ab5a110df8bcbb9609bacde73feacbedd ] fixrange_init operates at PMD-granularity and expects the addresses to be PMD-size aligned, but currently that might not be the case for PKMAP_BASE unless it is defined properly, so ensure a correct alignment is used before passing the address to fixrange_init. fixed mappings: only align the start address that is passed to fixrange_init rather than the value before adding the size, as we may end up with uninitialised upper part of the range. Signed-off-by: Marcin Nowakowski Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15948/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/mm/pgtable-32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c @@ -51,15 +51,15 @@ void __init pagetable_init(void) /* * Fixed mappings: */ - vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; - fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base); + vaddr = __fix_to_virt(__end_of_fixed_addresses - 1); + fixrange_init(vaddr & PMD_MASK, vaddr + FIXADDR_SIZE, pgd_base); #ifdef CONFIG_HIGHMEM /* * Permanent kmaps: */ vaddr = PKMAP_BASE; - fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); + fixrange_init(vaddr & PMD_MASK, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); pgd = swapper_pg_dir + __pgd_offset(vaddr); pud = pud_offset(pgd, vaddr);