Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp855339imu; Fri, 11 Jan 2019 10:11:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN60EYBtM2uHJWSlUFLeDFVxTfo06jsQVQRC7SRTxWbSdkORV5X8Np66rFQsNdq3lBGmCtvb X-Received: by 2002:a17:902:32c3:: with SMTP id z61mr15598801plb.114.1547230316366; Fri, 11 Jan 2019 10:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547230316; cv=none; d=google.com; s=arc-20160816; b=0o/StryThOn1eQb09O8tJtSnOAp1/56d7l/h4B+YyqCqaKr+gkzJRqmFpLzvCIXGi9 wk46lsz+rKT8QKU4slaF8kk7CUlxRaXRhz7BhA7JPOwE5GXAauR0m3lhQ1TWmeRxXRPr JEj8YKmAeh32YecTBTSQgq2sqfT1+2l5So600tCAheWJ4NigCv2OKjB+TTnQMqOGS6jY fr8dDbuLhVWfhaRKxER+4G5dswRTl1np16SJDjB+NwQKvVBF+S94nqSDAVHbUUZgs8LO 9f/20BaifQTQLY9ZO5fPuyDdVMxEE+/LQuRwOSjzHz8riX1XGbzWKeiQ6nnGTZI+TT87 3LpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Sj9Vie6otzcD/yY193H68FHSD2994DoVhJfspxodIQ=; b=jZso9ketlmHMGkhh6EtdDSRWMfKyVSG70k1RWYWxinJBk0cIdL/RP1Ik5Olf74ppx2 fCYqzG/fvGqkH5JZ2d++ZRt6jUX6yZlibY88X29hY5CHRQZuV5UZMiMnIH8FddkQVrc2 l9RVXGAz2LK4NP1q6sZwL8lp9k777oOwa8/vp9N2XY8H4288cMxWUUExtwpZRJN2rCkS UXusAjGO12TJIB9l72ZwUVwIn6LqZ6TQ2Je8RtfaEyRcspphCWSXAHduMLG4rPTkwx9E ddO6vCoOfoI/A/W9EvA01eJFkdfrT9TMjxRzaMM85BOXCZdnhHvMZbRFS21mDnGCiuj0 c0+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TI9rQtZv; 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 h191si57299162pgc.302.2019.01.11.10.11.40; Fri, 11 Jan 2019 10:11:56 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=TI9rQtZv; 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 S2388063AbfAKOUL (ORCPT + 99 others); Fri, 11 Jan 2019 09:20:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:37650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388054AbfAKOUH (ORCPT ); Fri, 11 Jan 2019 09:20:07 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 36C042184C; Fri, 11 Jan 2019 14:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216406; bh=9iIz9UCsY5sDBdWwKM2VQAYPqVq0eat760P5R2dyhR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TI9rQtZv/AmUdaUSXEhj+M83iuIwMzhabta9XRB1EhoyJbS1i+iGuWCL7IwZtaUDn oxR2cK76g+7TvkC/Beh9YdwdCrntWkKMOoypSBr19wAdtIexwfJ/mQcEFfR+0on4Af axStaArGB8VXbHm3njryztuB3bjRrswkfnctrUXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hogan , Huacai Chen , Paul Burton , Ralf Baechle , James Hogan , "Steven J . Hill" , linux-mips@linux-mips.org, Fuxin Zhang , Zhangjin Wu Subject: [PATCH 4.4 51/88] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent() Date: Fri, 11 Jan 2019 15:08:20 +0100 Message-Id: <20190111131053.606551681@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable 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 Cc: # 3.8+ Signed-off-by: Greg Kroah-Hartman --- 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; }