Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1320839yba; Tue, 2 Apr 2019 06:50:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+JvF+EmucG0rAWgJKj8ASt1aT5MbMxhL4H7Rid7X5cboOoiysdaunU4qbxmtYdmEUimc7 X-Received: by 2002:a65:4108:: with SMTP id w8mr66730233pgp.236.1554213003169; Tue, 02 Apr 2019 06:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554213003; cv=none; d=google.com; s=arc-20160816; b=n3wOuDcaHL1rtBWc40r9pk/ap5abvoiX8lJdtOrKV7q1RTmWZbNeVRCblTUIIn88tX NlwcSzeEkBTXPAxcC5enGsfb9Xsck3E+vC82hYfo5Lviv5ai1b6G6EZYiHAPQ3SCjcdK 23har1DuyJFICCFMUYHRTEEvAGrO7260oK25E7rxSHq3qhfUI29UQQczwVK9jQbN0TFZ 8L98quKKdkWqEsDarSnThYg6pyauBRpLdBWqY49fZM3vLcLGgxmfCkdyHrFbXWn1Ugte XGmlgDiDFThbeqtHMxPmfPEuAX87At0X0+oDlLIl1BxQNPnn/mZI/Sj0SKCrQDSfsT0B /v5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=gBp8UaSsF95HmGgs0jbft9OKE/iI++mw/AT+cF3xoPA=; b=ohAaCiVoJsyA6ldqriDOh0uEadwwB4bmoV2gXPAZBKLBntDqxJlRf4X5oM/YPXC8eb 0s1GpqjQkfBIJBsY4zTUhvBU3cMYJXmGdWstpMIy69MAYYgcAezblSFlSZ7S0yrgtWe+ Avrz+rP7ocSDZLoaOkI8XHb9cbvlbEfRlKLCNJBDieP6OUzxHxt86UPzRgzlb9szTcms wGqoxYqs2gip5/PLRP6TgEZVqW6/yOr/skpAfjgUoKd5GbhfRCoPE6KTInLm8E55/zsB 0Ey5OCH024WcyD5puHbXekVYWaREZAIfA5bFjtkY5OWRpvCslo26EgnLHRSWMCP6+62V LPKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si10750193pgs.408.2019.04.02.06.49.47; Tue, 02 Apr 2019 06:50:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732297AbfDBNsa (ORCPT + 99 others); Tue, 2 Apr 2019 09:48:30 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:42926 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731208AbfDBNkC (ORCPT ); Tue, 2 Apr 2019 09:40:02 -0400 Received: from [167.98.27.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJdu-0002md-A1; Tue, 02 Apr 2019 14:39:58 +0100 Received: from ben by deadeye with local (Exim 4.92) (envelope-from ) id 1hBJdt-0004rJ-RN; Tue, 02 Apr 2019 14:39:57 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Paul Burton" , "James Hogan" , "Zhangjin Wu" , "Fuxin Zhang" , linux-mips@linux-mips.org, "Steven J . Hill" , "Ralf Baechle" , "James Hogan" , "Huacai Chen" Date: Tue, 02 Apr 2019 14:38:27 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 11/99] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent() In-Reply-To: X-SA-Exim-Connect-IP: 167.98.27.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.65-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Huacai Chen commit 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a upstream. This patch is borrowed from ARM64 to ensure pmd_present() returns false after pmd_mknotpresent(). This is needed for THP. References: 5bb1cc0ff9a6 ("arm64: Ensure pmd_present() returns false after pmd_mknotpresent()") Reviewed-by: James Hogan Signed-off-by: Huacai Chen Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/21135/ Cc: Ralf Baechle Cc: James Hogan Cc: Steven J . Hill Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang Cc: Zhangjin Wu Signed-off-by: Ben Hutchings --- arch/mips/include/asm/pgtable-64.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch/mips/include/asm/pgtable-64.h @@ -189,6 +189,11 @@ static inline int pmd_bad(pmd_t pmd) static inline int pmd_present(pmd_t pmd) { +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT + if (unlikely(pmd_val(pmd) & _PAGE_HUGE)) + return pmd_val(pmd) & _PAGE_PRESENT; +#endif + return pmd_val(pmd) != (unsigned long) invalid_pte_table; }