From patchwork Thu Aug 16 11:57:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10567367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89AD6109C for ; Thu, 16 Aug 2018 11:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B212A5AA for ; Thu, 16 Aug 2018 11:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A21B2A80C; Thu, 16 Aug 2018 11:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F1FF62A5AA for ; Thu, 16 Aug 2018 11:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:From:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=a3CrZKRwemrm9Pg48IW3oWS1BSysDm/i2En52PKyscw=; b=hyDEGc2fPSkOJF UDec3yls4WYNES0GdbHGI+Qfl79uS8c7n4H1c1sfkyKNTUE1xatMkRchg/nUCcSaf18Xshr89ctss nnoeOm+wKu4/kGr2wcVXi90lTWe85yG8dFrQvzYliXIHbof9F16PKfveQR5bJZZ6+cHVhr9vHolVG Y+etluQNj18Db1l8LcG9XE2cZibGUe24phXogKQTKUjok2FAsn4AwVM+SsWdOTigI/rCWbJbarTfZ nywRR+dfjhTZCgLBArTxfZ6H2wHDiRTDrBVcesHxbgy1tWb4SFtzJ5CpwOrnDqcsO6PaV7rkMLdqI Qj0MAINUUipXAVoH1YIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fqGuf-0005bQ-32; Thu, 16 Aug 2018 11:58:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fqGud-0005bA-9u for linux-arm-kernel@bombadil.infradead.org; Thu, 16 Aug 2018 11:57:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:From:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7ITqOnSvthzX8DBmfAf9qrUorwF+gNnCFgSHrzoqKCo=; b=t+v0wvEgkOyyGjpumNbpapM4L+ m9dc3Se630f5Sxa8iRxYXGXOLJwvaV7CQkXcQwmQDWb+aeOUnfCAXPtFecwa0Jv3Zkd5aXkxKU4sy b3523/zEFZ9zjaiIUDyYqmWVpusWvBIH+Fn4v+TTA4ssdbs3YlyqcdzY4LoH5b9ofSAkD72WWWhJ4 /59z2qUm4oXCHhA9y6oKk806hiJoo3C7i+o3iAB04QXVbtk9fQaEgV9cbaF1+AONrjYYB9rEyYXNm E0v48yU4t/1Nx5Ah6VBEz5rx5BCY/Wv35blrhlN814y1gu2FqWcpPKuMSwvQrzwJJvUyZLugPD8aF vETSINEA==; Received: from mail.linuxfoundation.org ([140.211.169.12]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fqGuZ-0005vT-TA for linux-arm-kernel@lists.infradead.org; Thu, 16 Aug 2018 11:57:58 +0000 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2B127A59; Thu, 16 Aug 2018 11:57:44 +0000 (UTC) Subject: Patch "x86/mm: Disable ioremap free page handling on x86-PAE" has been added to the 4.18-stable tree To: 20180627141348.21777-2-toshi.kani@hpe.com, akpm@linux-foundation.org, cpandya@codeaurora.org, gregkh@linuxfoundation.org, hpa@zytor.com, joro@8bytes.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, mhocko@suse.com, tglx@linutronix.de, toshi.kani@hpe.com From: Date: Thu, 16 Aug 2018 13:57:33 +0200 Message-ID: <1534420653141123@kroah.com> MIME-Version: 1.0 X-stable: commit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180816_125756_090737_018773FE X-CRM114-Status: GOOD ( 16.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable-commits@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This is a note to let you know that I've just added the patch titled x86/mm: Disable ioremap free page handling on x86-PAE to the 4.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: x86-mm-disable-ioremap-free-page-handling-on-x86-pae.patch and it can be found in the queue-4.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From f967db0b9ed44ec3057a28f3b28efc51df51b835 Mon Sep 17 00:00:00 2001 From: Toshi Kani Date: Wed, 27 Jun 2018 08:13:46 -0600 Subject: x86/mm: Disable ioremap free page handling on x86-PAE From: Toshi Kani commit f967db0b9ed44ec3057a28f3b28efc51df51b835 upstream. ioremap() supports pmd mappings on x86-PAE. However, kernel's pmd tables are not shared among processes on x86-PAE. Therefore, any update to sync'd pmd entries need re-syncing. Freeing a pte page also leads to a vmalloc fault and hits the BUG_ON in vmalloc_sync_one(). Disable free page handling on x86-PAE. pud_free_pmd_page() and pmd_free_pte_page() simply return 0 if a given pud/pmd entry is present. This assures that ioremap() does not update sync'd pmd entries at the cost of falling back to pte mappings. Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") Reported-by: Joerg Roedel Signed-off-by: Toshi Kani Signed-off-by: Thomas Gleixner Cc: mhocko@suse.com Cc: akpm@linux-foundation.org Cc: hpa@zytor.com Cc: cpandya@codeaurora.org Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: stable@vger.kernel.org Cc: Andrew Morton Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Link: https://lkml.kernel.org/r/20180627141348.21777-2-toshi.kani@hpe.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/pgtable.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) Patches currently in stable-queue which might be from toshi.kani@hpe.com are queue-4.18/x86-mm-disable-ioremap-free-page-handling-on-x86-pae.patch --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -719,6 +719,7 @@ int pmd_clear_huge(pmd_t *pmd) return 0; } +#ifdef CONFIG_X86_64 /** * pud_free_pmd_page - Clear pud entry and free pmd page. * @pud: Pointer to a PUD. @@ -766,4 +767,22 @@ int pmd_free_pte_page(pmd_t *pmd) return 1; } + +#else /* !CONFIG_X86_64 */ + +int pud_free_pmd_page(pud_t *pud) +{ + return pud_none(*pud); +} + +/* + * Disable free page handling on x86-PAE. This assures that ioremap() + * does not update sync'd pmd entries. See vmalloc_sync_one(). + */ +int pmd_free_pte_page(pmd_t *pmd) +{ + return pmd_none(*pmd); +} + +#endif /* CONFIG_X86_64 */ #endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */