powerpc: kvmppc_unmap_free_pmd() pte_offset_kernel()

This commit is contained in:
Andrew Lukoshko 2024-10-07 14:20:26 +00:00
parent 93d1b08589
commit 7799dbe956
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,66 @@
From d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b Mon Sep 17 00:00:00 2001
From: Hugh Dickins <hughd@google.com>
Date: Thu, 8 Jun 2023 12:22:39 -0700
Subject: [PATCH] powerpc: kvmppc_unmap_free_pmd() pte_offset_kernel()
kvmppc_unmap_free_pmd() use pte_offset_kernel(), like everywhere else
in book3s_64_mmu_radix.c: instead of pte_offset_map(), which will come
to need a pte_unmap() to balance it.
But note that this is a more complex case than most: see those -EAGAINs
in kvmppc_create_pte(), which is coping with kvmppc races beween page
table and huge entry, of the kind which we are expecting to address
in pte_offset_map() - this might want to be revisited in future.
Link: https://lkml.kernel.org/r/c76aa421-aec3-4cc8-cc61-4130f2e27e1@google.com
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: John David Anglin <dave.anglin@bell.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/powerpc/kvm/book3s_64_mmu_radix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c
index 461307b89c3a0a..572707858d65d4 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c
@@ -509,7 +509,7 @@ static void kvmppc_unmap_free_pmd(struct kvm *kvm, pmd_t *pmd, bool full,
} else {
pte_t *pte;
- pte = pte_offset_map(p, 0);
+ pte = pte_offset_kernel(p, 0);
kvmppc_unmap_free_pte(kvm, pte, full, lpid);
pmd_clear(p);
}

View File

@ -957,6 +957,7 @@ Patch1: patch-%{patchversion}-redhat.patch
# AlmaLinux patches # AlmaLinux patches
Patch100: eaaaed137eccb9e8f3a88f6297e214f53885196f.patch Patch100: eaaaed137eccb9e8f3a88f6297e214f53885196f.patch
Patch101: Rename-mmu_notifier_seq-to-mmu_invalidate_seq-in-book3s_64_vio_hv.patch Patch101: Rename-mmu_notifier_seq-to-mmu_invalidate_seq-in-book3s_64_vio_hv.patch
Patch102: d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch
Patch1001: 0001-nvme-pci-add-BOGUS_NID-for-Intel-0a54-device.patch Patch1001: 0001-nvme-pci-add-BOGUS_NID-for-Intel-0a54-device.patch
# Bring back deprecated PCI ids #CFHack #CFHack2024 # Bring back deprecated PCI ids #CFHack #CFHack2024
@ -1715,6 +1716,7 @@ ApplyOptionalPatch patch-%{patchversion}-redhat.patch
ApplyPatch 0001-nvme-pci-add-BOGUS_NID-for-Intel-0a54-device.patch ApplyPatch 0001-nvme-pci-add-BOGUS_NID-for-Intel-0a54-device.patch
ApplyOptionalPatch eaaaed137eccb9e8f3a88f6297e214f53885196f.patch ApplyOptionalPatch eaaaed137eccb9e8f3a88f6297e214f53885196f.patch
ApplyOptionalPatch Rename-mmu_notifier_seq-to-mmu_invalidate_seq-in-book3s_64_vio_hv.patch ApplyOptionalPatch Rename-mmu_notifier_seq-to-mmu_invalidate_seq-in-book3s_64_vio_hv.patch
ApplyOptionalPatch d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch
ApplyOptionalPatch linux-kernel-test.patch ApplyOptionalPatch linux-kernel-test.patch