From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 357C0258CEB; Thu, 17 Apr 2025 18:32:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744914764; cv=none; b=Y3wPNk1+AkNOjBOxkJxo4l/mgDBfGb46TgmNx6vkgM4aEeMcw3j10K39KKchsHMzXWqdExr39yD1Ldn/CwvnXVpKJdBe7JbNOJTurx3SdibOBP1a2naEVhooFka7MpqmJ7GhA79/iB6V3bz7q00r1KnDuYkzYbFv+jDLOp0Q71o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744914764; c=relaxed/simple; bh=MeSNjdoNH112e1adYdsV6wJiJMVpfOP0eB4vwOKqQR0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mseY1yBaMvdMN8VsteiyMaseKANnMvA12g6nVAxY5N3i9tlS+qvfgbX0rIUqgmFU3sIg0iaxs4D9ExlIRUwDhL+KQGgmjQujViz2UKZqnZXQx1p5rwhGelnAJKZ2EunMGKm6jH5OoftgtGCxGmu3YsWbr5ONSN3dXkloHR8ixlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ft4ViV59; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ft4ViV59" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85BA1C4CEE4; Thu, 17 Apr 2025 18:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744914764; bh=MeSNjdoNH112e1adYdsV6wJiJMVpfOP0eB4vwOKqQR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ft4ViV59ueKqNKgghWshOIvlnkzmcVqW9UQ2UMIf0TU1VDw2IHfWrM3KxrwYVqTG2 i0Tl8wI6qqSUbvaEm0LHVLpTncNbjny4OJiZkXhqjz5V863fP0qHDGBTjs4wJBMCpH 00en7gyRWdyn3HnYSot9K1WBnK7dTqjgmL3USYTg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ryan Roberts , David Hildenbrand , Andreas Larsson , Juergen Gross , Borislav Betkov , Boris Ostrovsky , Catalin Marinas , Dave Hansen , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , "Matthew Wilcow (Oracle)" , Thomas Gleinxer , Andrew Morton Subject: [PATCH 6.13 323/414] sparc/mm: avoid calling arch_enter/leave_lazy_mmu() in set_ptes Date: Thu, 17 Apr 2025 19:51:21 +0200 Message-ID: <20250417175124.424068626@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175111.386381660@linuxfoundation.org> References: <20250417175111.386381660@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ryan Roberts commit eb61ad14c459b54f71f76331ca35d12fa3eb8f98 upstream. With commit 1a10a44dfc1d ("sparc64: implement the new page table range API") set_ptes was added to the sparc architecture. The implementation included calling arch_enter/leave_lazy_mmu() calls. The patch removes the usage of arch_enter/leave_lazy_mmu() since this implies nesting of lazy mmu regions which is not supported. Without this fix, lazy mmu mode is effectively disabled because we exit the mode after the first set_ptes: remap_pte_range() -> arch_enter_lazy_mmu() -> set_ptes() -> arch_enter_lazy_mmu() -> arch_leave_lazy_mmu() -> arch_leave_lazy_mmu() Powerpc suffered the same problem and fixed it in a corresponding way with commit 47b8def9358c ("powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes"). Link: https://lkml.kernel.org/r/20250303141542.3371656-5-ryan.roberts@arm.com Fixes: 1a10a44dfc1d ("sparc64: implement the new page table range API") Signed-off-by: Ryan Roberts Acked-by: David Hildenbrand Acked-by: Andreas Larsson Acked-by: Juergen Gross Cc: Borislav Betkov Cc: Boris Ostrovsky Cc: Catalin Marinas Cc: Dave Hansen Cc: David S. Miller Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Juegren Gross Cc: Matthew Wilcow (Oracle) Cc: Thomas Gleinxer Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- arch/sparc/include/asm/pgtable_64.h | 2 -- 1 file changed, 2 deletions(-) --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h @@ -936,7 +936,6 @@ static inline void __set_pte_at(struct m static inline void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned int nr) { - arch_enter_lazy_mmu_mode(); for (;;) { __set_pte_at(mm, addr, ptep, pte, 0); if (--nr == 0) @@ -945,7 +944,6 @@ static inline void set_ptes(struct mm_st pte_val(pte) += PAGE_SIZE; addr += PAGE_SIZE; } - arch_leave_lazy_mmu_mode(); } #define set_ptes set_ptes