Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp147423lqo; Wed, 27 Mar 2024 09:07:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCI9SU12NMMpW62Yhpw67+dJlUbgrlamO/2HtATJoKNSe41zHRIjqccEvzNu84cDrzwbj9/hzVlkyygumylaiDxNSA7p9dph9o0NzOag== X-Google-Smtp-Source: AGHT+IFlx8bF5+1PAjxptF3XpQjX423dTuDJa2FSTp0g6zb+m0fZblg+HRchX66i90uhnbB5ljVE X-Received: by 2002:a92:d249:0:b0:368:ac48:fc7e with SMTP id v9-20020a92d249000000b00368ac48fc7emr465026ilg.2.1711555654931; Wed, 27 Mar 2024 09:07:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711555654; cv=pass; d=google.com; s=arc-20160816; b=TJ58jNhiV495WWE9BD5TUiV/PJiNTMFKqlEUDzY5BIj1peQ+L3/+vnzP0NbVO4QtWZ PsLwbtslj0Zf8Tcior7b+kbSd5PaRiIDMLeYXuUFdTaYwg+xL9ZqwTooy1gvCy0UfFwp 5ov3iDhwgS9SBI/OwCDIDtBzBx8+/3CCKscdjx4G9YeedPVbT298SHku99bHayyYZzRP URgTnmLaXizt797KDhvrylHNE0kLR9ng1blTGc0nG+8jssfgO/jBux+yqcAhkYgnjhrS xp0NnxXgx+/jldQ//OSA/iMD+bt0kPwcP/jNhmPJfD8qPAUMQEVk09SSGhSaErsNokYC 3BuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=l5JjIi+WQ126Fkbtv46vLIk/jhfAPVnucXDpVIswBCE=; fh=LwAfc10ACuOtBhK1LHgoQVRBIbospvCEBmF78rnd0Yo=; b=cTRk/QM7zDEWk6eE3kVgSgB1eMevm0LMZelFLvFLXuVoL244cogcqZTIBQ4hlPQErm noENYH7IJF0P7KpWvXVzojWWgnbhE2gyQKrHEhnpZQT7gZPWMeYx28fEUHYkah6VvgDR vBmP0lYMAekwzTCUAbIjv3orqUzd605AxwNgZpYw4J7lG6uYM7ws4MCPtSGh9c4Xbjso CjtYEk6EGJqEI9S6dnoBJ9E0EStMB4ivTDgtpf2BTk86UQWq+qwyn7dbr2ar3l+Ub7mq vF4ALIWi9/UkPZd02PwmQp63ujci9PVY6m1d0uIUnExluY83IxdLua2jhZBway6pM+f4 TY8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwsPee+7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-121443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k22-20020a63ff16000000b005dcbb6a2cccsi11933280pgi.44.2024.03.27.09.07.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:07:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwsPee+7; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-121443-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E6E1EB30A08 for ; Wed, 27 Mar 2024 15:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B638312FB25; Wed, 27 Mar 2024 14:33:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iwsPee+7" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 515721386C2 for ; Wed, 27 Mar 2024 14:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711549996; cv=none; b=jADpzVGDl1JstpGOpIjOpCzUkThF6rZHv5fbn5Z4exPjU8viygny0l1j7fKSL8/RoXnx5iUBF/cnBeL4QFEiDqVkKXPmTq36ng/+c5cn6Wd1Y0eTNvyx7hOP5CafJxlqG4Bz/25g6P4FLClqoxuZE5U4hV5RYmIpsEhs6N34Llg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711549996; c=relaxed/simple; bh=8gpmKkY29SJuTg4LmIbkZEOBCZ11ElunVVIi45/9jI0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=M16487/cFZBtcFelgzAPAN8kYu2DBPaREkB0iPVbvoG+xpR9jcdcWsq7tqI8qzvXd7r7APgRE0SqKHd48ArP4CWSemvgJOGBj1MHkTpc5qx8cZMPQHLpJq8iy2GkId1yy07pSxbnzQpgijIM/Wy+2jaM+un64K+2PuJgLG8Wxi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=iwsPee+7; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711549993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=l5JjIi+WQ126Fkbtv46vLIk/jhfAPVnucXDpVIswBCE=; b=iwsPee+7L74ngJpQ7nBy3PQSx63pJU93ZEeTojxRUogfE8OG40gihIbfMT6sHS+y4PD62u 3dPXKA+q9XWXEJ1RC2xPSESGHyyJPLO6ro3M/YkIob/I3TI5X4PnBrlnGQpT/MVLTVN7EP 4LyZ7vEVHMWElJExdBaCPAL7foyTlbE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-ek6u8Lc_ON65MTWXMQdBMg-1; Wed, 27 Mar 2024 10:33:08 -0400 X-MC-Unique: ek6u8Lc_ON65MTWXMQdBMg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4FB8A8007A7; Wed, 27 Mar 2024 14:33:08 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.193.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EE5D492BC9; Wed, 27 Mar 2024 14:33:06 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , "David S. Miller" , Andreas Larsson , sparclinux@vger.kernel.org Subject: [PATCH v1] mm: remove "prot" parameter from move_pte() Date: Wed, 27 Mar 2024 15:33:01 +0100 Message-ID: <20240327143301.741807-1-david@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 The "prot" parameter is unused, and using it instead of what's stored in that particular PTE would very likely be wrong. Let's simply remove it. Cc: Andrew Morton Cc: "David S. Miller" Cc: Andreas Larsson Cc: sparclinux@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/sparc/include/asm/pgtable_64.h | 2 +- include/linux/pgtable.h | 2 +- mm/mremap.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 4d1bafaba942..38c3446e2c61 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -956,7 +956,7 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr, #ifdef DCACHE_ALIASING_POSSIBLE #define __HAVE_ARCH_MOVE_PTE -#define move_pte(pte, prot, old_addr, new_addr) \ +#define move_pte(pte, old_addr, new_addr) \ ({ \ pte_t newpte = (pte); \ if (tlb_type != hypervisor && pte_present(pte)) { \ diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 09c85c7bf9c2..e62fe05318db 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1079,7 +1079,7 @@ static inline void arch_swap_restore(swp_entry_t entry, struct folio *folio) #endif #ifndef __HAVE_ARCH_MOVE_PTE -#define move_pte(pte, prot, old_addr, new_addr) (pte) +#define move_pte(pte, old_addr, new_addr) (pte) #endif #ifndef pte_accessible diff --git a/mm/mremap.c b/mm/mremap.c index 38d98465f3d8..f5aba752d35f 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -205,7 +205,7 @@ static int move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, */ if (pte_present(pte)) force_flush = true; - pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr); + pte = move_pte(pte, old_addr, new_addr); pte = move_soft_dirty_pte(pte); set_pte_at(mm, new_addr, new_pte, pte); } -- 2.43.2