Message ID | 152528501596142@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 2DB576038F for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 18:27:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D94228DC4 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 18:27:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1118028F7A; Wed, 2 May 2018 18:27:43 +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 EBBA928DC4 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 2 May 2018 18:27:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE9736B0007; Wed, 2 May 2018 14:27:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E70236B0009; Wed, 2 May 2018 14:27:39 -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 D37586B000C; Wed, 2 May 2018 14:27:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 740F76B0007 for <linux-mm@kvack.org>; Wed, 2 May 2018 14:27:39 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id r63so11708425pfl.12 for <linux-mm@kvack.org>; Wed, 02 May 2018 11:27:39 -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=40l5qsVfGXvMMNUMePFxfLxopt4zQ0cBtdZU+WGP8uA=; b=K0c2N1dbmfYPxpjco28Q0D1Ph5o20Cy1WHB7SHbF2iMPYxKVb2vxSDOMVBS75rtD1o iG3mTX8CMltAs1s1J4JAq9KopfGjTEZfWAfqs8a9Yk22s3Lv+LjMTmlR9SPaW5t6IDF6 IxyajqvpJ/LjbhAdiAROM/w+2/KKXFjhByGceqAnKjyMIBbzKYEsowBQiGxxsMRsFYAk f2Irh6YK6XDzaT9XmuemsjECOLF6La9SuCXF/F0elLeZLlQMdba4YDM4Rsr68ETq7KSp /gT7HACGj9iOfvUf9i953xMec180IBSi8C7pXReK6Bqm/MmY+tLonThmCCpyliJ7JRzW hKHw== X-Gm-Message-State: ALQs6tAb07hyel12u9JCMC7/fhd4e3uzqZzCix3m9mp8+hatDub++6nu xTNbRq526PVtkBnHEFRKiyEACJ5dCRz46gv3ySw4olYRwN1U3Ua29tR6MSXWibQACvlEiNk4hkM 5z2sJUNQVW2w9O0ypsJwIp9hm4lUFO+kG8yWoAJVMrHi+7fnBSNUz5PhWwG/QCEk= X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr20811979plb.226.1525285657980; Wed, 02 May 2018 11:27:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpQnmU8viGc4VLV7lIg6RQ7ddkIzGoraoDFsez3F5fc7fjYjyMBDvA22seISfmq6xpiLMC0 X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr20811918plb.226.1525285656949; Wed, 02 May 2018 11:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525285656; cv=none; d=google.com; s=arc-20160816; b=jRTOshbac1TmxkLrO0mBL6u3mX0Skt6RZ99KDQaBpo+2Uy2Bckr7QZ4zEoc62j7qT7 ydg6LHG2ekbnl7nawsfuC9iDvSuciqdzoxsWGZrjeU1d+1y7RxipYG37Sja3ZKCen1El Mq7Dv1McE3fIVwmf/p8iKd3EXTSPb++S7LwDLul3QaleB2q0SH9M9RfpQrItTHI+Swd2 3VAyR8OQrzwu226iKUVVMwOMyYzs7dmNBPxNV94hUlsgS/bEeaUWcrbX9tYPGQRjin/F wXpYOwo8uKpi3hZoibZuvlWiwlbA1jhg+tH5CMn1sNIdXOlH4X0oi0dxJtRjbazRyTOg 7jJg== 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=40l5qsVfGXvMMNUMePFxfLxopt4zQ0cBtdZU+WGP8uA=; b=HhI86rvmaoyzqMS2YlSiaryZa6kk7VgUwrSAN91xHBt9z7DHhlMubfkyo8/C5UCv4p +2nmgTMiBmPvjL9PD3L+Qm+zgZVfInwMQCf1GjCswNRN6MdyX1I+kwofbPNaK/8uWtiB Hr09KTHwgyPAfW00Qmbuq5fCmcYF7ne7n/vN6VB58afH/Ba3hOM8HVczno4jEnqVGAGU f3GQ71de2vRr1tXHMlmsBjM/efCqfKSOKXgCFMyFrSEQhXwzzRJFI8HQPU/5tZywSbpy AHfYU1XEi2vAXluQrCFOplIlW4hQrq8aMGYGvFPQWYhR/CSqIPs/BRb+wMQZETsAr/Qr qWYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ywTQl7Hg; 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 b2-v6si1383106pgc.569.2018.05.02.11.27.36 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 11:27:36 -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=ywTQl7Hg; 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 63A3323953; Wed, 2 May 2018 18:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1525285656; bh=UzE1ABqFk6czCatkejME13EGvmXSjws32E76vDW8f9Y=; h=Subject:To:Cc:From:Date:From; b=ywTQl7Hg54lp2bRepJrBllKSTJogdkrRkGxCLjPRNCfncdgXuI9NzEteDaTWF92Cf bnwPyqam/Ow/P44+iCA4SqmQ/EIbwLHVXP2UeH+OOKKGKE1TXhpW/JveQxvptyku0Q QusHYx1WLg6W48R9qC2tL5JA/44rdPXFg7Ks8cTo= Subject: Patch "x86/pgtable: Don't set huge PUD/PMD on non-leaf entries" has been added to the 4.9-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 11:16:55 -0700 Message-ID: <152528501596142@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> @@ -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(