Message ID | 20180528100245.071626281@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 1E058601BE for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 11:07:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DD3428A5E for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 11:07:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0200F28C76; Mon, 28 May 2018 11:07:47 +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 3F30028A5E for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 28 May 2018 11:07:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 49EC06B0006; Mon, 28 May 2018 07:07:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 44D6A6B0007; Mon, 28 May 2018 07:07:41 -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 3157D6B0008; Mon, 28 May 2018 07:07:41 -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 E550B6B0007 for <linux-mm@kvack.org>; Mon, 28 May 2018 07:07:40 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id l85-v6so7194211pfb.18 for <linux-mm@kvack.org>; Mon, 28 May 2018 04:07:40 -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=5rueNLBPZbB6TwSBhLP6J/nPIlCDZ+1Z+al/MFNHsqA=; b=jOuFrImcaQBnMJfUIvIxOgLrcfhieaDpZhY7dJj6aBFti3myqVkNdrxLA4b07WhbKJ mqbgm/IT7TFfTxaPkSSARefAZVI9fKOjfgGjneNzW6alIm05sZ/3ty655l6qaMRpbHnq Yj0iC1iYNw1BnMFCD8sfy+l8BTz8sr5UR9tqPY49GGNub6f9FvOuD3AE0HlH5hiCsWD4 olfGPOzeWyvCsYuk7n3xrXgiFWbG6OMPeuC6GkK9XDT44I9dYcSQ+S6mYO9egaFLNrly 41sONE2wB228AS2ResyvK903TUAwGUWhRFaxdmTEATOItD8IE7ZPiZqH9a5WIAB0Ady4 0c+w== X-Gm-Message-State: ALKqPwdBtCugzfSXhdIW9/dm+0oklTv8RYFki1ym2LekFTtjkFqiSvW9 m/atUw3hMX8AWEZSYLJpcOv7HgasAnaeD48QGd5AY5O3qRGyrmiJkt1AvjFhGrEqIWqt0y/5Oxv 6KJZSrV27aFKJRdZJfBoxlzSeHZIHxTiY7DAz1sDNc5XBi3iaCGqf4bISVv7lCpk= X-Received: by 2002:a17:902:4b:: with SMTP id 69-v6mr13503777pla.178.1527505660602; Mon, 28 May 2018 04:07:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqecrp5durtHm5cp3UL2rooaIu2DD+B3IWhV8/NagXuJqKhZqgWOfIJtGSjyESyYddROShF X-Received: by 2002:a17:902:4b:: with SMTP id 69-v6mr13503730pla.178.1527505659970; Mon, 28 May 2018 04:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527505659; cv=none; d=google.com; s=arc-20160816; b=GZcn4N3esDv4BpuB/2hP8AX7sOhfJruzSAlDyaa2dMPbtff1NeXdVfA+iUbGu+9I5D b/vWz4b68Go8o8zCPY7KNZ8EEGOM/D3ys5tXkz/xTtJTM8+C2OaT8W+IP6eDxcd+GRNi jilS9BrGYdZy7NwsGoWkYR4uLURDkqtVZWS8bgMgBw07CTaQP9UtEEdk7Ti4Qxoa+NWQ 7K+ukchJ+zKkO/L3HKKf2e/7BYU9/MuNCbu6/ACR4YmnPqn8Gy5Dym2jWW0Dpaoxi0dd +lE6lsiwYUvBuMEKxCBcgAbgAtm7IRwz/EBMkrMOKYIbrRmObgT9Wrbm/IpmgmFPW348 vY7g== 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=5rueNLBPZbB6TwSBhLP6J/nPIlCDZ+1Z+al/MFNHsqA=; b=kRhDLervBSoGNYkiy5GsmAj/ljMslkxR+AR5DEMvqroCT1n0lDfFMqmRcymzQfEUof rSarE8cmS0rHVU2Cy0l1i3n6f+uc98K+1T/cgRXaNcUUaVmgDeQgHgCSHXep789sgz7J CDfLdBVQMTekIkZrwFcBsL/qNjfI9KRYFEkCz3zLiYM7HGewQGrkAbzAqZgVGFobsC29 X29GGT+t5zDZKWOGT2fiI9rKRdBCBUuvwdjCi4SXIT+mivRcK8qaysvfZHnRyjxR/E2H zbLkgBYAeC8rH/KSxddXVlf+pFUYrO2RAsIXJLDGzEjAbtAyUc720js+gPqVmVtLjb/6 rlSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l5mTBeHH; 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 w23-v6si13841916ply.563.2018.05.28.04.07.39 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 04:07:39 -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=l5mTBeHH; 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 2217A20845; Mon, 28 May 2018 11:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505659; bh=BAFbYORoKcxMC27ivyYO8AZ+dK5wqUDS8tKaFKsD/L4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5mTBeHHGcaxAr55mMv4jzgtofwwtmTVx0yueJ7iqtd31ud+ZkIlcPHffynzf7dhF eyT5PFlCGZT6lBFh10Sw6doK9AsnrU2KXL4rkvihzrVkl8RXY4/mwX1PKWkMRoKGOG LzwJWbVxegJzXPbvxsj/+2rNJgz/XE8jG1tzNZx8= 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.16 050/272] x86/pgtable: Dont set huge PUD/PMD on non-leaf entries Date: Mon, 28 May 2018 12:01:23 +0200 Message-Id: <20180528100245.071626281@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@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(