From patchwork Mon Nov 11 18:27:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 179118 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7061078ilf; Mon, 11 Nov 2019 11:04:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzJ2SCQFtXCSmfbcgknkrUIUaU79KAMGUGk+P7544hcVrS36D7rHeC79/Alm1ObV1OTTqRT X-Received: by 2002:a05:6402:502:: with SMTP id m2mr28455130edv.65.1573499096348; Mon, 11 Nov 2019 11:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499096; cv=none; d=google.com; s=arc-20160816; b=C1P7t+GYUgqKSFd07/9G6LQjy6vQjsQypHw3WMlLhe5HDYbTcp0Baq5DLtYHJ5Bopt vGsDZk8m7RfvZAbI0sZWEXOqrTAZKQyU/XnoYOpEWJLrFNf3fGqDq2CbNz9vHDKVpC3/ WjucIO4YEAov3MsqhryjuBFGsySbUf6XG98jLd+NGp3LGDAH78sNUaaEklKti8IFzcGs e88HEagRV5zq42heX3brDZ3Y2bJ9bYq9jHfB+MwuofE29fQrKfkjK2cQlUH3Yw8Lva4E 2PckLrsYG6O2QyGzi9QfBRPd/WWZiJQs4Cec3h5wW1C8F1WBfg5lAZi4WfRTjIFJB1/Q dW3w== 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=xC8XImw3WYsfSxzVZmBjFs+rd9hvkn/0uJvH4CrVTyY=; b=o8cmZCti2ZTjw09z/HBSKD5lPYjGvCC4VP49m7Z7BnxQfPqymkid5Oq8WOhSVTUZ1+ E5L3NjGJFPGXwYKJFimmBc/eOP/zxSv5eKVU/Tza7CtAvrfHwlYp1aVVArq3I/SCGjtM jvy4WUdbxAWWD8AcDufrwhJ+hi7fyvaHtypa9GlWpT3lKiYjzRhnXS8GAosazTdymQvO dGuuyDyzHy6Z3bDX1AkhSU/2rgJdhAojFyJXQtkgdC0e3IsUXgVY3yDLoHG6GaxuQ+JS G/zLNPaMQjeJELua2lHKVKviEvsh4l8WghK80H/j+VAwOIMZ97lhKIvMGs4byyCesiS2 +8Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TQfy4k43; 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 w1si11976623eda.433.2019.11.11.11.04.55; Mon, 11 Nov 2019 11:04: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=TQfy4k43; 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 S1729423AbfKKSlo (ORCPT + 26 others); Mon, 11 Nov 2019 13:41:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:32774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729344AbfKKSlk (ORCPT ); Mon, 11 Nov 2019 13:41:40 -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 993DE20659; Mon, 11 Nov 2019 18:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497700; bh=OWJ7KVQesTndgseJLu0omQM+a7vLVTgBhg5gHiP44jY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQfy4k43hHuMHQswcvwTSyLf7781F5dRZFcFJXW1Mgr7IBmtaIlmsX5iuGLMCPW57 OHoe+OjFD8Qj/nM+FFB8VoxhModobGGrXxs4bXty6hrOkeSxRi94fdTLO8mWMGtmCt gVYxwyyGUsRoGlkEwKPsTWyRcFGpY+R+6BeCR4o8= 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.19 030/125] arm64: Do not mask out PTE_RDONLY in pte_same() Date: Mon, 11 Nov 2019 19:27:49 +0100 Message-Id: <20191111181444.832642671@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@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 @@ -274,23 +274,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. */