From patchwork Mon Nov 11 18:27:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 179113 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7043629ilf; Mon, 11 Nov 2019 10:50:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwVcSY7/C+tvOamMs8CPX1zW/9zyLbGxYs+qOFetNqlET2jzAPQ5oO0LsLx23HYElC9EJDn X-Received: by 2002:a17:906:c44f:: with SMTP id ck15mr24129861ejb.7.1573498201050; Mon, 11 Nov 2019 10:50:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498201; cv=none; d=google.com; s=arc-20160816; b=VcbYriZjJYrWLktQHry6P5uYoHhL0h1xiCEHbBauxLIrRja+JTK9mTck2nlgZBOpfI JRrbcW4mzwPdG3YgznLyRJULea8FINhm6yqnawhq99e9f4toRCoUhYRF46sJRHIgE5Kk hcNuaSwjqGDm59UrKehcOO6q0kIwNG9v59JAEEP9D8RLYnJPWRyj881FlrKu4hjYM8lN 96HizyroidxuOFN84O+x5ykM5dKl8QDi8/cGTFH6QY5+uJCqLU9+nN6a/i0pGpT6fd+C d+QXvpVENx4b7fz8GUqtlu51fuR34LizdqDB/fKkgW3dLXoKBHmptgenHzDn42/LrHMX x8cA== 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=unmdQqN5KCNbCu6wHCKHdV+8syABtUDUnxtDW99/AWI=; b=hV8l68t9lG3VasGz6lvwpoppetwjeuhDP9S3tXzUmxZFa1ucScF7StZ0xluQIuZikG RX4DE2/9ziAiXWA+0SZBD+L4IaYagjI6i6kjm/fW/LH28BAz/Nk1EYo5l5yooK00lLUC OpGcT0OaJP3JEMoiHw8fK1Jh5ie/G0zIG0cEaMlvhuWkKwTHzj7K41b2NnYAJgys1Eo0 Y54tyGkybsD2GRZZ48X65NVYbJJWw7mIU0DdTBkibobr8YgyFB4KkBT7BA7S3HjG+Pt3 q96F/F+2MUPerLC8SPdFDZyGiCAWO2Rjzwe9Nhg+zrIDzJAz1K32DXlPvbIDjymBAmzB hb4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mB3pzccF; 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 v13si14240407eda.131.2019.11.11.10.50.00; Mon, 11 Nov 2019 10:50:01 -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=mB3pzccF; 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 S1730317AbfKKSt6 (ORCPT + 26 others); Mon, 11 Nov 2019 13:49:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:43358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729344AbfKKStx (ORCPT ); Mon, 11 Nov 2019 13:49:53 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 BC5E421E6F; Mon, 11 Nov 2019 18:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498192; bh=9FcN9T5Rfa+rfMnTwfI/2gS9KdF/tVXPP5ae4wU0P30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mB3pzccFwK+biqhe3xMSAxRSoYLFmkBlPXcUWjmzKBOI67MvI/+VB8i9JutLLCgb9 o1dnB391KIEHTDsrMdbxYqk3hE9Rz6bvM469Fm9wMin5klDg/eREW8CqopEGUYfpVj NnsZSvaqY7ppPaPNGgSuaTWhwloaycNerzmAIXNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Steve Capper , John Stultz , Catalin Marinas Subject: [PATCH 5.3 049/193] arm64: Do not mask out PTE_RDONLY in pte_same() Date: Mon, 11 Nov 2019 19:27:11 +0100 Message-Id: <20191111181504.586119821@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181459.850623879@linuxfoundation.org> References: <20191111181459.850623879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Catalin Marinas commit 6767df245f4736d0cf0c6fb7cf9cf94b27414245 upstream. Following commit 73e86cb03cf2 ("arm64: Move PTE_RDONLY bit handling out of set_pte_at()"), the PTE_RDONLY bit is no longer managed by set_pte_at() but built into the PAGE_* attribute definitions. Consequently, pte_same() must include this bit when checking two PTEs for equality. Remove the arm64-specific pte_same() function, practically reverting commit 747a70e60b72 ("arm64: Fix copy-on-write referencing in HugeTLB") Fixes: 73e86cb03cf2 ("arm64: Move PTE_RDONLY bit handling out of set_pte_at()") Cc: # 4.14.x- Cc: Will Deacon Cc: Steve Capper Reported-by: John Stultz Signed-off-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/pgtable.h | 17 ----------------- 1 file changed, 17 deletions(-) --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -283,23 +283,6 @@ static inline void set_pte_at(struct mm_ set_pte(ptep, pte); } -#define __HAVE_ARCH_PTE_SAME -static inline int pte_same(pte_t pte_a, pte_t pte_b) -{ - pteval_t lhs, rhs; - - lhs = pte_val(pte_a); - rhs = pte_val(pte_b); - - if (pte_present(pte_a)) - lhs &= ~PTE_RDONLY; - - if (pte_present(pte_b)) - rhs &= ~PTE_RDONLY; - - return (lhs == rhs); -} - /* * Huge pte definitions. */