Message ID | 15274372351962@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 12820601C7 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 27 May 2018 16:33:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 014ED23B23 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 27 May 2018 16:33:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E98FA28986; Sun, 27 May 2018 16:33: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 14B1A23B23 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 27 May 2018 16:33:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C7426B0003; Sun, 27 May 2018 12:33:22 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 176676B0006; Sun, 27 May 2018 12:33:22 -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 03F8B6B0007; Sun, 27 May 2018 12:33:22 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id B1C026B0003 for <linux-mm@kvack.org>; Sun, 27 May 2018 12:33:21 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id t17-v6so4824320ply.13 for <linux-mm@kvack.org>; Sun, 27 May 2018 09:33:21 -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=zGdUK1E+xLaBjx3vYt6h9SSd4CfALFkYhOURrgFQuvc=; b=iHMMI/H6rwy63WyQAy7UHmptuIhJq34v7mrNM9VRmSA0lqkEmrc0ED3+4lT9mNc4fg cxz9jTOA0Bi1RJ0O/HxhVDU5+uU7l0WAUoa6fszBZFp2ClYdZih4PqaQo6bNz0ULxjHJ piWKgwc0aI294Iag2qMWcELMmy20jFJFoSDCcx+1ZSVIy0YmJ6RYGJBp3nYR6v5zA5sk AdgOF3ChYuFZQqaWn+oxHcJQo8yaLNUg4rDBeIqtFzSJx7HUfDK+AZofXKlz0GIH7V5u 9/dsRw8AARpEc6aOl7+1BR0zhqMJZIf9aTC0QypyJediROwBHQFPCSw8HdrJ5G/gzHaM esLA== X-Gm-Message-State: ALKqPwc34ZygHRJi6d8+ASZ8zytv6EqD7lqt0+NoiWspQq2Cj5DMkNkl fJyHgrL6LwX/bJ2aW4nhuLjGe57qk0dCtWIOClb5TiXg3SwJceoXgne53LRnTVQjNvPqW4uE5OV YCaD+5n3wt4Zn7GMF4+zrmVnQWRfLnqIqd3DrY83vgBnGrxA8P7taSMF5vy5g6ak= X-Received: by 2002:a17:902:bb83:: with SMTP id m3-v6mr10446708pls.236.1527438801400; Sun, 27 May 2018 09:33:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq2sAzQCHx7VZoev+BGZ6qRjYX1+PXItUcAK8EP1MNqUSbUs6Xl+rZ6soTGOVK67HRTVzVx X-Received: by 2002:a17:902:bb83:: with SMTP id m3-v6mr10446684pls.236.1527438800671; Sun, 27 May 2018 09:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527438800; cv=none; d=google.com; s=arc-20160816; b=xzUjlugz0WkkTzPuN29/7XVi2N704PvzMPP2ARn4OQY63HkzrZkPoIwb9o8SnRxweN XgEN/+clCpnPdQeTvoBhdT5Lyr04GkY6CzonMj13zRtR1tuJuUVTqegoIfNT2gFaZbYp ZIOo6inqsd8TO7y2oWHLybkL1wzR5EVXQpk7RC3+PwkChQpWu8CUMJfhwkm8CTDxscBh SjcdhLHuFneBbzd9wTe2dPpG4MnQfmKVxrdcBt40hK3xig4u0nuX1jALzSUNEYmJzg6T jeJ60foN7cE0YHq6SVstuCpc9W+C/8TlZiPKFocO816MOGRDy69O8xVwrRPWCZPWuhYe 77Sg== 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=zGdUK1E+xLaBjx3vYt6h9SSd4CfALFkYhOURrgFQuvc=; b=z4/Of4sC8Ufoj1I4Z8sh3lpBfGFqjRwAWpqinNwA+gnJ3prEw7KEQhNZfpzbjDc+5c QnKsgN9yWMFcV8FPEx+xCWDyfcRfWV2Fl9RATfpNZKgj1ftSKQw2LKrtWY1AkC2HNzuv dA8GBapImAlpqktV3nTVB0datLY3kb2rovqnNoeZbj2f1GPm7esf8cesf1axKChDEYFj M31/A6vs6n8akDod63H+fSg/KvPTniNoPr3FNFKEB6aobUTRwZU//CFBt2iUcdK3sgc8 v3B0giCpIVBHHp6VN6r7LLMRcR50MqJq/uwhktRpIOGTzkCWE4zZYh6kHBUuHv176uay dn1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gERGMjnj; spf=pass (google.com: domain of srs0=ri55=io=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=rI55=IO=linuxfoundation.org=gregkh@kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id c10-v6si9167847plz.190.2018.05.27.09.33.20 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 May 2018 09:33:20 -0700 (PDT) Received-SPF: pass (google.com: domain of srs0=ri55=io=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=gERGMjnj; spf=pass (google.com: domain of srs0=ri55=io=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=SRS0=rI55=IO=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 9CC752086D; Sun, 27 May 2018 16:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527438800; bh=TFXJiYZraVvBRNj9upemg8Jel9houG70a8wYzuIjVe4=; h=Subject:To:Cc:From:Date:From; b=gERGMjnjcm3VJdF3fal7C8Dj/zqBn6v53pJ2BqUt51MUu+kUroOHzStwJ1Txi3RoM 75g7lJjXvT74mJR+dfnSU0dvJkOX9jxyfFlXPFywynU9wasH6KVsGMQHWkP6ZmQ1OH EXgM5u0v0V5i+nuDi/C1efk+vPRsJEpYllrUQ3pg= 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: Sun, 27 May 2018 18:07:15 +0200 Message-ID: <15274372351962@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(