Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1151186imm; Wed, 4 Jul 2018 12:41:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpelMdG134dZpBluuk/J6kPkS/Wxs+jFvVBPEb0HJncb4FQqFL2ceMUF5MM1jlV7wpGssKTJ X-Received: by 2002:a17:902:b48f:: with SMTP id y15-v6mr3297685plr.261.1530733264417; Wed, 04 Jul 2018 12:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530733264; cv=none; d=google.com; s=arc-20160816; b=a4sl+rSywuJCay3SF1kJlDHrSZOwvDWppUc4z+q7DAyqyBu/6vSkizP7oz9RFNwtFL cRB25PVGGWZIQnYGKJXDlBnlu47JyDjkAnQiN7JP8AziX2QBoDetPCnoBjBgu/DJilu6 eaMC5YBDleGqIwJVVVl/Si7K+EQVNiE2lcC46LHy2pdLChuDXnYe9RAuPBqdZ239FtiP 8wtqNKVTYOMMeeQDIZBja8wUV/B/wI1I/s0Umsi2lk7ZkUCEUh7dK6futUNnKQZuIMSR Euv0g0o0tkFMaZC8KoixEMF8QcephmqBJy4o+/+qqyexkE4GwCBxyUolDGbjA4sXvok2 XwAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=TkxQ4ISkf55qLlrEFHFckl+2YcFCHZLPKzd+hBnYZho=; b=M0WmUcPd/c9NGw9QTbmABNDsDrPBvtY6CFT70wcCyezwahTIJRvNexsXL6FLEHlsy4 wCpsl886WrYSmvAFDUyUxbNkO7GvBu97FkBUn7ZCMBAYmWZ3rrSt08HwKPfRvDar4DXk QEfWJfBXmmvsKW0xg0VdYjXxT37E8/kMxPOYkFb71083u8GA6fTSofv0Pr37YyZDX+8S YTXcZ/lToQBELe3Th8DmWKm1jeaP4k7a6EUin+8N1op51VU7fLEdSMUJ87KHreVB2aGC 3ByhhxQ9o5AMwK+8Eyh/73twH8vHbrtloTCgv1ruJRxQvv3LCUjJIDGqt7IrbgpGRxRh MQmA== 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 w16-v6si4561031pfj.144.2018.07.04.12.40.50; Wed, 04 Jul 2018 12:41:04 -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 S1752933AbeGDTkH (ORCPT + 99 others); Wed, 4 Jul 2018 15:40:07 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43893 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752568AbeGDTkF (ORCPT ); Wed, 4 Jul 2018 15:40:05 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w64JdrTU785220 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jul 2018 12:39:53 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w64JdqR1785215; Wed, 4 Jul 2018 12:39:52 -0700 Date: Wed, 4 Jul 2018 12:39:52 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Toshi Kani Message-ID: Cc: linux-kernel@vger.kernel.org, toshi.kani@hpe.com, mhocko@suse.com, stable@vger.kernel.org, akpm@linux-foundation.org, mingo@kernel.org, joro@8bytes.org, tglx@linutronix.de, hpa@zytor.com Reply-To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, toshi.kani@hpe.com, mhocko@suse.com, stable@vger.kernel.org, joro@8bytes.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org In-Reply-To: <20180627141348.21777-2-toshi.kani@hpe.com> References: <20180627141348.21777-2-toshi.kani@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/mm: Disable ioremap free page handling on x86-PAE Git-Commit-ID: f967db0b9ed44ec3057a28f3b28efc51df51b835 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f967db0b9ed44ec3057a28f3b28efc51df51b835 Gitweb: https://git.kernel.org/tip/f967db0b9ed44ec3057a28f3b28efc51df51b835 Author: Toshi Kani AuthorDate: Wed, 27 Jun 2018 08:13:46 -0600 Committer: Thomas Gleixner CommitDate: Wed, 4 Jul 2018 21:37:08 +0200 x86/mm: Disable ioremap free page handling on x86-PAE 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 --- arch/x86/mm/pgtable.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 47b5951e592b..1aeb7a5dbce5 100644 --- 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 */