From patchwork Wed Mar 27 14:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13606743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDACAC54E67 for ; Wed, 27 Mar 2024 14:33:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50BE76B0099; Wed, 27 Mar 2024 10:33:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 497116B009A; Wed, 27 Mar 2024 10:33:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 337206B009B; Wed, 27 Mar 2024 10:33:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 14C9C6B0099 for ; Wed, 27 Mar 2024 10:33:18 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C49E21C02DD for ; Wed, 27 Mar 2024 14:33:17 +0000 (UTC) X-FDA: 81943061634.15.D69EB22 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 330F414002C for ; Wed, 27 Mar 2024 14:33:15 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="c7B9R/EO"; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711549995; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=l5JjIi+WQ126Fkbtv46vLIk/jhfAPVnucXDpVIswBCE=; b=WITxa7bUHFplAS8CKxoTlN2Qd1fUah3h4mzeDTPiSyil6lhsZORPhM8oWArkcF3o1puWeS X+G0xVZhrRC10lmRrkh2flVg/Dfn9F7H5jFxxciUU1bQlZRfphV9lWYVKzEGfv/rOitHGT X3maP6qtNHBkKQ45aQnspqeg9/nCb7s= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="c7B9R/EO"; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711549995; a=rsa-sha256; cv=none; b=dtYz+Z+7iuFls/hCtYiLwJeQ0OjoRsPEYINaXgPzAlWJHOmtx3iulKgvc6JRG9LVl31sLO DjZDPX3CAmHVTxXsWcUiE6MGtlAuDtN/iba4/LJEdAElhRlN42KvMHTef5grtv+LT+enrH 7nq598cg4fQqGr98X0UtLPFWieYIKLU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711549994; 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=c7B9R/EOEMP9wMYe30RnFonvP81ryE5KFLfIxiO7NX8dxDPAP7mBrHheFsOL+GRt320Fml HmNq7W9MQtJt2ZDW00qyiJXNeYUPdcaFZXWOrJi55qOnFoY9GZxDhsgIANYvKOOgy1YnOa 8yn2AWmHyPb1N6ajUBtL3BWvtPYGvf0= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Rspamd-Queue-Id: 330F414002C X-Rspam-User: X-Stat-Signature: fkc7yky8y9tmmnxqrruejn4bmpxq44pc X-Rspamd-Server: rspam01 X-HE-Tag: 1711549995-863140 X-HE-Meta: U2FsdGVkX1/f8aUuPu7DtFiAUYt9RaBxDXcKx2pn1L814doFZ1Nt/0K0fHn2/hoeylsUZcxQAJ58iGF6X3gmJAQ5wHUJmdTCt688G+ymz4YodSMORVoyw+rR0W6pW65Rs7dDZOfPNDOpJEZdw8L90kku+gCRKpRh2Dn64QpfgHx8HT+8+dQE8CBp0ola/KOq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C3i873CiM20c5EV1PdO/9HGVKiB8OEZlOOHo7lCmQOf+KGb6petfYxbd669mutcNfEmfuTPRe6U4JWwKP/fp4ZQbSNxM1EmHwg/VVDmazAlAHgtAnmdm2sVi5B1GbouzYDXD4R5H+1zUPYVj7mrOQwnyGI6sWDnw6fyH+18gAyk7lxBAvMbjdV3Wups= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Vishal Moola (Oracle) --- 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); }