+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001
-From: Gaurav Batra <gbatra@linux.vnet.ibm.com>
-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 <gbatra@linux.vnet.ibm.com>
-
-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 <gbatra@linux.vnet.ibm.com>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001
-From: Gaurav Batra <gbatra@linux.vnet.ibm.com>
-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 <gbatra@linux.vnet.ibm.com>
-
-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 <gbatra@linux.vnet.ibm.com>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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
+++ /dev/null
-From 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Mon Sep 17 00:00:00 2001
-From: Gaurav Batra <gbatra@linux.vnet.ibm.com>
-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 <gbatra@linux.vnet.ibm.com>
-
-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 <gbatra@linux.vnet.ibm.com>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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
+++ /dev/null
-From 84bb41d5df48868055d159d9247b80927f1f70f9 Mon Sep 17 00:00:00 2001
-From: Heiko Carstens <hca@linux.ibm.com>
-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 <hca@linux.ibm.com>
-
-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: <stable@vger.kernel.org>
-Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
-Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- 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) {
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