[PATCH 10/11] swiotlb: merge swiotlb-xen initialization into swiotlb

2022-02-22 Thread Christoph Hellwig
Allow to pass a remap argument to the swiotlb initialization functions to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping from xen_swiotlb_fixup, so we don't even need that quirk. Signed-off-by: Christoph Hellwig --- arch/arm/xen/mm.c | 23 +++--- arch/x86/includ

[PATCH 11/11] x86: remove cruft from

2022-02-22 Thread Christoph Hellwig
gets pulled in by all drivers using the DMA API. Remove x86 internal variables and unnecessary includes from it. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/dma-mapping.h | 11 --- arch/x86/include/asm/iommu.h | 2 ++ 2 files changed, 2 insertions(+), 11 deletions(-

[PATCH 08/11] swiotlb: make the swiotlb_init interface more useful

2022-02-22 Thread Christoph Hellwig
Pass a bool to pass if swiotlb needs to be enabled based on the addressing needs and replace the verbose argument with a set of flags, including one to force enable bounce buffering. Note that this patch removes the possibility to force xen-swiotlb use using swiotlb=force on the command line on x8

Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-22 Thread Thomas Bogendoerfer
On Mon, Feb 21, 2022 at 03:31:23PM +0100, Arnd Bergmann wrote: > I'll update it this way, otherwise I'd need help in form of a patch > that changes the exception handling so __get_user/__put_user > also return -EFAULT for an address error. https://lore.kernel.org/all/20220222155345.138861-1-tsbog.

Re: [PATCH v5 1/6] module: Always have struct mod_tree_root

2022-02-22 Thread Aaron Tomlin
On Tue 2022-02-22 16:00 +0100, Christophe Leroy wrote: > In order to separate text and data, we need to setup > two rb trees. > > This means that struct mod_tree_root is required even without > MODULES_TREE_LOOKUP. > > Signed-off-by: Christophe Leroy > --- > kernel/module/internal.h | 4 +++- >

[PATCH] powerpc: Fix missing declaration of [en/dis]able_kernel_altivec()

2022-02-22 Thread Magali Lemes
When CONFIG_PPC64 is set and CONFIG_ALTIVEC is not the following build failures occur: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c: In function 'dc_fpu_begin': >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:61:17: error: >> implicit declaration of function 'enable_ke

Re: [PATCH V5 09/21] riscv: compat: Add basic compat data type implementation

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:33 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Implement riscv asm/compat.h for struct compat_xxx, is_compat_task, compat_user_regset, regset convert. The rv64 compat.h has inherited most of the structs from the generic one. Signed-off-by: Guo Ren Signed-off

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:41 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Reconstruct __setup_additional_pages() by appending vdso info pointer argument to meet compat_vdso_info requirement. And change vm_special_mapping *dm, *cm initialization into static. Signed-off-by: Guo Ren Signe

Re: [PATCH V5 13/21] riscv: compat: process: Add UXL_32 support in start_thread

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:37 PST (-0800), guo...@kernel.org wrote: From: Guo Ren If the current task is in COMPAT mode, set SR_UXL_32 in status for returning userspace. We need CONFIG _COMPAT to prevent compiling errors with rv32 defconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: A

Re: [PATCH V5 12/21] riscv: compat: syscall: Add entry.S implementation

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:36 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Implement the entry of compat_sys_call_table[] in asm. Ref to riscv-privileged spec 4.1.1 Supervisor Status Register (sstatus): BIT[32:33] = UXL[1:0]: - 1:32 - 2:64 - 3:128 Signed-off-by: Guo Ren Signed-off-

Re: [PATCH V5 16/21] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:40 PST (-0800), guo...@kernel.org wrote: From: Guo Ren There is no vgettimeofday supported in rv32 that makes simple to generate rv32 vdso code which only needs riscv64 compiler. Other architectures need change compiler or -m (machine parameter) to support vdso32 compi

Re: [PATCH V5 18/21] riscv: compat: signal: Add rt_frame implementation

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:42 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Implement compat_setup_rt_frame for sigcontext save & restore. The main process is the same with signal, but the rv32 pt_regs' size is different from rv64's, so we needs convert them. It's kind of ugly to have tw

Re: [PATCH V5 19/21] riscv: compat: ptrace: Add compat_arch_ptrace implement

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:43 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Now, you can use native gdb on riscv64 for rv32 app debugging. $ uname -a Linux buildroot 5.16.0-rc4-00036-gbef6b82fdf23-dirty #53 SMP Mon Dec 20 23:06:53 CST 2021 riscv64 GNU/Linux $ cat /proc/cpuinfo processor

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:45 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Current riscv doesn't support the 32bit KVM API. Let's make it clear by not selecting KVM_COMPAT. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann Cc: Anup Patel --- virt/kvm/Kconfig | 2 +- 1

Re: [PATCH V5 00/21] riscv: compat: Add COMPAT mode support for rv64

2022-02-22 Thread Palmer Dabbelt
On Tue, 01 Feb 2022 07:05:24 PST (-0800), guo...@kernel.org wrote: From: Guo Ren Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, s390, mips, sparc) have supported COMPAT mode. But they all have history issues and can't use standard linux unistd.h. RISC-V would be first standa

[PATCH] powerpc/code-patching: Pre-map patch area

2022-02-22 Thread Michael Ellerman
Paul reported a warning with DEBUG_ATOMIC_SLEEP=y: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 1, name: swapper/0 preempt_count: 0, expected: 0 ... Call Trace: dump_stack_lvl+0xa0/0xec (unr

Re: [PATCH v3 1/2] crypto: vmx - merge CRYPTO_DEV_VMX_ENCRYPT into CRYPTO_DEV_VMX

2022-02-22 Thread Herbert Xu
On Thu, Feb 17, 2022 at 11:57:50AM +0100, Petr Vorel wrote: > CRYPTO_DEV_VMX_ENCRYPT is redundant with CRYPTO_DEV_VMX. > > And it also forces CRYPTO_GHASH to be builtin even > CRYPTO_DEV_VMX_ENCRYPT was configured as module. Just because a tristate sits under a bool, it does not force the options

Re: [PATCH v3 2/2] crypto: vmx - add missing dependencies

2022-02-22 Thread Herbert Xu
On Thu, Feb 17, 2022 at 11:57:51AM +0100, Petr Vorel wrote: > vmx-crypto module depends on CRYPTO_AES, CRYPTO_CBC, CRYPTO_CTR or > CRYPTO_XTS, thus add them. > > These dependencies are likely to be enabled, but if > CRYPTO_DEV_VMX=y && !CRYPTO_MANAGER_DISABLE_TESTS > and either of CRYPTO_AES, CRYP

[PATCH v6 2/5] mm: page_isolation: check specified range for unmovable pages

2022-02-22 Thread Zi Yan
From: Zi Yan Enable set_migratetype_isolate() to check specified sub-range for unmovable pages during isolation. Page isolation is done at max(MAX_ORDER_NR_PAEGS, pageblock_nr_pages) granularity, but not all pages within that granularity are intended to be isolated. For example, alloc_contig_rang

[PATCH v6 0/5] Use pageblock_order for cma and alloc_contig_range alignment.

2022-02-22 Thread Zi Yan
From: Zi Yan Hi all, This patchset tries to remove the MAX_ORDER-1 alignment requirement for CMA and alloc_contig_range(). It prepares for my upcoming changes to make MAX_ORDER adjustable at boot time[1]. It is on top of mmotm-2022-02-14-17-46. Changelog === V6 --- 1. Resolved compilation error

[PATCH v6 4/5] mm: cma: use pageblock_order as the single alignment

2022-02-22 Thread Zi Yan
From: Zi Yan Now alloc_contig_range() works at pageblock granularity. Change CMA allocation, which uses alloc_contig_range(), to use pageblock_order alignment. Signed-off-by: Zi Yan --- include/linux/cma.h| 4 ++-- include/linux/mmzone.h | 5 + mm/page_alloc.c| 4 ++-- 3 files

[PATCH v6 1/5] mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c

2022-02-22 Thread Zi Yan
From: Zi Yan has_unmovable_pages() is only used in mm/page_isolation.c. Move it from mm/page_alloc.c and make it static. Signed-off-by: Zi Yan Reviewed-by: Oscar Salvador Reviewed-by: Mike Rapoport --- include/linux/page-isolation.h | 2 - mm/page_alloc.c| 119 -

[PATCH v6 3/5] mm: make alloc_contig_range work at pageblock granularity

2022-02-22 Thread Zi Yan
From: Zi Yan alloc_contig_range() worked at MAX_ORDER-1 granularity to avoid merging pageblocks with different migratetypes. It might unnecessarily convert extra pageblocks at the beginning and at the end of the range. Change alloc_contig_range() to work at pageblock granularity. Special handlin

[PATCH v6 5/5] drivers: virtio_mem: use pageblock size as the minimum virtio_mem size.

2022-02-22 Thread Zi Yan
From: Zi Yan alloc_contig_range() now only needs to be aligned to pageblock_order, drop virtio_mem size requirement that it needs to be the max of pageblock_order and MAX_ORDER. Signed-off-by: Zi Yan --- drivers/virtio/virtio_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) d

Re: [PATCH v4 0/3] KVM: PPC: Book3S PR: Fixes for AIL and SCV

2022-02-22 Thread Nicholas Piggin
Excerpts from Paolo Bonzini's message of February 23, 2022 12:11 am: > On 2/22/22 07:47, Nicholas Piggin wrote: >> Patch 3 requires a KVM_CAP_PPC number allocated. QEMU maintainers are >> happy with it (link in changelog) just waiting on KVM upstreaming. Do >> you have objections to the series goin

Re: [PATCH] powerpc/64s: Don't use DSISR for SLB faults

2022-02-22 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of February 22, 2022 9:34 pm: > Since commit 46ddcb3950a2 ("powerpc/mm: Show if a bad page fault on data > is read or write.") we use page_fault_is_write(regs->dsisr) in > __bad_page_fault() to determine if the fault is for a read or write, and > change the

Re: [PATCH v4 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 5:55 am: > > The kernel sets the VAS window with PID when it is opened in > the hypervisor. During DLPAR operation, windows can be closed and > reopened in the hypervisor when the credit is available. So saves > this PID in pseries_vas_wind

Re: [PATCH v4 3/9] powerpc/vas: Add paste address mmap fault handler

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 5:55 am: > > The user space opens VAS windows and issues NX requests by pasting > CRB on the corresponding paste address mmap. When the system lost > credits due to core removal, the kernel has to close the window in > the hypervisor and ma

Re: [PATCH v4 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 5:58 am: > > The VAS window may not be active if the system looses credits and > the NX generates page fault when it receives request on unmap > paste address. > > The kernel handles the fault by remap new paste address if the > window is

Re: [PATCH v4 5/9] powerpc/vas: Map paste address only if window is active

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 5:59 am: > > The paste address mapping is done with mmap() after the window is > opened with ioctl. If the window is closed by OS in the hypervisor > due to DLPAR after this mmap(), the paste instruction returns I don't think the changelog

Re: [PATCH v4 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:00 am: > > The hypervisor assigns vas credits (windows) for each LPAR based > on the number of cores configured in that system. The OS is > expected to release credits when cores are removed, and may > allocate more when cores are added.

Re: [PATCH v4 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:01 am: > > VAS windows can be closed in the hypervisor due to lost credits > when the core is removed and the kernel gets fault for NX > requests on these in-active windows. If these credits are > available later for core add, reopen thes

Re: [PATCH v4 8/9] powerpc/pseries/vas: sysfs interface to export capabilities

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:01 am: > > The hypervisor provides the available VAS GZIP capabilities such > as default or QoS window type and the target available credits in > each type. This patch creates sysfs entries and exports the target, > used and the available

Re: [PATCH v4 9/9] powerpc/pseries/vas: Write 'nr_total_credits' for QoS credits change

2022-02-22 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of February 20, 2022 6:03 am: > > pseries supports two types of credits - Default (uses normal priority > FIFO) and Qality of service (QoS uses high priority FIFO). The user > decides the number of QoS credits and sets this value with HMC > interface. With the

Re: [PATCH v2 09/18] mips: use simpler access_ok()

2022-02-22 Thread Thomas Bogendoerfer
On Wed, Feb 16, 2022 at 02:13:23PM +0100, Arnd Bergmann wrote: > diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h > index db9a8e002b62..d7c89dc3426c 100644 > --- a/arch/mips/include/asm/uaccess.h > +++ b/arch/mips/include/asm/uaccess.h > @@ -19,6 +19,7 @@ > #ifdef CON

Re: [PATCH 00/16] Remove usage of the deprecated "pci-dma-compat.h" API

2022-02-22 Thread Christoph Hellwig
Hi Christophe, do you know what the state is in current linux-next? I think we'll just want to queue up anything left at this point in the dma-mapping or PCI tree and get it done.

Re: [PATCH v4 4/9] powerpc/vas: Return paste instruction failure if no active window

2022-02-22 Thread Haren Myneni
On Wed, 2022-02-23 at 17:05 +1000, Nicholas Piggin wrote: > Excerpts from Haren Myneni's message of February 20, 2022 5:58 am: > > The VAS window may not be active if the system looses credits and > > the NX generates page fault when it receives request on unmap > > paste address. > > > > The kern

[PATCH v4 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx

2022-02-22 Thread Christophe Leroy
book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a NoExe

[PATCH v4 0/6] Allocate module text and data separately

2022-02-22 Thread Christophe Leroy
This series applies on top of Aaron's series "module: core code clean up" v6, plus the 4 fixups I just sent: - Fixup for 54f2273e5fef ("module: Move kallsyms support into a separate file") - Fixup for e5973a14d187 ("module: Move strict rwx support to a separate file") - Fixup for 1df95c1b9fb2 ("mo

[PATCH v4 1/6] module: Always have struct mod_tree_root

2022-02-22 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy --- kernel/module/internal.h | 4 +++- kernel/module/main.c | 5 - 2 files changed, 3 insertions(+), 6 de

[PATCH v4 3/6] module: Introduce data_layout

2022-02-22 Thread Christophe Leroy
In order to allow separation of data from text, add another layout, called data_layout. For architectures requesting separation of text and data, only text will go in core_layout and data will go in data_layout. For architectures which keep text and data together, make data_layout an alias of core

[PATCH v4 4/6] module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC

2022-02-22 Thread Christophe Leroy
Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256

[PATCH v4 5/6] module: Remove module_addr_min and module_addr_max

2022-02-22 Thread Christophe Leroy
Replace module_addr_min and module_addr_max by mod_tree.addr_min and mod_tree.addr_max Signed-off-by: Christophe Leroy --- kernel/module/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index f4d95a2ff08f..db503a212532 1

[PATCH v4 2/6] module: Prepare for handling several RB trees

2022-02-22 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. Modify functions to give the tree as a parameter. Signed-off-by: Christophe Leroy --- kernel/module/internal.h| 4 ++-- kernel/module/main.c| 16 kernel/module/tree_lookup.c | 20 ++-

[PATCH] powerpc/64s: Don't use DSISR for SLB faults

2022-02-22 Thread Michael Ellerman
Since commit 46ddcb3950a2 ("powerpc/mm: Show if a bad page fault on data is read or write.") we use page_fault_is_write(regs->dsisr) in __bad_page_fault() to determine if the fault is for a read or write, and change the message printed accordingly. But SLB faults, aka Data Segment Interrupts, don'

[PATCH] powerpc: Remove remaining stab codes

2022-02-22 Thread Christophe Leroy
Following commit 12318163737c ("powerpc/32: Remove remaining .stabs annotations"), stabs code are not used anymore. Remove them. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc_asm.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/

Re: [PATCH v4 0/3] KVM: PPC: Book3S PR: Fixes for AIL and SCV

2022-02-22 Thread Paolo Bonzini
On 2/22/22 07:47, Nicholas Piggin wrote: Patch 3 requires a KVM_CAP_PPC number allocated. QEMU maintainers are happy with it (link in changelog) just waiting on KVM upstreaming. Do you have objections to the series going to ppc/kvm tree first, or another option is you could take patch 3 alone fir

Re: [PATCH 3/3] powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC64

2022-02-22 Thread Christophe Leroy
Le 27/07/2021 à 08:55, Jordan Niethe a écrit : Implement commit 40272035e1d0 ("powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32") for PPC64. When the BPF routine doesn't call any function, the non volatile registers can be reallocated to volatile registers in

Re: [PATCH 3/4] powerpc: Handle prefixed instructions in show_user_instructions()

2022-02-22 Thread Christophe Leroy
Le 02/06/2020 à 07:27, Jordan Niethe a écrit : Currently prefixed instructions are treated as two word instructions by show_user_instructions(), treat them as a single instruction. '<' and '>' are placed around the instruction at the NIP, and for prefixed instructions this is placed around the

[PATCH v5 1/6] module: Always have struct mod_tree_root

2022-02-22 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy --- kernel/module/internal.h | 4 +++- kernel/module/main.c | 5 - 2 files changed, 3 insertions(+), 6 de

[PATCH v5 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx

2022-02-22 Thread Christophe Leroy
book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a NoExe

[PATCH v5 5/6] module: Remove module_addr_min and module_addr_max

2022-02-22 Thread Christophe Leroy
Replace module_addr_min and module_addr_max by mod_tree.addr_min and mod_tree.addr_max Signed-off-by: Christophe Leroy --- kernel/module/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index f4d95a2ff08f..db503a212532 1

[PATCH v5 3/6] module: Introduce data_layout

2022-02-22 Thread Christophe Leroy
In order to allow separation of data from text, add another layout, called data_layout. For architectures requesting separation of text and data, only text will go in core_layout and data will go in data_layout. For architectures which keep text and data together, make data_layout an alias of core

[PATCH v5 2/6] module: Prepare for handling several RB trees

2022-02-22 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. Modify functions to give the tree as a parameter. Signed-off-by: Christophe Leroy --- kernel/module/internal.h| 4 ++-- kernel/module/main.c| 16 kernel/module/tree_lookup.c | 20 ++-

[PATCH v5 4/6] module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC

2022-02-22 Thread Christophe Leroy
Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256

[PATCH v5 0/6] Allocate module text and data separately

2022-02-22 Thread Christophe Leroy
This series applies on top of Aaron's series "module: core code clean up" v8. This series allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set execut

Re: [PATCH] platforms/83xx: Use of_device_get_match_data()

2022-02-22 Thread Christophe Leroy
Resending as I accidentaly sent my response to the list only. Le 21/02/2022 à 03:03, cgel@gmail.com a écrit : > From: Minghao Chi (CGEL ZTE) > > Use of_device_get_match_data() to simplify the code. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi (CGEL ZTE) > --- > arch/powerpc/

[PATCH 01/11] dma-direct: use is_swiotlb_active in dma_direct_map_page

2022-02-22 Thread Christoph Hellwig
Use the more specific is_swiotlb_active check instead of checking the global swiotlb_force variable. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h index 4632b0f4f72eb..4dc16e0

cleanup swiotlb initialization

2022-02-22 Thread Christoph Hellwig
Hi all, this series tries to clean up the swiotlb initialization, including that of swiotlb-xen. To get there is also removes the x86 iommu table infrastructure that massively obsfucates the initialization path. Git tree: git://git.infradead.org/users/hch/misc.git swiotlb-init-cleanup Gitw

[PATCH 02/11] swiotlb: make swiotlb_exit a no-op if SWIOTLB_FORCE is set

2022-02-22 Thread Christoph Hellwig
If force bouncing is enabled we can't release the bufffers. Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index f1e7ea160b433..36fbf1181d285 100644 --- a/kernel/dma/swiotlb.c +++ b/kern

[PATCH 04/11] swiotlb: rename swiotlb_late_init_with_default_size

2022-02-22 Thread Christoph Hellwig
swiotlb_late_init_with_default_size is an overly verbose name that doesn't even catch what the function is doing, given that the size is not just a default but the actual requested size. Rename it to swiotlb_init_late. Signed-off-by: Christoph Hellwig --- arch/x86/pci/sta2x11-fixup.c | 2 +- in

[PATCH 05/11] swiotlb: pass a gfp_mask argument to swiotlb_init_late

2022-02-22 Thread Christoph Hellwig
Let the caller chose a zone to allocate from. Signed-off-by: Christoph Hellwig --- arch/x86/pci/sta2x11-fixup.c | 2 +- include/linux/swiotlb.h | 2 +- kernel/dma/swiotlb.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x

[PATCH 03/11] swiotlb: simplify swiotlb_max_segment

2022-02-22 Thread Christoph Hellwig
Remove the bogus Xen override that was usually larger than the actual size and just calculate the value on demand. Note that swiotlb_max_segment still doesn't make sense as an interface and should eventually be removed. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 2 -- inc

[PATCH 06/11] MIPS/octeon: use swiotlb_init instead of open coding it

2022-02-22 Thread Christoph Hellwig
Use the generic swiotlb initialization helper instead of open coding it. Signed-off-by: Christoph Hellwig --- arch/mips/cavium-octeon/dma-octeon.c | 15 ++- arch/mips/pci/pci-octeon.c | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/arch/mips/cavium-

[PATCH 07/11] x86: remove the IOMMU table infrastructure

2022-02-22 Thread Christoph Hellwig
The IOMMU table tries to separate the different IOMMUs into different backends, but actually requires various cross calls. Rewrite the code to do the generic swiotlb/swiotlb-xen setup directly in pci-dma.c and then just call into the IOMMU drivers. Signed-off-by: Christoph Hellwig --- arch/ia64

[PATCH 09/11] swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction

2022-02-22 Thread Christoph Hellwig
Power SVM wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Consolidate the support for this into the swiotlb_init interface by adding a new flag. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/svm.h | 4 arch/p