Message ID | 20180528100333.398599532@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 6CBA760249 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CD1C2895B for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5107B28C10; Mon, 28 May 2018 10:57:23 +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 7381A2895B for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 10:57:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D6476B000A; Mon, 28 May 2018 06:57:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 05F806B000C; Mon, 28 May 2018 06:57:21 -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 E41E56B000D; Mon, 28 May 2018 06:57:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id A2AA66B000A for <linux-mm@kvack.org>; Mon, 28 May 2018 06:57:20 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id r9-v6so2982052pgp.12 for <linux-mm@kvack.org>; Mon, 28 May 2018 03:57:20 -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=F1v7W+SAREZz1EEUFxsuItRYCdopgbS2HGCE4ziBDAA=; b=l8t6nDeRA3IocJtfCvI+j+GgNe3ZW8rHqc6LldpkQfdB0DHOTF61LwWVNSKDvlSqE5 m7AzHemYnpSEsaSAFJpMWnyR8tyg0Zozp7ij9ur9TjTk+Su9VXT9BeMHhcAq8Q+4mfu2 sEHeO+h7wFH0Uk1DW2nOCX7MsEIpT66SFQcckFllR8GazTIxuaJWr07l5gEMw3/OjgXA PwNDaVLIfgfNC+TgFjcZATnBrpMVUv6sb8XdoTKq1Da/4qvyaIxI3jYEeAIJ/gKdaJqe jQYIiGnqVefb4+HTtw//yy8sv6Ny4IWrCr+y3eHdCsoiO88+na5HN7vTnvXA8raFv8Tt Q5lw== X-Gm-Message-State: ALKqPwdncF/VdsZFxSIZGnLUyUyimk662xe8gM8t4pEr3vrmFjZmPKXu lUJzwOFmE4ArXrkGGE24cI2kuZ2x4NzfZiVDxJqFsI5Tf+ZxlB/WR/6Am25XmUDKxixeHWvzfPV tUsjlHlt+585EQ1faoCd61Re6oPZ6VbwfKSyqj2QOQrDL2EGtNdOPWlwKSX2TDHc= X-Received: by 2002:a62:d388:: with SMTP id z8-v6mr12327532pfk.8.1527505040327; Mon, 28 May 2018 03:57:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr2mysiYwlq3hRIK6bntESif0WIBp5Lokc8zHLvonnf4nM3C6ny4RubBT1jG+l2oHYv3kcV X-Received: by 2002:a62:d388:: with SMTP id z8-v6mr12327497pfk.8.1527505039518; Mon, 28 May 2018 03:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527505039; cv=none; d=google.com; s=arc-20160816; b=rnZtVGXAyqQwVGf1i0vhOUEY3IUtSIshUHX59+rc3XX7f0rMf70IswvhOf3nLEPIKv XWZ6b27rQTePyt1qmNgmguJf0ffP49ZdK6yiimdxSgyU+sUP1YN5dC2USIAq5ZZV8BEm QaH2HPfbvbm60LQqEcvRk/oxUg/1FG65rqhrxOXpH2I/isM8mW6/Ofov6Sh90VcuPr2Z 6urUA+8iOmHDgNT1PVIOvXyzzGVvCUsPfnF45K4nPvYCy2j3Vq/HxHABL/suwQmRrctl Tqrm0zqbIMX12DUvzKxxCMMg1rX7GL66etLYFTee3UIB4wMeRSqI0WS7thIOi0wtTeOa c0IQ== 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=F1v7W+SAREZz1EEUFxsuItRYCdopgbS2HGCE4ziBDAA=; b=OwHMtTYrhAuAQ9JLNzoUjhsvMW53Ci7JmwLSol9w1tSPwrim5LvRzdRIZWDALoGPGq SZtbTsBfynER5msFtSMk6CL4nadKxHdNEQBDqlenP/PKEY9FO8c6Ecl/CyC8EzCxOZIN GSUqzU3AtgvEzbZzzh5Tz0tz7clJVs+3aes8K5K4P0Oqu2f71fbeaZsFfwcs9xHtv4Y5 Xmc9OZiW90D6OCNFzUZ/2j2u38LTJhfghPiFuwlJFTb5GQP8pK+ovlrr7PBdfmijMlW8 I4LoJSgkpJCrdGWCYqzmiwn6HaH5NItQJfLYCpCL7O239So/VvkkM5cl66Xjn1CfRzd7 THnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jjPqTTlC; 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 x23-v6si30118533pln.18.2018.05.28.03.57.19 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 03:57:19 -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=jjPqTTlC; 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 9810A208A3; Mon, 28 May 2018 10:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505039; bh=vfhz3Knf4A+NO+zquM5/9eHOn0K+jQY7BaLzq/JsUCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jjPqTTlCEHI7Ms3Wgtfh00UdrUDeG2DUigrK5ZSUxNBCuKuSyzcsyZ/6ujagTJ1yQ vojqaKQGRxWbwkl1t9bWwZ7SlxLgHNwQNBU9ZK5Q+efk7yFNkAoE9lvI8YcMzZsW43 VESy9hLjHAB7ksKJ3+j8rUlp864nHymn8oXGQhGY= 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.14 322/496] x86/pgtable: Dont set huge PUD/PMD on non-leaf entries Date: Mon, 28 May 2018 12:01:47 +0200 Message-Id: <20180528100333.398599532@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@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,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/mm.h> #include <linux/gfp.h> +#include <linux/hugetlb.h> #include <asm/pgalloc.h> #include <asm/pgtable.h> #include <asm/tlb.h> @@ -636,6 +637,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( @@ -664,6 +669,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(