Message ID | 20180528100301.251026410@linuxfoundation.org (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 1BF8B60249 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C0BC289C6 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0078E28C8E; Mon, 28 May 2018 10:36:35 +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 9E6F9289C6 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:36:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 440316B0005; Mon, 28 May 2018 06:36:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3C9746B0007; Mon, 28 May 2018 06:36:33 -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 2B97E6B0008; Mon, 28 May 2018 06:36:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id DC37B6B0005 for <linux-mm@kvack.org>; Mon, 28 May 2018 06:36:32 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id l85-v6so7158187pfb.18 for <linux-mm@kvack.org>; Mon, 28 May 2018 03:36:32 -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:from:to:cc:subject:date :message-id:in-reply-to:references:user-agent:mime-version; bh=Fu1grpvSFiAVWND9G/QERyNyHcfSi/sYWWdh+1a61mA=; b=Vf727oHkW1nB/JZCzXq+oJNvSZKieDSuWbGgySNuHXwkwXl0VGz6QgeUrBzLfImzYo XftGHB2DHOfhomSNInWapxHWcgpD0LjuSuF1jWF7Rcrbcs6jRHUsjExqoC1ynfv8WUGI 9mQ2INJ5qxVZ1FUSAhJUWQIOZEV2sl1CRCxSmigTyUUGcl2D1kK+u5HZ5bhpvgdd8vKt x6AE7zkrcPQAkqv6CIvbnLM+a5r15viuV/ArV5fxJPuB+CjBaTeVSQb1p5453H0X98eA BCIhao3E4FI9A/yW9b6PDqO0qEUCgz8ucQwgcTQzP2gYRchlB4fdN5W6GYFSbUBe2+Oy Dc3w== X-Gm-Message-State: ALKqPweOfThmPmDvlNe3iRFazT+ill1YSz/E6uxwPzlZEuz6xEpPElCE A3BuOikZyyACgFHMV632zV3uLGpvwdiGyKYDRhsLqTzvzQaNSKXm9jARqSt3Wx1e6XdMoEnjVK/ ej+x312gJr3+6Udz6K+jZx5u7jvBFclTi3mlQgMEr3zHHjK0IO2qdh+kSmTpg060= X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr13128865pls.371.1527503792576; Mon, 28 May 2018 03:36:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrBZhOBmqSMKg83fYIXmhhiEgOjHl09JyYOu2cjxwSyPn/ec1xft/In6qYd3jvuM7Qr21eM X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr13128827pls.371.1527503791703; Mon, 28 May 2018 03:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527503791; cv=none; d=google.com; s=arc-20160816; b=w8Ay4l0MdgFJH9s5BJpXBQofZBNDh2rKeHTOswYT05F3e1a0B1WqCV6PwqQIS9cx7o HB6ehGdxOPiq5WiXSsnl306gMxT9hJfaOYzp85r/yIbuzjIUxBsTqD6fHGTbWe+s9ZNI 4XnwPP13dopt9AxhyZJVS4MHC/BITeLeFNHjOf7VatUpWcgLuS6r3i2p6EgtXyBSCUQq xnqcehdkZOaY8CyI77OVz33ShnLxO48MEy4aZMlDKDQSAIxtYXQvttwvLjr+MazkQ7Ku 9sVxty6MQevw22GgUHG7x3/DZWRmTkgMm2MlbQBPNYp6aJB0E53UifUt6FInLJoIxu37 pQ3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Fu1grpvSFiAVWND9G/QERyNyHcfSi/sYWWdh+1a61mA=; b=H2OeWye+lcCPMaRZZv6mnSmtTzda7fuGD1gwa8ltdhnFH06c1bt5sCg8lhPicmEbNx E3fPvuXWN1r72ed/5A0f08WbH/slPJQJ3q7CV8Oi0Br7cmlI+v7dG+P8snQUnyjgdmJi PpfVXs9wFud5WfRrDXhIvUo0tdpStR7TZdjNMRzAUTCcep1NhCkSm6U9NLMqLVcRwHJg qkkJTCRNCmlLCRxwiQwlGsaa2/BgpcBGlh++xKaUzEuOSmQzQIVVDRhDGVenOYDhwKqy a4fREUdscbvQa29jIs63MsGSibfAH6BwKIQDb181aETkzcBkHGwc59Y77VB2aJDjT4n6 cgeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wMvd/2Ks; spf=pass (google.com: domain of srs0=wbis=ip=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=WbIs=IP=linuxfoundation.org=gregkh@kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id g10-v6si25139407plq.523.2018.05.28.03.36.31 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 03:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of srs0=wbis=ip=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=wMvd/2Ks; spf=pass (google.com: domain of srs0=wbis=ip=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=WbIs=IP=linuxfoundation.org=gregkh@kernel.org Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 B2E09208A3; Mon, 28 May 2018 10:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527503791; bh=n5bHEqLnTi4Wg1Dku1HWgaCppy2ppuQhzwoh5uY1SzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wMvd/2KsmPy7wVK+4kKjTCl2qJSYEMzRsk1VVKhSLnQw/W6/ocE2uM2rZhdwWaJfr okGuglFxADa3xYogiBmj9+GY1IE7z1W3cGhLiVySvU+n2Aav0ifjIR1vTOc6E0lkrQ BlvlQCP96Z/66deg3Vkz2X/Fct/AmRX/G0J+ERgw= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, "David H. Gutteridge" <dhgutteridge@sympatico.ca>, Joerg Roedel <jroedel@suse.de>, Thomas Gleixner <tglx@linutronix.de>, Andrea Arcangeli <aarcange@redhat.com>, Andy Lutomirski <luto@kernel.org>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>, Dave Hansen <dave.hansen@intel.com>, David Laight <David.Laight@aculab.com>, Denys Vlasenko <dvlasenk@redhat.com>, Eduardo Valentin <eduval@amazon.com>, Jiri Kosina <jkosina@suse.cz>, Josh Poimboeuf <jpoimboe@redhat.com>, Juergen Gross <jgross@suse.com>, Linus Torvalds <torvalds@linux-foundation.org>, Pavel Machek <pavel@ucw.cz>, Peter Zijlstra <peterz@infradead.org>, Waiman Long <llong@redhat.com>, Will Deacon <will.deacon@arm.com>, aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, linux-mm@kvack.org, Ingo Molnar <mingo@kernel.org>, Sasha Levin <alexander.levin@microsoft.com> Subject: [PATCH 4.9 230/329] x86/pgtable: Dont set huge PUD/PMD on non-leaf entries Date: Mon, 28 May 2018 12:02:39 +0200 Message-Id: <20180528100301.251026410@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100241.796630982@linuxfoundation.org> References: <20180528100241.796630982@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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> @@ -577,6 +578,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( @@ -605,6 +610,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(