From ed4c9e1ab7538665803caf42c6f5a803cea6e935 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 26 Nov 2023 15:41:16 +0000 Subject: [PATCH] drop some broken s390 and powerpc patches --- ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-4.19/series | 1 - ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-5.10/series | 1 - ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-5.15/series | 1 - ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-5.4/series | 1 - ...rns-direct-mapping-for-sr-iov-device.patch | 68 ------------------- ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-6.1/series | 2 - ...rns-direct-mapping-for-sr-iov-device.patch | 68 ------------------- ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-6.5/series | 2 - ...rns-direct-mapping-for-sr-iov-device.patch | 68 ------------------- ...of-swapper_pg_dir-and-invalid_pg_dir.patch | 45 ------------ queue-6.6/series | 2 - 17 files changed, 529 deletions(-) delete mode 100644 queue-4.19/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-5.10/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-5.15/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-5.4/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-6.1/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch delete mode 100644 queue-6.1/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-6.5/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch delete mode 100644 queue-6.5/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch delete mode 100644 queue-6.6/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch delete mode 100644 queue-6.6/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch diff --git a/queue-4.19/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-4.19/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index 8cbc7fa608d..00000000000 --- a/queue-4.19/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -197,6 +197,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_memblock(memory, reg) { diff --git a/queue-4.19/series b/queue-4.19/series index d71e3ccee69..390cb5c073e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -65,7 +65,6 @@ jbd2-fix-potential-data-lost-in-recovering-journal-raced-with-synchronizing-fs-b quota-explicitly-forbid-quota-files-from-being-encrypted.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch parisc-pgtable-do-not-drop-upper-5-address-bits-of-physical-address.patch alsa-info-fix-potential-deadlock-at-disconnection.patch diff --git a/queue-5.10/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-5.10/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index d11c626fd08..00000000000 --- a/queue-5.10/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -191,6 +191,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { diff --git a/queue-5.10/series b/queue-5.10/series index c07bfb85200..4662bfdb2cc 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -131,7 +131,6 @@ kernel-reboot-emergency_restart-set-correct-system_state.patch i2c-core-run-atomic-i2c-xfer-when-preemptible.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch mtd-cfi_cmdset_0001-byte-swap-otp-info.patch diff --git a/queue-5.15/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-5.15/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index d11c626fd08..00000000000 --- a/queue-5.15/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -191,6 +191,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { diff --git a/queue-5.15/series b/queue-5.15/series index 30472471d5e..9eee137f6d4 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -216,7 +216,6 @@ tracing-have-the-user-copy-of-synthetic-event-address-use-correct-context.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch s390-cmma-fix-detection-of-dat-pages.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch mtd-cfi_cmdset_0001-byte-swap-otp-info.patch diff --git a/queue-5.4/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-5.4/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index 352a2e012e2..00000000000 --- a/queue-5.4/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -191,6 +191,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_memblock(memory, reg) { diff --git a/queue-5.4/series b/queue-5.4/series index 128bceb2605..809dcb6e82e 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -90,7 +90,6 @@ kernel-reboot-emergency_restart-set-correct-system_state.patch i2c-core-run-atomic-i2c-xfer-when-preemptible.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch i3c-master-cdns-fix-reading-status-register.patch parisc-prevent-booting-64-bit-kernels-on-pa1.x-machines.patch diff --git a/queue-6.1/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch b/queue-6.1/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch deleted file mode 100644 index 9542e7d3a57..00000000000 --- a/queue-6.1/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001 -From: Gaurav Batra -Date: Mon, 2 Oct 2023 22:08:02 -0500 -Subject: powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device - -From: Gaurav Batra - -commit 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e upstream. - -When a device is initialized, the driver invokes dma_supported() twice - -first for streaming mappings followed by coherent mappings. For an -SR-IOV device, default window is deleted and DDW created. With vPMEM -enabled, TCE mappings are dynamically created for both vPMEM and SR-IOV -device. There are no direct mappings. - -First time when dma_supported() is called with 64 bit mask, DDW is created -and marked as dynamic window. The second time dma_supported() is called, -enable_ddw() finds existing window for the device and incorrectly returns -it as "direct mapping". - -This only happens when size of DDW is big enough to map max LPAR memory. - -This results in streaming TCEs to not get dynamically mapped, since code -incorrently assumes these are already pre-mapped. The adapter initially -comes up but goes down due to EEH. - -Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") -Cc: stable@vger.kernel.org # v5.15+ -Signed-off-by: Gaurav Batra -Signed-off-by: Michael Ellerman -Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/platforms/pseries/iommu.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/arch/powerpc/platforms/pseries/iommu.c -+++ b/arch/powerpc/platforms/pseries/iommu.c -@@ -909,7 +909,8 @@ static int remove_ddw(struct device_node - return 0; - } - --static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift) -+static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift, -+ bool *direct_mapping) - { - struct dma_win *window; - const struct dynamic_dma_window_prop *dma64; -@@ -922,6 +923,7 @@ static bool find_existing_ddw(struct dev - dma64 = window->prop; - *dma_addr = be64_to_cpu(dma64->dma_base); - *window_shift = be32_to_cpu(dma64->window_shift); -+ *direct_mapping = window->direct; - found = true; - break; - } -@@ -1275,10 +1277,8 @@ static bool enable_ddw(struct pci_dev *d - - mutex_lock(&dma_win_init_mutex); - -- if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) { -- direct_mapping = (len >= max_ram_len); -+ if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping)) - goto out_unlock; -- } - - /* - * If we already went through this for a previous function of diff --git a/queue-6.1/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-6.1/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index becb86da2b4..00000000000 --- a/queue-6.1/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -192,6 +192,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { diff --git a/queue-6.1/series b/queue-6.1/series index 7bee0e01b77..cc1c1d551a1 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -243,10 +243,8 @@ i2c-core-run-atomic-i2c-xfer-when-preemptible.patch tracing-have-the-user-copy-of-synthetic-event-address-use-correct-context.patch driver-core-release-all-resources-during-unbind-before-updating-device-links.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch -powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch s390-cmma-fix-detection-of-dat-pages.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch mtd-cfi_cmdset_0001-byte-swap-otp-info.patch diff --git a/queue-6.5/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch b/queue-6.5/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch deleted file mode 100644 index b01973103ed..00000000000 --- a/queue-6.5/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001 -From: Gaurav Batra -Date: Mon, 2 Oct 2023 22:08:02 -0500 -Subject: powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device - -From: Gaurav Batra - -commit 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e upstream. - -When a device is initialized, the driver invokes dma_supported() twice - -first for streaming mappings followed by coherent mappings. For an -SR-IOV device, default window is deleted and DDW created. With vPMEM -enabled, TCE mappings are dynamically created for both vPMEM and SR-IOV -device. There are no direct mappings. - -First time when dma_supported() is called with 64 bit mask, DDW is created -and marked as dynamic window. The second time dma_supported() is called, -enable_ddw() finds existing window for the device and incorrectly returns -it as "direct mapping". - -This only happens when size of DDW is big enough to map max LPAR memory. - -This results in streaming TCEs to not get dynamically mapped, since code -incorrently assumes these are already pre-mapped. The adapter initially -comes up but goes down due to EEH. - -Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") -Cc: stable@vger.kernel.org # v5.15+ -Signed-off-by: Gaurav Batra -Signed-off-by: Michael Ellerman -Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/platforms/pseries/iommu.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/arch/powerpc/platforms/pseries/iommu.c -+++ b/arch/powerpc/platforms/pseries/iommu.c -@@ -916,7 +916,8 @@ static int remove_ddw(struct device_node - return 0; - } - --static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift) -+static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift, -+ bool *direct_mapping) - { - struct dma_win *window; - const struct dynamic_dma_window_prop *dma64; -@@ -929,6 +930,7 @@ static bool find_existing_ddw(struct dev - dma64 = window->prop; - *dma_addr = be64_to_cpu(dma64->dma_base); - *window_shift = be32_to_cpu(dma64->window_shift); -+ *direct_mapping = window->direct; - found = true; - break; - } -@@ -1272,10 +1274,8 @@ static bool enable_ddw(struct pci_dev *d - - mutex_lock(&dma_win_init_mutex); - -- if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) { -- direct_mapping = (len >= max_ram_len); -+ if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping)) - goto out_unlock; -- } - - /* - * If we already went through this for a previous function of diff --git a/queue-6.5/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-6.5/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index 45794b10648..00000000000 --- a/queue-6.5/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -181,6 +181,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { diff --git a/queue-6.5/series b/queue-6.5/series index 4b6fdf1b85a..c5932e72e74 100644 --- a/queue-6.5/series +++ b/queue-6.5/series @@ -340,11 +340,9 @@ selftests-clone3-fix-broken-test-under-config_time_ns.patch tracing-have-the-user-copy-of-synthetic-event-address-use-correct-context.patch driver-core-release-all-resources-during-unbind-before-updating-device-links.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch -powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch s390-mm-add-missing-arch_set_page_dat-call-to-vmem_crst_alloc.patch s390-cmma-fix-detection-of-dat-pages.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch mm-make-pr_mdwe_refuse_exec_gain-an-unsigned-long.patch diff --git a/queue-6.6/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch b/queue-6.6/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch deleted file mode 100644 index c1ba9965682..00000000000 --- a/queue-6.6/powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001 -From: Gaurav Batra -Date: Mon, 2 Oct 2023 22:08:02 -0500 -Subject: powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device - -From: Gaurav Batra - -commit 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e upstream. - -When a device is initialized, the driver invokes dma_supported() twice - -first for streaming mappings followed by coherent mappings. For an -SR-IOV device, default window is deleted and DDW created. With vPMEM -enabled, TCE mappings are dynamically created for both vPMEM and SR-IOV -device. There are no direct mappings. - -First time when dma_supported() is called with 64 bit mask, DDW is created -and marked as dynamic window. The second time dma_supported() is called, -enable_ddw() finds existing window for the device and incorrectly returns -it as "direct mapping". - -This only happens when size of DDW is big enough to map max LPAR memory. - -This results in streaming TCEs to not get dynamically mapped, since code -incorrently assumes these are already pre-mapped. The adapter initially -comes up but goes down due to EEH. - -Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") -Cc: stable@vger.kernel.org # v5.15+ -Signed-off-by: Gaurav Batra -Signed-off-by: Michael Ellerman -Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/platforms/pseries/iommu.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/arch/powerpc/platforms/pseries/iommu.c -+++ b/arch/powerpc/platforms/pseries/iommu.c -@@ -914,7 +914,8 @@ static int remove_ddw(struct device_node - return 0; - } - --static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift) -+static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift, -+ bool *direct_mapping) - { - struct dma_win *window; - const struct dynamic_dma_window_prop *dma64; -@@ -927,6 +928,7 @@ static bool find_existing_ddw(struct dev - dma64 = window->prop; - *dma_addr = be64_to_cpu(dma64->dma_base); - *window_shift = be32_to_cpu(dma64->window_shift); -+ *direct_mapping = window->direct; - found = true; - break; - } -@@ -1270,10 +1272,8 @@ static bool enable_ddw(struct pci_dev *d - - mutex_lock(&dma_win_init_mutex); - -- if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) { -- direct_mapping = (len >= max_ram_len); -+ if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping)) - goto out_unlock; -- } - - /* - * If we already went through this for a previous function of diff --git a/queue-6.6/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch b/queue-6.6/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch deleted file mode 100644 index 45794b10648..00000000000 --- a/queue-6.6/s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001 -From: Heiko Carstens -Date: Tue, 24 Oct 2023 10:15:20 +0200 -Subject: s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir - -From: Heiko Carstens - -commit 84bb41d5df48868055d159d9247b80927f1f70f9 upstream. - -If the cmma no-dat feature is available the kernel page tables are walked -to identify and mark all pages which are used for address translation (all -region, segment, and page tables). In a subsequent loop all other pages are -marked as "no-dat" pages with the ESSA instruction. - -This information is visible to the hypervisor, so that the hypervisor can -optimize purging of guest TLB entries. All pages used for swapper_pg_dir -and invalid_pg_dir are incorrectly marked as no-dat, which in turn can -result in incorrect guest TLB flushes. - -Fix this by marking those pages correctly as being used for DAT. - -Cc: -Reviewed-by: Claudio Imbrenda -Signed-off-by: Heiko Carstens -Signed-off-by: Vasily Gorbik -Signed-off-by: Greg Kroah-Hartman ---- - arch/s390/mm/page-states.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/s390/mm/page-states.c -+++ b/arch/s390/mm/page-states.c -@@ -181,6 +181,12 @@ void __init cmma_init_nodat(void) - return; - /* Mark pages used in kernel page tables */ - mark_kernel_pgd(); -+ page = virt_to_page(&swapper_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); -+ page = virt_to_page(&invalid_pg_dir); -+ for (i = 0; i < 4; i++) -+ set_bit(PG_arch_1, &page[i].flags); - - /* Set all kernel pages not used for page tables to stable/no-dat */ - for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) { diff --git a/queue-6.6/series b/queue-6.6/series index 12cd03282e9..6b64ee83199 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -368,12 +368,10 @@ selftests-clone3-fix-broken-test-under-config_time_ns.patch tracing-have-the-user-copy-of-synthetic-event-address-use-correct-context.patch driver-core-release-all-resources-during-unbind-before-updating-device-links.patch mcb-fix-error-handling-for-different-scenarios-when-parsing.patch -powerpc-pseries-iommu-enable_ddw-incorrectly-returns-direct-mapping-for-sr-iov-device.patch dmaengine-stm32-mdma-correct-desc-prep-when-channel-running.patch s390-mm-add-missing-arch_set_page_dat-call-to-vmem_crst_alloc.patch s390-mm-add-missing-arch_set_page_dat-call-to-gmap-allocations.patch s390-cmma-fix-detection-of-dat-pages.patch -s390-cmma-fix-handling-of-swapper_pg_dir-and-invalid_pg_dir.patch mm-cma-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-hugetlb-use-nth_page-in-place-of-direct-struct-page-manipulation.patch mm-memory_hotplug-use-pfn-math-in-place-of-direct-struct-page-manipulation.patch -- 2.47.3