Now that swiotlb remembers the allocation size there is no need to pass
it back to swiotlb_tbl_unmap_single.
Signed-off-by: Christoph Hellwig
---
drivers/iommu/dma-iommu.c | 11 +++---
drivers/xen/swiotlb-xen.c | 4 ++--
include/linux/swiotlb.h | 1 -
kernel/dma/direct.h | 2
Hi Konrad,
this series contains a bunch of swiotlb cleanups, mostly to reduce the
amount of internals exposed to code outside of swiotlb.c, which should
helper to prepare for supporting multiple different bounce buffer pools.
Changes since v1:
- rebased to v5.12-rc1
- a few more cleanups
-
Use the local variable that is passed to swiotlb_init_with_tbl for
freeing the memory in the failure case to isolate the code a little
better from swiotlb internals.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/pseries/svm.c | 6 +++---
1 file changed, 3 insertions(+), 3
: Andrew Morton
> Cc: Christoph Hellwig
> Cc: linux-i...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux...@kvack.org
> Cc: linux-ker...@vger.kernel.org
> Suggested-by: Christoph Hellwig
> Signed-off-by: Anshuman Khandual
> ---
> This change wa
On Fri, Feb 26, 2021 at 12:17:50PM +0800, Claire Chang wrote:
> Do you think I should fix this and rebase on the latest linux-next
> now? I wonder if there are more factor and clean up coming and I
> should wait after that.
Here is my preferred plan:
1) wait for my series to support the min
On Tue, Feb 09, 2021 at 02:21:18PM +0800, Claire Chang wrote:
> This can be dropped if Christoph's swiotlb cleanups are landed.
> https://lore.kernel.org/linux-iommu/20210207160934.2955931-1-...@lst.de/T/#m7124f29b6076d462101fcff6433295157621da09
>
FYI, I've also started looking into additional
Signed-off-by: Christoph Hellwig
---
drivers/xen/swiotlb-xen.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index b2d9e77059bf5a..621a20c1143597 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb
Split xen_swiotlb_init into a normal an an early case. That makes both
much simpler and more readable, and also allows marking the early
code as __init and x86-only.
Signed-off-by: Christoph Hellwig
---
arch/arm/xen/mm.c | 2 +-
arch/x86/xen/pci-swiotlb-xen.c | 4 +-
drivers
Use the is_swiotlb_buffer to check if a physical address is
a swiotlb buffer. This works because xen-swiotlb does use the
same buffer as the main swiotlb code, and xen_io_tlb_{start,end}
are just the addresses for it that went through phys_to_virt.
Signed-off-by: Christoph Hellwig
---
drivers
Lift the double initialization protection from xen-swiotlb to the core
code to avoid exposing too many swiotlb internals. Also upgrade the
check to a warning as it should not happen.
Signed-off-by: Christoph Hellwig
---
drivers/xen/swiotlb-xen.c | 7 ---
kernel/dma/swiotlb.c | 8
Use the existing variable that holds the physical address for
xen_io_tlb_end to simplify xen_swiotlb_dma_supported a bit, and remove
the otherwise unused xen_io_tlb_end variable and the xen_virt_to_bus
helper.
Signed-off-by: Christoph Hellwig
---
drivers/xen/swiotlb-xen.c | 10 ++
1
Use the local variable that is passed to swiotlb_init_with_tbl for
freeing the memory in the failure case to isolate the code a little
better from swiotlb internals.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/pseries/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
three lines in the caller.
Signed-off-by: Christoph Hellwig
---
drivers/xen/swiotlb-xen.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 4298f74a083985..57f8d5fadc1fcd 100644
--- a/drivers/xen
Hi Konrad,
this series contains a bunch of swiotlb cleanups, mostly to reduce the
amount of internals exposed to code outside of swiotlb.c, which should
helper to prepare for supporting multiple different bounce buffer pools.
The xen_io_tlb_start and xen_io_tlb_nslabs variables ar now only used in
xen_swiotlb_init, so replace them with local variables.
Signed-off-by: Christoph Hellwig
---
drivers/xen/swiotlb-xen.c | 57 +--
1 file changed, 25 insertions(+), 32 deletions(-)
diff
On Thu, Feb 04, 2021 at 09:40:23AM +0100, Christoph Hellwig wrote:
> So one thing that has been on my mind for a while: I'd really like
> to kill the separate dma ops in Xen swiotlb. If we compare xen-swiotlb
> to swiotlb the main difference seems to be:
>
> - additional reason
So one thing that has been on my mind for a while: I'd really like
to kill the separate dma ops in Xen swiotlb. If we compare xen-swiotlb
to swiotlb the main difference seems to be:
- additional reasons to bounce I/O vs the plain DMA capable
- the possibility to do a hypercall on arm/arm64
-
On Wed, Feb 03, 2021 at 03:37:05PM -0800, Dongli Zhang wrote:
> This patch converts several swiotlb related variables to arrays, in
> order to maintain stat/status for different swiotlb buffers. Here are
> variables involved:
>
> - io_tlb_start and io_tlb_end
> - io_tlb_nslabs and io_tlb_used
> -
On Wed, Feb 03, 2021 at 11:34:50AM +0100, Daniel Vetter wrote:
> On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote:
> > drm_fb_helper_modinit has a lot of boilerplate for what is not very
> > simple functionality. Just open code it in the only caller using
FYI, this is the updated version:
---
>From 664ca3378deac7530fe8fc15fe73d583ddf2 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig
Date: Wed, 20 Jan 2021 14:58:27 +0100
Subject: module: pass struct find_symbol_args to find_symbol
Simplify the calling convention by pass
On Tue, Feb 02, 2021 at 03:07:51PM +0100, Miroslav Benes wrote:
> > preempt_disable();
> > - sym = find_symbol(symbol, , NULL, NULL, true, true);
> > - if (sym && strong_try_module_get(owner))
> > - sym = NULL;
> > + if (!find_symbol() || !strong_try_module_get(fsa.owner)) {
>
On Tue, Feb 02, 2021 at 03:37:04PM +0100, Jessica Yu wrote:
> The patchset looks good so far. After Miroslav's comments are
> addressed, I'll wait an extra day or two in case there are more
> comments before queueing them onto modules-next. I can take the first
> two patches as well provided the
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the
unused functionality as we generally just remove unused code anyway.
Signed-off-by: Christoph Hellwig
---
arch/arm/configs/bcm2835_defconfig | 1 -
arch/arm/configs/mxs_defconfig | 1 -
arch/mips/configs
As far as I can tell this has never been used at all, and certainly
not any time recently.
Signed-off-by: Christoph Hellwig
---
arch/x86/tools/relocs.c | 4 ++--
include/asm-generic/vmlinux.lds.h | 14 --
include/linux/export.h| 1 -
include/linux/module.h
Simplify the calling convention by passing the find_symbol_args structure
to find_symbol instead of initializing it inside the function.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 113 ++--
1 file changed, 52 insertions(+), 61 deletions
struct symsearch is only used inside of module.h, so move the definition
out of module.h.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 11 ---
kernel/module.c| 11 +++
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux
each_symbol_section is only called by find_symbol, so merge the two
functions.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 148 ++--
1 file changed, 69 insertions(+), 79 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index
each_symbol_in_section just contains a trivial loop over its arguments.
Just open code the loop in the two callers.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 29 +++--
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/kernel/module.c b/kernel
Except for two lockdep asserts module_mutex is only used in module.c.
Remove the two asserts given that the functions they are in are not
exported and just called from the module code, and mark module_mutex
static.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 2 --
kernel
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used
by the livepatching code, so don't build them if livepatching is not
enabled.
Signed-off-by: Christoph Hellwig
---
include/linux/kallsyms.h | 17 -
include/linux/module.h | 16
kernel
for the livepatch code in that the symbols from vmlinux are not
iterated anymore if objname is set, but that actually is the desired
behavior in this case.
Signed-off-by: Christoph Hellwig
Acked-by: Miroslav Benes
---
kernel/kallsyms.c | 6 +-
kernel/livepatch/core.c | 2 --
kernel
Allow for a RCU-sched critical section around find_module, following
the lower level find_module_all helper, and switch the two callers
outside of module.c to use such a RCU-sched critical section instead
of module_mutex.
Signed-off-by: Christoph Hellwig
Reviewed-by: Petr Mladek
Acked
The static inline get_cxl_module function is entirely unused since commit
8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel
api on the real phb"), so remove it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andrew Donnellan
---
arch/powerpc/platforms/po
check either).
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/drm_crtc_helper_internal.h | 10 -
drivers/gpu/drm/drm_fb_helper.c| 21 --
drivers/gpu/drm/drm_kms_helper_common.c| 25 +++---
3 files changed, 12 insertions(+), 44
Hi all,
this series removes support for long term unused export types and
cleans up various loose ends in the module loader.
Changes since v2:
- clean up klp_find_object_symbol a bit
- remove the now unused module_assert_mutex helper
Changes since v1:
- move struct symsearch to module.c
-
find_module is not used by modular code any more, and random driver code
has no business calling it to start with.
Signed-off-by: Christoph Hellwig
Reviewed-by: Miroslav Benes
---
kernel/module.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index
--
>From 18af41e88d088cfb8680d1669fcae2bc2ede5328 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig
Date: Wed, 20 Jan 2021 16:23:16 +0100
Subject: kallsyms: refactor {,module_}kallsyms_on_each_symbol
Require an explicit call to module_kallsyms_on_each_symbol to look
for symbols in modules
On Fri, Jan 29, 2021 at 10:43:36AM +0100, Petr Mladek wrote:
> > --- a/kernel/livepatch/core.c
> > +++ b/kernel/livepatch/core.c
> > @@ -164,12 +164,8 @@ static int klp_find_object_symbol(const char *objname,
> > const char *name,
> > .pos = sympos,
> > };
> >
> > -
On Fri, Jan 29, 2021 at 04:29:02PM +0100, Miroslav Benes wrote:
> >
> > - mutex_lock(_mutex);
> > + rcu_read_lock_sched();
> > /*
> > * We do not want to block removal of patched modules and therefore
> > * we do not take a reference here. The patches are removed by
> > @@
On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote:
> > struct module *find_module(const char *name)
> > {
> > - module_assert_mutex();
>
> Does it make sense to replace the assert above with the warn below (untested)?
>
> RCU_LOCKDEP_WARN(rcu_read_lock_sched_held());
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the
unused functionality as we generally just remove unused code anyway.
Signed-off-by: Christoph Hellwig
---
arch/arm/configs/bcm2835_defconfig | 1 -
arch/arm/configs/mxs_defconfig | 1 -
arch/mips/configs
As far as I can tell this has never been used at all, and certainly
not any time recently.
Signed-off-by: Christoph Hellwig
---
arch/x86/tools/relocs.c | 4 ++--
include/asm-generic/vmlinux.lds.h | 14 --
include/linux/export.h| 1 -
include/linux/module.h
struct symsearch is only used inside of module.h, so move the definition
out of module.h.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 11 ---
kernel/module.c| 11 +++
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux
Simplify the calling convention by passing the find_symbol_args structure
to find_symbol instead of initializing it inside the function.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 113 ++--
1 file changed, 52 insertions(+), 61 deletions
Except for two lockdep asserts module_mutex is only used in module.c.
Remove the two asserts given that the functions they are in are not
exported and just called from the module code, and mark module_mutex
static.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 2 --
kernel
each_symbol_section is only called by find_symbol, so merge the two
functions.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 148 ++--
1 file changed, 69 insertions(+), 79 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index
each_symbol_in_section just contains a trivial loop over its arguments.
Just open code the loop in the two callers.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 29 +++--
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/kernel/module.c b/kernel
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used
by the livepatching code, so don't build them if livepatching is not
enabled.
Signed-off-by: Christoph Hellwig
---
include/linux/kallsyms.h | 17 -
include/linux/module.h | 16
kernel
Require an explicit call to module_kallsyms_on_each_symbol to look
for symbols in modules instead of the call from kallsyms_on_each_symbol,
and acquire module_mutex inside of module_kallsyms_on_each_symbol instead
of leaving that up to the caller.
Signed-off-by: Christoph Hellwig
---
kernel
find_module is not used by modular code any more, and random driver code
has no business calling it to start with.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 4bf30e4b3eaaa1..981302f616b411
Allow for a RCU-sched critical section around find_module, following
the lower level find_module_all helper, and switch the two callers
outside of module.c to use such a RCU-sched critical section instead
of module_mutex.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 2
check either).
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/drm_crtc_helper_internal.h | 10 -
drivers/gpu/drm/drm_fb_helper.c| 21 --
drivers/gpu/drm/drm_kms_helper_common.c| 25 +++---
3 files changed, 12 insertions(+), 44
Hi all,
this series removes support for long term unused export types and
cleans up various loose ends in the module loader.
Changes since v1:
- move struct symsearch to module.c
- rework drm to not call find_module at all
- llow RCU-sched locking for find_module
- keep find_module as a
The static inline get_cxl_module function is entirely unused since commit
8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel
api on the real phb"), so remove it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andrew Donnellan
---
arch/powerpc/platforms/po
On Thu, Jan 28, 2021 at 05:22:40PM +0100, Christoph Hellwig wrote:
> > We need to either update the function description or keep this check.
> >
> > I prefer to keep the check. The function does the right thing also
> > for the object "vmlinux". Also the livepa
On Wed, Jan 27, 2021 at 01:58:21PM +0100, Petr Mladek wrote:
> > --- a/kernel/livepatch/core.c
> > +++ b/kernel/livepatch/core.c
> > @@ -54,9 +54,6 @@ static void klp_find_object_module(struct klp_object *obj)
> > {
> > struct module *mod;
> >
> > - if (!klp_is_module(obj))
> > -
On Wed, Jan 27, 2021 at 02:49:38PM +0100, Jessica Yu wrote:
>> #ifdef CONFIG_MODULE_SIG
>> /* Signature was verified. */
>> bool sig_ok;
>> @@ -592,7 +580,6 @@ struct symsearch {
>> GPL_ONLY,
>> WILL_BE_GPL_ONLY,
>> } license;
>> -bool unused;
>> };
>
Looks good,
Reviewed-by: Christoph Hellwig
On Tue, Jan 26, 2021 at 02:54:02PM +1000, Nicholas Piggin wrote:
> iounmap will remove ptes.
Looks good,
Reviewed-by: Christoph Hellwig
On Sun, Jan 24, 2021 at 06:22:29PM +1000, Nicholas Piggin wrote:
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 24862d15f3a3..f87feb616184 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -724,6 +724,16 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
> config HAVE_ARCH_HUGE_VMAP
>
good,
Reviewed-by: Christoph Hellwig
On Sun, Jan 24, 2021 at 06:22:27PM +1000, Nicholas Piggin wrote:
> This is a generic kernel virtual memory mapper, not specific to ioremap.
Looks good:
Reviewed-by: Christoph Hellwig
Although it would be nice if you could fix up the > 80 lines while
you're at it.
> diff --git a/arch/arm64/include/asm/vmalloc.h
> b/arch/arm64/include/asm/vmalloc.h
> index 2ca708ab9b20..597b40405319 100644
> --- a/arch/arm64/include/asm/vmalloc.h
> +++ b/arch/arm64/include/asm/vmalloc.h
> @@ -1,4 +1,12 @@
> #ifndef _ASM_ARM64_VMALLOC_H
> #define _ASM_ARM64_VMALLOC_H
>
>
On Sun, Jan 24, 2021 at 06:22:22PM +1000, Nicholas Piggin wrote:
> This will be used as a generic kernel virtual mapping function, so
> re-name it in preparation.
The new name looks ok, but shouldn't it also move to vmalloc.c with
the more generic name and purpose?
On Sun, Jan 24, 2021 at 06:22:21PM +1000, Nicholas Piggin wrote:
> The vmalloc mapper operates on a struct page * array rather than a
> linear physical address, re-name it to make this distinction clear.
>
> Signed-off-by: Nicholas Piggin
Looks good,
Reviewed-by: Christoph Hellwig
On Sun, Jan 24, 2021 at 06:22:20PM +1000, Nicholas Piggin wrote:
> apply_to_pte_range might mistake a large pte for bad, or treat it as a
> page table, resulting in a crash or corruption. Add a test to warn and
> return error if large entries are found.
Looks good,
Reviewed-by: Christoph Hellwig
ble instead of fix would be better in the subject line?
Otherwise this looks good:
Reviewed-by: Christoph Hellwig
On Thu, Jan 21, 2021 at 11:00:20AM +0100, Christophe Leroy wrote:
> > +bool module_loaded(const char *name);
>
> Maybe module_is_loaded() would be a better name.
Fine with me.
On Thu, Jan 21, 2021 at 09:25:40AM +0100, Daniel Vetter wrote:
> On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote:
> >
> > drm_fb_helper_modinit has a lot of boilerplate for what is not very
> > simple functionality. Just open code it in the only caller using
> &g
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the
unused functionality as we generally just remove unused code anyway.
Signed-off-by: Christoph Hellwig
---
arch/arm/configs/bcm2835_defconfig | 1 -
arch/arm/configs/mxs_defconfig | 1 -
arch/mips/configs
As far as I can tell this has never been used at all, and certainly
not any time recently.
Signed-off-by: Christoph Hellwig
---
arch/x86/tools/relocs.c | 4 ++--
include/asm-generic/vmlinux.lds.h | 14 --
include/linux/export.h| 1 -
include/linux/module.h
Simplify the calling convention by passing the find_symbol_args structure
to find_symbol instead of initializing it inside the function.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 113 ++--
1 file changed, 52 insertions(+), 61 deletions
each_symbol_section is only called by find_symbol, so merge the two
functions.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 148 ++--
1 file changed, 69 insertions(+), 79 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index
each_symbol_in_section just contains a trivial loop over its arguments.
Just open code the loop in the two callers.
Signed-off-by: Christoph Hellwig
---
kernel/module.c | 29 +++--
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/kernel/module.c b/kernel
drm_fb_helper_modinit has a lot of boilerplate for what is not very
simple functionality. Just open code it in the only caller using
IS_ENABLED and IS_MODULE.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/drm_crtc_helper_internal.h | 10 -
drivers/gpu/drm/drm_fb_helper.c
Except for two lockdep asserts module_mutex is only used in module.c.
Remove the two asserts given that the functions they are in are not
exported and just called from the module code, and mark module_mutex
static.
Signed-off-by: Christoph Hellwig
---
include/linux/module.h | 2 --
kernel
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used
by the livepatching code, so don't build them if livepatching is not
enabled.
Signed-off-by: Christoph Hellwig
---
include/linux/kallsyms.h | 17 -
include/linux/module.h | 16
kernel
Require an explicit cll to module_kallsyms_on_each_symbol to look
for symbols in modules instead of the call from kallsyms_on_each_symbol,
and acquire module_mutex inside of module_kallsyms_on_each_symbol instead
of leaving that up to the caller.
Signed-off-by: Christoph Hellwig
---
kernel
To uncouple the livepatch code from module loader internals move a
slightly refactored version of klp_find_object_module to module.c
This allows to mark find_module static and removes one of the last
users of module_mutex outside of module.c.
Signed-off-by: Christoph Hellwig
---
include/linux
Merge three calls to klp_is_module (including one hidden inside
klp_find_object_module) into a single one to simplify the code a bit.
Signed-off-by: Christoph Hellwig
---
kernel/livepatch/core.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/kernel
Add a helper that takes modules_mutex and uses find_module to check if a
given module is loaded. This provides a better abstraction for the two
callers, and allows to unexport modules_mutex and find_module.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/drm_fb_helper.c | 7
The static inline get_cxl_module function is entirely unused,
remove it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/platforms/powernv/pci-cxl.c | 22 --
1 file changed, 22 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-cxl.c
b/arch/powerpc/platforms
Hi all,
this series removes support for long term unused export types and
cleans up various loose ends in the module loader.
Diffstat:
arch/arm/configs/bcm2835_defconfig |1
arch/arm/configs/mxs_defconfig |1
arch/mips/configs/nlm_xlp_defconfig |1
On Wed, Jan 13, 2021 at 06:27:08PM +, Robin Murphy wrote:
>> Can we hook in somewhat lower level in the dma-direct code so that all
>> the remapping in dma-direct can be reused instead of duplicated? That
>> also becomes important if we want to use non-remapping uncached support,
>> e.g. on
> +#ifdef CONFIG_SWIOTLB
> + if (unlikely(dev->dma_io_tlb_mem))
> + return swiotlb_alloc(dev, size, dma_handle, attrs);
> +#endif
Another place where the dma_io_tlb_mem is useful to avoid the ifdef.
> -phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t
>
> +#ifdef CONFIG_SWIOTLB
> + if (unlikely(swiotlb_force == SWIOTLB_FORCE) || dev->dma_io_tlb_mem)
> return swiotlb_map(dev, phys, size, dir, attrs);
> +#endif
Please provide a wrapper for the dev->dma_io_tlb_mem check that
always returns false if the per-device swiotlb support
> +#ifdef CONFIG_SWIOTLB
> + struct io_tlb_mem *dma_io_tlb_mem;
> #endif
Please add a new config option for this code instead of always building
it when swiotlb is enabled.
> +static int swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
> +
On Wed, Jan 13, 2021 at 01:29:05PM +0100, Greg KH wrote:
> > > Why does this have to be added here? Shouldn't the platform-specific
> > > code handle it instead?
> >
> > The whole code added here is pretty generic. What we need to eventually
> > do, though is to add a separate dma_device
On Wed, Jan 06, 2021 at 08:50:03AM +0100, Greg KH wrote:
> > --- a/include/linux/device.h
> > +++ b/include/linux/device.h
> > @@ -413,6 +413,7 @@ struct dev_links_info {
> > * @dma_pools: Dma pools (if dma'ble device).
> > * @dma_mem: Internal for coherent mem override.
> > *
On Wed, Jan 06, 2021 at 11:41:19AM +0800, Claire Chang wrote:
> Added a new struct, io_tlb_mem, as the IO TLB memory pool descriptor and
> moved relevant global variables into that struct.
> This will be useful later to allow for restricted DMA pool.
I like where this is going, but a few
Yes, I think at this point in the release cycle the specific powerpc
fix is safer anyway. But this screams for an eventual general solution.
that copy_from_kernel_nofault() will return -ERANGE.
Looks good. I wonder if we should just default to the TASK_SIZE_MAX
check in copy_from_kernel_nofault_allowed for architectures that select
CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE?
>
> Reported-by: Qian Cai
> Fixes: c33165253492 (&q
You probably want to add Jason for an audit of new notifier uses.
On Fri, Nov 20, 2020 at 06:32:40PM +0100, Christophe Lombard wrote:
> Add invalidate_range mmu notifier, when required (ATSD access of MMIO
> registers is available), to initiate TLB invalidation commands.
> For the time being, the
On Thu, Oct 29, 2020 at 12:52:41PM +1100, Alexey Kardashevskiy wrote:
> +EXPORT_SYMBOL_GPL(arch_dma_map_page_direct);
I've dropped the unused exports and applied the series to dma-mapping-for-next.
On Wed, Nov 11, 2020 at 07:04:37PM -0600, Tyrel Datwyler wrote:
> Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve
> values from vhost->login_buf.resp buffer. This is the MAD response
> buffer from the VIOS and as such any multi-byte non-string values are in
> big endian
On Thu, Oct 29, 2020 at 11:18:06PM +0100, Thomas Gleixner wrote:
> This is achieved by:
...
>
> - Consolidating all kmap atomic implementations in generic code
...
> Though I wanted to share the current state of affairs before investigating
> that further. If there is consensus in going
On Wed, Oct 28, 2020 at 06:00:29PM +1100, Alexey Kardashevskiy wrote:
> At the moment we allow bypassing DMA ops only when we can do this for
> the entire RAM. However there are configs with mixed type memory
> where we could still allow bypassing IOMMU in most cases;
> POWERPC with persistent
On Wed, Oct 28, 2020 at 05:55:23PM +1100, Alexey Kardashevskiy wrote:
>
> It is passing an address of the end of the mapped area so passing a page
> struct means passing page and offset which is an extra parameter and we do
> not want to do anything with the page in those hooks anyway so I'd
> +static inline bool dma_handle_direct(struct device *dev, dma_addr_t
> dma_handle)
> +{
> + return dma_handle >= dev->archdata.dma_offset;
> +}
This won't compile except for powerpc, and directly accesing arch members
in common code is a bad idea. Maybe both your helpers need to be
On Wed, Oct 21, 2020 at 02:20:24PM +1100, Alexey Kardashevskiy wrote:
> This allows mixing direct DMA (to/from RAM) and
> IOMMU (to/from apersistent memory) on the PPC64/pseries
> platform. This was supposed to be a single patch but
> unexpected move of direct DMA functions happened.
>
> This is
601 - 700 of 2607 matches
Mail list logo