Received: by 10.213.65.68 with SMTP id h4csp2118626imn; Sun, 8 Apr 2018 20:10:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OOOJqv9bXWQW0U9/RgyOocwQQE/qNTPj85PAvAy8XHdvwyUe5jz+cBbfMqTO55OUhshnp X-Received: by 2002:a17:902:aa46:: with SMTP id c6-v6mr36123586plr.154.1523243402035; Sun, 08 Apr 2018 20:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243402; cv=none; d=google.com; s=arc-20160816; b=Wz3xGMvtt51o31VpecbpSb2SCghPc1gTtgwvNv0thQtxWiwuAxzoos+EwMo9CnByGY A94duEAVNEscW1Z3XIf2rTEz6ttiJDlhaEN5qhYXsLCxH3JkCuj0jRogezZoZ4/1SlLV WMcb99d28iFOuBHO3/v8hMaUs05vz8/IwlUArcGx4vSc0XaeNA2dC7OHDU/eoFCuO1K1 uev+UfnhAEI5W+nJw/8W1p7Z2bMh8eUwIdBNphPsqqAcufn7lVauvB6scWHrRytwq7GA e7bzJCxyys3A8mFisML45C4/+K2nZCNMuzBFecxTgD24FDj8/ptK4jlOcJQf1SFPpO44 h6fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=eJCr+ENV2xtSuikKtG94QoJhvimjb4qTNrW9jPVmO1w=; b=W9FhLhp/dB5lEFk8XUDf3LlG0YI+sCf6s3CXCFBCoaQk04Sqxmpx+ZjF4zUQF6F1w/ 7Z7H5/QcdjgYkl1gw8VNK0kEeGes5OnXk1auehTqKpHwA4rjsa189WAP0gygUws3UX1A kelteEyCFFx/RDdi/CqyGc8Pfln3AHvuBVUFEN+zOHHiOfFiYDx2gUDobhcNJOjsZJx/ 3Q3bRtLhSYyJHQI2Pj3v0pjWuvUmLQwQ/ytB9gMkNigNs4PBihN6LqHt1F3bqQ86pEFc WT8mFwLAMZOr8FkXMkv/dNk2v71Ojjby4u5dmEUTUF4j5xz2Aas75t7OI07U7wZg6OS2 6eHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=O19ILJd6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si13435839plz.467.2018.04.08.20.09.25; Sun, 08 Apr 2018 20:10:02 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=O19ILJd6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756427AbeDICrh (ORCPT + 99 others); Sun, 8 Apr 2018 22:47:37 -0400 Received: from mail-cys01nam02on0098.outbound.protection.outlook.com ([104.47.37.98]:9607 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755396AbeDIA0k (ORCPT ); Sun, 8 Apr 2018 20:26:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eJCr+ENV2xtSuikKtG94QoJhvimjb4qTNrW9jPVmO1w=; b=O19ILJd6Yc0fd+kgjn5OBXZyQlF6pCImVmlnfUMK9xLxMaGyT+vsGH3uDs+ZtrhGtyBmIMfhByHqdeLKL0t0XefWWzwGcF0W1DM3ejWGbeFwPDG9FTe9ZGwfnmRKpK7Z2ESWd79eghuN77k6ykBGwTALAHGURQbjI0VWX2x/QSI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1015.namprd21.prod.outlook.com (52.132.133.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:34 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:34 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Marcin Nowakowski , "linux-mips@linux-mips.org" , Ralf Baechle , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 008/293] MIPS: mm: fixed mappings: correct initialisation Thread-Topic: [PATCH AUTOSEL for 4.9 008/293] MIPS: mm: fixed mappings: correct initialisation Thread-Index: AQHTz5jmffflvfqTcEK5VadLMjKj8Q== Date: Mon, 9 Apr 2018 00:22:53 +0000 Message-ID: <20180409002239.163177-8-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1015;7:+SlaVoWhL8EKOxchST3Dzj/fTjzOFG245aJAZ+dgridtFw2jdh0WR3EofcsK9Vk4kNgQ5CxP1fxQBx0u7KE8qvA0saQ0FaLtfOvLANLMCUtoMGmYD9FVvithXGlvodCprgoTl9eaajD6/R72as+Pufn0pJK+b7fGI1mcyNUe75pF7VSi2zXLSIve3m+v12gVXjaziLp7cUlJLyGkCKO3oeMRpMxmncRJyzek1KyBQt+keYva98q8xKMBCH3bv0Yd;20:wmoDG1X72pZpYqCyboSwMh9DOvURuX4DY84S9B7Qm92AOgj+lrmRYXxGiLbPxo7tHdXbJQDa/qSaJfne9YtF2CYi+8TSH0/cX3Q5AWzz42aPE+9Z1HkMOrmGkyShe+0Aj6f0NyGf9MZUtlZMthJejwbuk9w7Cvt93adqJG8HaZA= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 47e840ce-e34f-4035-8901-08d59db08cf8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1015; x-ms-traffictypediagnostic: DM5PR2101MB1015: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1015;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1015; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(189003)(199004)(53936002)(4326008)(478600001)(72206003)(3280700002)(2616005)(14454004)(305945005)(5250100002)(3660700001)(2501003)(2900100001)(54906003)(110136005)(86362001)(1076002)(966005)(107886003)(6506007)(36756003)(446003)(68736007)(6512007)(7736002)(486006)(2906002)(6306002)(5660300001)(6436002)(3846002)(86612001)(6486002)(66066001)(11346002)(476003)(6666003)(26005)(10090500001)(316002)(22452003)(8676002)(81156014)(81166006)(6116002)(105586002)(99286004)(186003)(106356001)(76176011)(25786009)(97736004)(10290500003)(102836004)(8936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1015;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: NPo5mFN679odDJxKDtZHwgI/ZRejav12mYeVR9T4M3blMkMasIEwcwjloZIdUj0EE8N2tpeopfhWP2aoUzZHcEdn75VH8lBQLDlaFDqFCp5GaE/6sOh3k0GKcE5OclFnfKtP2jeY3qXpPI5AVdxkaCAHHHxpHtr9HfTXJAwp+/y0T6p5GM1PehfAaymao0xkAopY5kz86OF+GDr+D5l5iagGdRDJD1QX2nA/oA6nAk78OVQfjzNEeKTCw5GcYWJQmnZXOlPKql+3MlXOzlUqcRzj4JVff5n1hO9GO0EY4TurxHhicbeMZi58AUrTtjBKRmzd7Fsk6fx6f6ZdYxCdkwamRV/cjoFXhARyZg3uprDGppNEfLBK4yqlCwafWIKs77s+mJemPcrE+BzO4yGIAFb0s0BR+j3anHc+l2HcGec= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47e840ce-e34f-4035-8901-08d59db08cf8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:22:53.4873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1015 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/mips/mm/pgtable-32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index adc6911ba748..b19a3c506b1e 100644 --- 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 =3D __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; - fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base); + vaddr =3D __fix_to_virt(__end_of_fixed_addresses - 1); + fixrange_init(vaddr & PMD_MASK, vaddr + FIXADDR_SIZE, pgd_base); =20 #ifdef CONFIG_HIGHMEM /* * Permanent kmaps: */ vaddr =3D PKMAP_BASE; - fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); + fixrange_init(vaddr & PMD_MASK, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); =20 pgd =3D swapper_pg_dir + __pgd_offset(vaddr); pud =3D pud_offset(pgd, vaddr); --=20 2.15.1