From patchwork Mon Nov 11 18:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 179108 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7028175ilf; Mon, 11 Nov 2019 10:35:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyWuKJAZtRgOJ2jFz2F7DYj+3VdB7BN1YqQM/x5ZIGWezzFLW82EzsxF/HVcKYFjfVMgqbS X-Received: by 2002:aa7:c493:: with SMTP id m19mr28202961edq.39.1573497355331; Mon, 11 Nov 2019 10:35:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573497355; cv=none; d=google.com; s=arc-20160816; b=B1aUseJhCILX8eQ1k50aEBy/OQ78P+3VNk+sF07hIoSBrgK6kDciBcDYId+S27bK0O GB2/kiRgVpSYsw8WtCLO7a1pbiqmVcUm3KrGgzvMAcPzKu77sxuxQl4+Hag1WeRYBj1m VAcb0Tn7Y6BNmWlSe0jrObxtpZ00pBQBZhyk7L6fuyXxSeLkCnKvWaiCFbWxZ8UPIi7g zkHrlBiJgn7BeVY7m3J4J59W6vV8ateZySe6Mxdm65afyQTvcIsoXfFPz0rB5YuIUpj6 /0iGyCNeAJq9Y0SoG4m0n1NOp2ZgOpBdQC+6R6Y5Kzg/fCc0ai7LHonL8CjL/tMClsAx DFUA== 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=9ih/a4XkyWD6nf/8vltwWHG/Kuv2LbUlVtQTvfdTy+Y=; b=JfMCPoogTe5T03YkOeb8zugQrImq+CjvatHs2ldKZbr5amgf761VPkXAGenlQymUe6 XzdeWx7td8UR1qb7D5T7B+kTZvWYMsDi2YVbq/ubR2gWxhFYbysdxuWYLrIb9/xyykqS MC4tE2zDjO5hz5cW7MM1YA4ej7KBkxDlharUdJ7X8966TFuE0Jd4V15wxNB2yliL+q5h v/jMTIzz9PGNCm+WUhf3sdZjsa98aPW4lG3ORBPm0wJfmk3lyp00ZrJHvd9Hu2heEcKV bwK2PZzYSgBnFiX9yshSkfGQUv+Nq84C3x1Vyny5iSokeXb0rcun1Sg8DkNXS1YwGqTs NVvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yDfc0waT; 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 c23si10098727ejk.143.2019.11.11.10.35.55; Mon, 11 Nov 2019 10:35:55 -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=yDfc0waT; 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 S1728618AbfKKSfx (ORCPT + 26 others); Mon, 11 Nov 2019 13:35:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:53838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728596AbfKKSft (ORCPT ); Mon, 11 Nov 2019 13:35:49 -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 03D812196E; Mon, 11 Nov 2019 18:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497348; bh=DgOeGiA0kYlJ1pwptbjhYwSRiBmoHrCye0hH9BMijLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yDfc0waTE+mJ83/fjioNmFOwQvf60cCPnTLaLpk4RyaIlTJ3J8WQPjlXnxB4mqLGo KWnrmMBJxHfGWnlpGr4Mhn9ePDHq7L6d4pd/MCdU0VIzMh3hxJRe50xL+W/HJaVMhs mzeWMNqrnsck4LvKBTmvMxCisKugWI4zHTEI+Nw4= 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 4.14 023/105] arm64: Do not mask out PTE_RDONLY in pte_same() Date: Mon, 11 Nov 2019 19:27:53 +0100 Message-Id: <20191111181436.637567352@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181421.390326245@linuxfoundation.org> References: <20191111181421.390326245@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 @@ -258,23 +258,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. */