Received: by 10.213.65.68 with SMTP id h4csp1654578imn; Mon, 19 Mar 2018 09:45:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELs0OFQR+9Ksv2HPRtarRRbZi8JoRNGxIf0CBKIyQbmyaqt3vLwnDfRs2xWUOOfpAgIL8ywx X-Received: by 2002:a17:902:6c0d:: with SMTP id q13-v6mr8496151plk.350.1521477934348; Mon, 19 Mar 2018 09:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521477934; cv=none; d=google.com; s=arc-20160816; b=pSbztODwyK4NOQ/YUHh5rSgNbtw/6mfERwPPx9dfBck8RHNEHWMFGeW4lrtZBVE+QE AxHNGf69MDwCR3AcdAGoXGvBo8rRMuUos4J1mkYX/uB/qQqoQ17CWF54Z9WHEKnjf1tp 5s2fajskvRE/13lYgdsegm0NT60ldHqtnv0JPGQ1vvGdBTtnE8mNeh+uyZ42FuP2e/dp Ve9Wv+Eveggkm1lF5eVUQngv7H2xKmGRCamKe5lTP6jD0wxJXE+x9lhOiof3Stvf5t6Z dDtsFKJvSvVjj2bCwSFt2d3hts64X+taMBsFyHBscN1ADtEIsdcMp7d+lNBVdzC00iAz JrBw== 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=xQQaZFjLCc88D4oRJO7pP1safPqkWIwyxWZ1GmGADT0=; b=vbTw7a/wZ08iR9fxAAZ9Hgu/EaCIFunRxS7SogjRMevAO8I5vknwrp2vqRZNijNIQw Jfv4nqB/RO+YScaSRUBk0kB+RfeJYdk/4ZI3L1FicHJM6dgbFF16d+6farqfOAZ1zNUU s3iuI1MzCUF1cpbAGAG4SEZ59tP9qc/NV+Fav/0P8kpVe8C41CNQ26TCImYd2hw+6SXi VS+fhzrFhzHjU80AfLYnKjGOUzcVCpGpHGryOT7SeW5x88Lw7dBct+1l1G/MCWhfxTez GD8cYRX6VdxvH3SGPiCKQpPuRcCkeb53shMad3eEQ0vEVTRJ2/JXJTGTccIIWbxZ8lOU X8bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Plvct6JO; 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 59-v6si236385plf.596.2018.03.19.09.45.20; Mon, 19 Mar 2018 09:45:34 -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=Plvct6JO; 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 S935241AbeCSQMt (ORCPT + 99 others); Mon, 19 Mar 2018 12:12:49 -0400 Received: from mail-bn3nam01on0090.outbound.protection.outlook.com ([104.47.33.90]:18758 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966656AbeCSQKp (ORCPT ); Mon, 19 Mar 2018 12:10:45 -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=xQQaZFjLCc88D4oRJO7pP1safPqkWIwyxWZ1GmGADT0=; b=Plvct6JO+zgAD5/7Q6b+999JDPnmYqQ2Jwj2MFQDj/9tbHn7xugX73euCVYXP26KvJfKOh5EIejkuqQT3I5JXzGeHarXzbBi0WiqrWjg9BOO7g7vzCojbHnYyFkOO0fU0lF07dvYxjAwT3ZHE8x+mSxNgJEgC33Q4YclVBq7zcg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1095.namprd21.prod.outlook.com (52.132.130.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:10:41 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:10:41 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Marcin Nowakowski , "linux-mips@linux-mips.org" , Ralf Baechle , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 135/167] MIPS: mm: fixed mappings: correct initialisation Thread-Topic: [PATCH AUTOSEL for 4.4 135/167] MIPS: mm: fixed mappings: correct initialisation Thread-Index: AQHTv5x61nhgJCaHr067NhCcNsLXPA== Date: Mon, 19 Mar 2018 16:08:12 +0000 Message-ID: <20180319160513.16384-135-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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;DM5PR2101MB1095;7:o27SAXzb6KPlkXOsWoCgb0/sZK3rh/DkG/Y9PrfuhjE+2dX4chs8SafjqOzeTFUYHsy2YgALoInDZo/mSRXD5NK9mrZ1XUxeiF4JLNgtAhuUpegBjWNtVNfz9ABBPNzxd/FGAdUit2ep3jyi3/oqIdUyDRrKB1TFvDB2hycAAMDFrtpjPeAJ7ytoJkyocEYoZFhxuPFfFzJ//6qbFDlGZ5WZ9tTr24Ukf4aXbgjqFYhuQgmhR3XGpxlsIx3vgqQV;20:vCgLvLMQuNMsMu9al9qgMiLWXSgQ7zFBPlCJEx1vsS6limOEZDYwsE6DFCmDmQCwARGc4ZfEcR4eAEFTwYgD+qmkl4cn/e+VpIB8B/4ZbuLLhlTIlTF2OgGbBlqBEyrO5H6Sl2OvYoA3zLv0KsJUHXimM/YgaAKVkSv1KiPWWk0= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d2ceda35-f34d-4add-12a0-08d58db3f63f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1095; x-ms-traffictypediagnostic: DM5PR2101MB1095: 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)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1095;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1095; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(366004)(39860400002)(396003)(39380400002)(189003)(199004)(305945005)(316002)(1076002)(7736002)(14454004)(86612001)(25786009)(8936002)(2950100002)(110136005)(66066001)(186003)(10090500001)(6666003)(5250100002)(2501003)(99286004)(76176011)(86362001)(4326008)(68736007)(3660700001)(105586002)(8676002)(81166006)(81156014)(106356001)(3280700002)(72206003)(10290500003)(478600001)(2900100001)(966005)(97736004)(54906003)(6512007)(6306002)(53936002)(6506007)(102836004)(6436002)(5660300001)(6486002)(107886003)(26005)(2906002)(22452003)(6116002)(3846002)(36756003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1095;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: FPPoxhcSGG/q64dkYMrVYytAKYULsGzF23JI09ON4mZkCIIiVbOHiU/9xdSvi0jp+ZC2Rt5kv6hK8vqbFYcU9SJiqaOo2ZY8e/YEtk3cEidx9LYhO0kgD8WJ0zdMazhGfSVwGSAVfAM2NLnyd2CHNNlx70Snq1kVpSN5EjSCBQvNusvlMWtvY4Os5dfeZatrEGvUTX0TgV5sHpa52HwaQxEFd78gBec7nhtxM63zC48535D9GtoRHc1/Z86yyfpytCny2a5SpZ0nDCDh/+U2lp2H2GOehFm35yMVMGuDfS3acZoxv1FUiAKNLVE/XdH93hazEzuF1B9b0LtOaFmigg== 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: d2ceda35-f34d-4add-12a0-08d58db3f63f X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:08:12.2868 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1095 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.14.1