Message ID | 152528785812887@kroah.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 314E46037D for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 19:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FC6428F74 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 19:07:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12BFD28F78; Wed, 2 May 2018 19:07:29 +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=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE4E428F74 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 19:07:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57CBF6B000E; Wed, 2 May 2018 15:07:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 48D1A6B0003; Wed, 2 May 2018 15:07:25 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3562A6B000C; Wed, 2 May 2018 15:07:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id E4EFC6B0003 for <linux-mm@kvack.org>; Wed, 2 May 2018 15:07:24 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id m13-v6so10753679pgp.5 for <linux-mm@kvack.org>; Wed, 02 May 2018 12:07:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:to:cc:from:date :message-id:mime-version:content-transfer-encoding; bh=Lws9BKCQ1PEj8xY9jJDo2Ed6gY6z+e8SJQKLQpbKrwY=; b=auxT8VNCWvP0vp/ilTp8Vm0UmuY1czIAyD8hq0W7hySx+Ou747i5IGq1nsZ+MSpBpy eNG2g9MxlUiuA8G7iElSM/+7TlltxJhmmKI7PmYutDWHVY9NNf0dEJu1Aeq7ZBUvAyC3 incs0X9CnEu77YdXOZp1zmyOsNPQcwD5+w2KV0VxNa7SKtForS4swEDGyCfn5/PbCD0X A4WVeBzlh7hz4VTfIFO4VKVKDjBzWGNjXYz5g5h04ZTNGWc+MIlEMiuJh/5qfSt3KQaN p/6GCyuFYKoug1b4234WH8gqBBgLtF9NPStuVVosSW3kf4kYzYYAcJGY05ylyOJ+b1Nf DM+A== X-Gm-Message-State: ALQs6tA1+STBGRbgi5dMav58ERUYZhxlIEkwoPOPcTPf+9KFgeb3nW28 +Ir0isqzNp7w5t41OJf3RofQYhWTYO0xrIAiWs3mgE8ZKlM9KoZA4v0y7BVQcDWHMAYxm0get/l a8EscZnwdFiXNhoJCrftqkEcrb9ErBiF1OVigUeGy9eMgvtzXAblRSS1msh2nL8U= X-Received: by 10.98.11.210 with SMTP id 79mr20409241pfl.4.1525288044348; Wed, 02 May 2018 12:07:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoY59OVORnpjV5/wbD4tIEU8SKSwkyvPzlCkorDbTxfsWOnk74QoOkbmiSmWWE56VA70oWI X-Received: by 10.98.11.210 with SMTP id 79mr20409208pfl.4.1525288043583; Wed, 02 May 2018 12:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525288043; cv=none; d=google.com; s=arc-20160816; b=sRPjUuqcvddae2P9b8e++lX9M6hSDMThbhRZY1cwLGKtWZjh+1TSJOTskz9abufLOI 5n5inxgMWw6mxAFg+7uPv32OGgDm4rYhRbhNBoj0DlDFLlJqquEiGQ55iFnidbJjIy9c S5qLFxbKkgZtxCLMfyNdH63o/x4qYC2P2cSnK/jmW2XKCeG2mDxjcabafDKLe4GxsW4F YoJJGg1EY22Ok56FIqkC7xZrc4oaUza+ZF8jjm3su0lOSd/W1gkKYhpdg7Dx9gsxpnzt njcuM1eNm9CTbJ19jEjanKvJ5yBu14ZHkQXmY4oegdWB/sS7pG4ZkwRBtFSF+m3l/RcN fyvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:from:cc:to :subject:dkim-signature:arc-authentication-results; bh=Lws9BKCQ1PEj8xY9jJDo2Ed6gY6z+e8SJQKLQpbKrwY=; b=KfODsMGro7zRrsEPWWKyoxUvc4X7Ufmo6IWX+LAoLxl8O4IQxXBS23nxxBjLlb5a+s +Ccqhs5eQ/U8BsUSxPkH0qULZ04E9zrorxZOXgznDpococrmhJIH9nuJgtKWGgKyHL9d /Gl6MZAhqnjomBHzCgweRbws7X2PETcoHNBshIy94adTamS2/del6KQob5Guki8iabG1 rtpnac487YtJR6tAJsE/E/2jKoKqXZ+edfURNPvkcXp3A0KDzFNYnTN5zXSD92tI1KVG KbnHzPwc7MS9sfjD+SDnC7HC2LGWemwMz1DyuSt7rWwOM5l13Si6XUl4E+qeYasgA0iP H+Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SShPYxvB; spf=pass (google.com: domain of srs0=nwvz=hv=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=nwvz=HV=linuxfoundation.org=gregkh@kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id x17si11895111pfm.330.2018.05.02.12.07.23 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 12:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of srs0=nwvz=hv=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SShPYxvB; spf=pass (google.com: domain of srs0=nwvz=hv=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=nwvz=HV=linuxfoundation.org=gregkh@kernel.org Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2483F2392A; Wed, 2 May 2018 19:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525288043; bh=aXCRFXToH0MjyWAkK4qY7k7948CLpLax6ltp+Yx51gU=; h=Subject:To:Cc:From:Date:From; b=SShPYxvBnhLeQW+OE8oqIb16zXG3D45ceUM6s+e7dLPlCKGfg1tP6Wkzs191LzjTD EMdbZhSLmt+ZtVc1YetUdYSsWfWs5q0rKj9etMdKT5f3ZXIhv7XhdgEnX5DZK+mAkJ Z/V3hoAOQraei8jQCNLkFoNWjnXBAPSMTon0zOQ4= Subject: Patch "x86/pgtable: Don't set huge PUD/PMD on non-leaf entries" has been added to the 4.4-stable tree To: 20180411152437.GC15462@8bytes.org, David.Laight@aculab.com, aarcange@redhat.com, alexander.levin@microsoft.com, aliguori@amazon.com, boris.ostrovsky@oracle.com, bp@alien8.de, brgerst@gmail.com, daniel.gruss@iaik.tugraz.at, dave.hansen@intel.com, dhgutteridge@sympatico.ca, dvlasenk@redhat.com, eduval@amazon.com, gregkh@linuxfoundation.org, hughd@google.com, jgross@suse.com, jkosina@suse.cz, joro@8bytes.org, jpoimboe@redhat.com, jroedel@suse.de, keescook@google.com, linux-mm@kvack.org, llong@redhat.com, luto@kernel.org, mingo@kernel.org, pavel@ucw.cz, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, will.deacon@arm.com Cc: <stable-commits@vger.kernel.org> From: <gregkh@linuxfoundation.org> Date: Wed, 02 May 2018 12:04:18 -0700 Message-ID: <152528785812887@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
--- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -1,5 +1,6 @@ #include <linux/mm.h> #include <linux/gfp.h> +#include <linux/hugetlb.h> #include <asm/pgalloc.h> #include <asm/pgtable.h> #include <asm/tlb.h> @@ -600,6 +601,10 @@ int pud_set_huge(pud_t *pud, phys_addr_t (mtrr != MTRR_TYPE_WRBACK)) return 0; + /* Bail out if we are we on a populated non-leaf entry: */ + if (pud_present(*pud) && !pud_huge(*pud)) + return 0; + prot = pgprot_4k_2_large(prot); set_pte((pte_t *)pud, pfn_pte( @@ -628,6 +633,10 @@ int pmd_set_huge(pmd_t *pmd, phys_addr_t return 0; } + /* Bail out if we are we on a populated non-leaf entry: */ + if (pmd_present(*pmd) && !pmd_huge(*pmd)) + return 0; + prot = pgprot_4k_2_large(prot); set_pte((pte_t *)pmd, pfn_pte(