From 7799dbe956562a8f705e9045ae5d5f4e5528e895 Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Mon, 7 Oct 2024 14:20:26 +0000 Subject: [PATCH] powerpc: kvmppc_unmap_free_pmd() pte_offset_kernel() --- ...e31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch | 66 +++++++++++++++++++ SPECS/kernel.spec | 2 + 2 files changed, 68 insertions(+) create mode 100644 SOURCES/d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch diff --git a/SOURCES/d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch b/SOURCES/d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch new file mode 100644 index 000000000..a5f436d33 --- /dev/null +++ b/SOURCES/d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch @@ -0,0 +1,66 @@ +From d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +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 +Cc: Alexander Gordeev +Cc: Alexandre Ghiti +Cc: Aneesh Kumar K.V +Cc: Catalin Marinas +Cc: Christian Borntraeger +Cc: Chris Zankel +Cc: Claudio Imbrenda +Cc: David Hildenbrand +Cc: "David S. Miller" +Cc: Geert Uytterhoeven +Cc: Greg Ungerer +Cc: Heiko Carstens +Cc: Helge Deller +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: John David Anglin +Cc: John Paul Adrian Glaubitz +Cc: Kirill A. Shutemov +Cc: Matthew Wilcox (Oracle) +Cc: Max Filippov +Cc: Michael Ellerman +Cc: Michal Simek +Cc: Mike Kravetz +Cc: Mike Rapoport (IBM) +Cc: Palmer Dabbelt +Cc: Peter Zijlstra +Cc: Qi Zheng +Cc: Russell King +Cc: Suren Baghdasaryan +Cc: Thomas Bogendoerfer +Cc: Thomas Gleixner +Cc: Will Deacon +Signed-off-by: Andrew Morton +--- + 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); + } diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index 0d1819f2d..82da6c597 100644 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -957,6 +957,7 @@ Patch1: patch-%{patchversion}-redhat.patch # AlmaLinux patches Patch100: eaaaed137eccb9e8f3a88f6297e214f53885196f.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 # 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 ApplyOptionalPatch eaaaed137eccb9e8f3a88f6297e214f53885196f.patch ApplyOptionalPatch Rename-mmu_notifier_seq-to-mmu_invalidate_seq-in-book3s_64_vio_hv.patch +ApplyOptionalPatch d00ae31fa2fc7ce5ed8d60b9fb10adb5c99a792b.patch ApplyOptionalPatch linux-kernel-test.patch