Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-13 Thread Aneesh Kumar K.V
Linus Torvalds writes: > On Thu, Jun 10, 2021 at 1:36 AM Aneesh Kumar K.V > wrote: >> >> @@ -306,8 +306,7 @@ static bool move_normal_pud(struct vm_area_struct *vma, >> unsigned long old_addr, >> >> VM_BUG_ON(!pud_none(*new_pud)); >> >> - /* Set the new pud */ >> - set_pud_at

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-13 Thread Matthew Wilcox
On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: > IIUC the reason why we do have pmd_pgtable() is that pgtable_t type > is arch dependent. On some architecture it is pte_t * and on the other > struct page *. The reason being highmem and level 4 page table can > be located in highm

[PATCH v5 00/17] Enable VAS and NX-GZIP support on PowerVM

2021-06-13 Thread Haren Myneni
Virtual Accelerator Switchboard (VAS) allows kernel subsystems and user space processes to directly access the Nest Accelerator (NX) engines which provides HW compression. The true user mode VAS/NX support on PowerNV is already included in Linux. Whereas PowerVM support is available from P10 onwa

[PATCH v5 01/17] powerpc/powernv/vas: Release reference to tgid during window close

2021-06-13 Thread Haren Myneni
The kernel handles the NX fault by updating CSB or sending signal to process. In multithread applications, children can open VAS windows and can exit without closing them. But the parent can continue to send NX requests with these windows. To prevent pid reuse, reference will be taken on pid and

[PATCH v5 02/17] powerpc/vas: Move VAS API to book3s common platform

2021-06-13 Thread Haren Myneni
Using the same /dev/crypto/nx-gzip interface for both powerNV and pseries. So this patch creates platforms/book3s/ and moves VAS API to that directory. The actual functionality is not changed. Signed-off-by: Haren Myneni --- arch/powerpc/platforms/Kconfig| 1 + arch/powerp

[PATCH v5 03/17] powerpc/powernv/vas: Rename register/unregister functions

2021-06-13 Thread Haren Myneni
powerNV and pseries drivers register / unregister to the corresponding platform specific VAS separately. Then these VAS functions call the common API with the specific window operations. So rename powerNV VAS API register/unregister functions. Signed-off-by: Haren Myneni Reviewed-by: Nicholas P

[PATCH v5 04/17] powerpc/vas: Add platform specific user window operations

2021-06-13 Thread Haren Myneni
PowerNV uses registers to open/close VAS windows, and getting the paste address. Whereas the hypervisor calls are used on PowerVM. This patch adds the platform specific user space window operations and register with the common VAS user space interface. Signed-off-by: Haren Myneni --- arch/pow

[PATCH v5 05/17] powerpc/vas: Create take/drop pid and mm reference functions

2021-06-13 Thread Haren Myneni
Take pid and mm references when each window opens and drops during close. This functionality is needed for powerNV and pseries. So this patch defines the existing code as functions in common book3s platform vas-api.c Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/vas.h |

[PATCH v5 06/17] powerpc/vas: Move update_csb/dump_crb to common book3s platform

2021-06-13 Thread Haren Myneni
If a coprocessor encounters an error translating an address, the VAS will cause an interrupt in the host. The kernel processes the fault by updating CSB. This functionality is same for both powerNV and pseries. So this patch moves these functions to common vas-api.c and the actual functionality i

[PATCH v5 07/17] powerpc/vas: Define and use common vas_window struct

2021-06-13 Thread Haren Myneni
Many elements in vas_struct are used on PowerNV and PowerVM platforms. vas_window is used for both TX and RX windows on PowerNV and for TX windows on PowerVM. So some elements are specific to these platforms. So this patch defines common vas_window and platform specific window structs (pnv_vas_w

[PATCH v5 08/17] powerpc/pseries/vas: Define VAS/NXGZIP hcalls and structs

2021-06-13 Thread Haren Myneni
This patch adds hcalls and other definitions. Also define structs that are used in VAS implementation on PowerVM. Signed-off-by: Haren Myneni --- arch/powerpc/include/asm/hvcall.h| 7 ++ arch/powerpc/include/asm/vas.h | 30 +++ arch/powerpc/platforms/pseries/vas.h | 125 ++

[PATCH v5 09/17] powerpc/vas: Define QoS credit flag to allocate window

2021-06-13 Thread Haren Myneni
PowerVM introduces two different type of credits: Default and Quality of service (QoS). The total number of default credits available on each LPAR depends on CPU resources configured. But these credits can be shared or over-committed across LPARs in shared mode which can result in paste command

[PATCH v5 10/17] powerpc/pseries/vas: Add hcall wrappers for VAS handling

2021-06-13 Thread Haren Myneni
This patch adds the following hcall wrapper functions to allocate, modify and deallocate VAS windows, and retrieve VAS capabilities. H_ALLOCATE_VAS_WINDOW: Allocate VAS window H_DEALLOCATE_VAS_WINDOW: Close VAS window H_MODIFY_VAS_WINDOW: Setup window before using H_QUERY_VAS_CAPABILITIES: Get V

[PATCH v5 11/17] powerpc/pseries/vas: Implement getting capabilities from hypervisor

2021-06-13 Thread Haren Myneni
The hypervisor provides VAS capabilities for GZIP default and QoS features. These capabilities gives information for the specific features such as total number of credits available in LPAR, maximum credits allowed per window, maximum credits allowed in LPAR, whether usermode copy/paste is support

[PATCH v5 12/17] powerpc/pseries/vas: Integrate API with open/close windows

2021-06-13 Thread Haren Myneni
This patch adds VAS window allocatioa/close with the corresponding hcalls. Also changes to integrate with the existing user space VAS API and provide register/unregister functions to NX pseries driver. The driver register function is used to create the user space interface (/dev/crypto/nx-gzip)

[PATCH v5 13/17] powerpc/pseries/vas: Setup IRQ and fault handling

2021-06-13 Thread Haren Myneni
NX generates an interrupt when sees a fault on the user space buffer and the hypervisor forwards that interrupt to OS. Then the kernel handles the interrupt by issuing H_GET_NX_FAULT hcall to retrieve the fault CRB information. This patch also adds changes to setup and free IRQ per each window a

[PATCH v5 14/17] crypto/nx: Rename nx-842-pseries file name to nx-common-pseries

2021-06-13 Thread Haren Myneni
Rename nx-842-pseries.c to nx-common-pseries.c to add code for new GZIP compression type. The actual functionality is not changed in this patch. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/crypto/nx/Makefile | 2 +- drivers/crypto/nx/{nx-842-p

[PATCH v5 15/17] crypto/nx: Register and unregister VAS interface on PowerVM

2021-06-13 Thread Haren Myneni
The user space uses /dev/crypto/nx-gzip interface to setup VAS windows, create paste mapping and close windows. This patch adds changes to create/remove this interface with VAS register/unregister functions on PowerVM platform. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/cryp

[PATCH v5 16/17] crypto/nx: Get NX capabilities for GZIP coprocessor type

2021-06-13 Thread Haren Myneni
The hypervisor provides different capabilities that it supports to define the user space NX request. These capabilities are recommended minimum compression / decompression lengths and the maximum request buffer size in bytes. Changes to get NX overall capabilities which points to the specific fe

[PATCH v5 17/17] crypto/nx: Add sysfs interface to export NX capabilities

2021-06-13 Thread Haren Myneni
Changes to export the following NXGZIP capabilities through sysfs: /sys/devices/vio/ibm,compression-v1/nx_gzip_caps: min_compress_len /*Recommended minimum compress length in bytes*/ min_decompress_len /*Recommended minimum decompress length in bytes*/ req_max_processed_len /* Maximum number of

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-13 Thread Aneesh Kumar K.V
On 6/13/21 4:20 PM, Matthew Wilcox wrote: On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: IIUC the reason why we do have pmd_pgtable() is that pgtable_t type is arch dependent. On some architecture it is pte_t * and on the other struct page *. The reason being highmem and level

Re: [PATCH -next 9/9] ASoC: fsl_xcvr: check return value after calling platform_get_resource_byname()

2021-06-13 Thread Timur Tabi
On Fri, Jun 11, 2021 at 4:32 AM Yang Yingliang wrote: > rx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rxfifo"); > tx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "txfifo"); > + if (!rx_res || !tx_res) { > + dev_err(dev, "Invalid resou

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-13 Thread Linus Torvalds
On Sun, Jun 13, 2021 at 2:06 AM Aneesh Kumar K.V wrote: > > IIUC the reason why we do have pmd_pgtable() is that pgtable_t type > is arch dependent. On some architecture it is pte_t * and on the other > struct page *. The reason being highmem and level 4 page table can > be located in highmem. Ho

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-13 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of June 9, 2021 2:20 am: > On 6/4/21 6:42 PM, Nicholas Piggin wrote: >> Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm >> when it is context switched. This can be disabled by architectures that >> don't require this refcounting if th

Re: [PATCH] powerpc/signal64: Copy siginfo before changing regs->nip

2021-06-13 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of June 8, 2021 11:46 pm: > In commit 96d7a4e06fab ("powerpc/signal64: Rewrite handle_rt_signal64() > to minimise uaccess switches") the 64-bit signal code was rearranged to > use user_write_access_begin/end(). > > As part of that change the call to copy_si

Re: [PATCH] powerpc/signal64: Copy siginfo before changing regs->nip

2021-06-13 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of June 14, 2021 10:47 am: > Excerpts from Michael Ellerman's message of June 8, 2021 11:46 pm: >> In commit 96d7a4e06fab ("powerpc/signal64: Rewrite handle_rt_signal64() >> to minimise uaccess switches") the 64-bit signal code was rearranged to >> use user_w

Re: [PATCH] powerpc/signal64: Don't read sigaction arguments back from user memory

2021-06-13 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of June 10, 2021 5:29 pm: > When delivering a signal to a sigaction style handler (SA_SIGINFO), we > pass pointers to the siginfo and ucontext via r4 and r5. > > Currently we populate the values in those registers by reading the > pointers out of the sigfra

Re: [PATCH v5 02/17] powerpc/vas: Move VAS API to book3s common platform

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:55 pm: > > Using the same /dev/crypto/nx-gzip interface for both powerNV and > pseries. So this patch creates platforms/book3s/ and moves VAS API > to that directory. The actual functionality is not changed. > > Signed-off-by: Haren Myneni

Re: [PATCH v5 01/17] powerpc/powernv/vas: Release reference to tgid during window close

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:54 pm: > > The kernel handles the NX fault by updating CSB or sending > signal to process. In multithread applications, children can > open VAS windows and can exit without closing them. But the > parent can continue to send NX requests with

Re: [PATCH v5 04/17] powerpc/vas: Add platform specific user window operations

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:57 pm: > > PowerNV uses registers to open/close VAS windows, and getting the > paste address. Whereas the hypervisor calls are used on PowerVM. > > This patch adds the platform specific user space window operations > and register with the co

Re: [PATCH v5 05/17] powerpc/vas: Create take/drop pid and mm reference functions

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:57 pm: > > Take pid and mm references when each window opens and drops during > close. This functionality is needed for powerNV and pseries. So > this patch defines the existing code as functions in common book3s > platform vas-api.c > > Sig

Re: [PATCH v5 07/17] powerpc/vas: Define and use common vas_window struct

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:58 pm: > > Many elements in vas_struct are used on PowerNV and PowerVM > platforms. vas_window is used for both TX and RX windows on > PowerNV and for TX windows on PowerVM. So some elements are > specific to these platforms. > > So this pat

Re: [PATCH v5 08/17] powerpc/pseries/vas: Define VAS/NXGZIP hcalls and structs

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:59 pm: > > This patch adds hcalls and other definitions. Also define structs > that are used in VAS implementation on PowerVM. > > Signed-off-by: Haren Myneni I haven't got the specs to verify it against, but previous comments on naming e

Re: [PATCH v5 09/17] powerpc/vas: Define QoS credit flag to allocate window

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:00 pm: > > PowerVM introduces two different type of credits: Default and Quality > of service (QoS). > > The total number of default credits available on each LPAR depends > on CPU resources configured. But these credits can be shared or > o

Re: [PATCH v5 11/17] powerpc/pseries/vas: Implement getting capabilities from hypervisor

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:01 pm: > > The hypervisor provides VAS capabilities for GZIP default and QoS > features. These capabilities gives information for the specific > features such as total number of credits available in LPAR, > maximum credits allowed per window,

Re: [PATCH v5 12/17] powerpc/pseries/vas: Integrate API with open/close windows

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:02 pm: > > This patch adds VAS window allocatioa/close with the corresponding > hcalls. Also changes to integrate with the existing user space VAS > API and provide register/unregister functions to NX pseries driver. > > The driver register

Re: [PATCH v5 13/17] powerpc/pseries/vas: Setup IRQ and fault handling

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:02 pm: > > NX generates an interrupt when sees a fault on the user space > buffer and the hypervisor forwards that interrupt to OS. Then > the kernel handles the interrupt by issuing H_GET_NX_FAULT hcall > to retrieve the fault CRB informatio

Re: [PATCH v5 14/17] crypto/nx: Rename nx-842-pseries file name to nx-common-pseries

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:03 pm: > > Rename nx-842-pseries.c to nx-common-pseries.c to add code for new > GZIP compression type. The actual functionality is not changed in > this patch. > > Signed-off-by: Haren Myneni > Acked-by: Herbert Xu Acked-by: Nicholas Pigg

Re: [PATCH v5 06/17] powerpc/vas: Move update_csb/dump_crb to common book3s platform

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 8:58 pm: > > If a coprocessor encounters an error translating an address, the > VAS will cause an interrupt in the host. The kernel processes > the fault by updating CSB. This functionality is same for both > powerNV and pseries. So this patch

Re: [PATCH v5 15/17] crypto/nx: Register and unregister VAS interface on PowerVM

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:04 pm: > > The user space uses /dev/crypto/nx-gzip interface to setup VAS > windows, create paste mapping and close windows. This patch adds > changes to create/remove this interface with VAS register/unregister > functions on PowerVM platfor

Re: [PATCH v5 16/17] crypto/nx: Get NX capabilities for GZIP coprocessor type

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:04 pm: > > The hypervisor provides different capabilities that it supports > to define the user space NX request. These capabilities are > recommended minimum compression / decompression lengths and the > maximum request buffer size in bytes.

Re: [PATCH v5 17/17] crypto/nx: Add sysfs interface to export NX capabilities

2021-06-13 Thread Nicholas Piggin
Excerpts from Haren Myneni's message of June 13, 2021 9:05 pm: > > Changes to export the following NXGZIP capabilities through sysfs: > > /sys/devices/vio/ibm,compression-v1/nx_gzip_caps: > min_compress_len /*Recommended minimum compress length in bytes*/ > min_decompress_len /*Recommended minim

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-13 Thread Andy Lutomirski
On 6/13/21 5:45 PM, Nicholas Piggin wrote: > Excerpts from Andy Lutomirski's message of June 9, 2021 2:20 am: >> On 6/4/21 6:42 PM, Nicholas Piggin wrote: >>> Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm >>> when it is context switched. This can be disabled by architectu

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-13 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of June 14, 2021 1:52 pm: > On 6/13/21 5:45 PM, Nicholas Piggin wrote: >> Excerpts from Andy Lutomirski's message of June 9, 2021 2:20 am: >>> On 6/4/21 6:42 PM, Nicholas Piggin wrote: Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-13 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of June 14, 2021 2:14 pm: > Excerpts from Andy Lutomirski's message of June 14, 2021 1:52 pm: >> On 6/13/21 5:45 PM, Nicholas Piggin wrote: >>> Excerpts from Andy Lutomirski's message of June 9, 2021 2:20 am: On 6/4/21 6:42 PM, Nicholas Piggin wrote: >>>

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-13 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of June 14, 2021 2:47 pm: > Excerpts from Nicholas Piggin's message of June 14, 2021 2:14 pm: >> Excerpts from Andy Lutomirski's message of June 14, 2021 1:52 pm: >>> On 6/13/21 5:45 PM, Nicholas Piggin wrote: Excerpts from Andy Lutomirski's message of J

[PATCH v2 1/4] drivers/nvdimm: Add nvdimm pmu structure

2021-06-13 Thread Kajol Jain
A structure is added, called nvdimm_pmu, for performance stats reporting support of nvdimm devices. It can be used to add nvdimm pmu data such as supported events and pmu event functions like event_init/add/read/del with cpu hotplug support. Signed-off-by: Kajol Jain --- include/linux/nd.h | 43

[PATCH v2 2/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats

2021-06-13 Thread Kajol Jain
A common interface is added to get performance stats reporting support for nvdimm devices. Added interface includes support for pmu register/unregister functions, cpu hotplug and pmu event functions like event_init/add/read/del. User could use the standard perf tool to access perf events exposed vi

[PATCH v2 4/4] powerpc/papr_scm: Document papr_scm sysfs event format entries

2021-06-13 Thread Kajol Jain
Details is added for the event, cpumask and format attributes in the ABI documentation. Signed-off-by: Kajol Jain --- Documentation/ABI/testing/sysfs-bus-papr-pmem | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-papr-pmem b/Documentat

[PATCH v2 0/4] Add perf interface to expose nvdimm

2021-06-13 Thread Kajol Jain
Patchset adds performance stats reporting support for nvdimm. Added interface includes support for pmu register/unregister functions. A structure is added called nvdimm_pmu to be used for adding arch/platform specific data such as supported events, cpumask pmu event functions like event_init/add/re

[PATCH v2 3/4] powerpc/papr_scm: Add perf interface support

2021-06-13 Thread Kajol Jain
Performance monitoring support for papr-scm nvdimm devices via perf interface is added which includes addition of pmu functions like add/del/read/event_init for nvdimm_pmu struture. A new parameter 'priv' in added to the pdev_archdata structure to save nvdimm_pmu device pointer, to handle the unre

Re: [PATCH 5/6] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-06-13 Thread Christophe Leroy
Le 13/06/2021 à 13:13, Aneesh Kumar K.V a écrit : On 6/13/21 4:20 PM, Matthew Wilcox wrote: On Sun, Jun 13, 2021 at 02:36:13PM +0530, Aneesh Kumar K.V wrote: IIUC the reason why we do have pmd_pgtable() is that pgtable_t type is arch dependent. On some architecture it is pte_t * and on the o

Re: [PATCH] powerpc/signal64: Don't read sigaction arguments back from user memory

2021-06-13 Thread Christophe Leroy
Le 14/06/2021 à 03:32, Nicholas Piggin a écrit : Excerpts from Michael Ellerman's message of June 10, 2021 5:29 pm: When delivering a signal to a sigaction style handler (SA_SIGINFO), we pass pointers to the siginfo and ucontext via r4 and r5. Currently we populate the values in those regist

Re: [PATCH] powerpc/signal64: Copy siginfo before changing regs->nip

2021-06-13 Thread Christophe Leroy
Le 14/06/2021 à 03:29, Nicholas Piggin a écrit : Excerpts from Nicholas Piggin's message of June 14, 2021 10:47 am: Excerpts from Michael Ellerman's message of June 8, 2021 11:46 pm: In commit 96d7a4e06fab ("powerpc/signal64: Rewrite handle_rt_signal64() to minimise uaccess switches") the 64

Re: [PATCH] powerpc/signal64: Don't read sigaction arguments back from user memory

2021-06-13 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 14, 2021 3:30 pm: > > > Le 14/06/2021 à 03:32, Nicholas Piggin a écrit : >> Excerpts from Michael Ellerman's message of June 10, 2021 5:29 pm: >>> When delivering a signal to a sigaction style handler (SA_SIGINFO), we >>> pass pointers to the sigin

Re: [PATCH] powerpc/signal64: Copy siginfo before changing regs->nip

2021-06-13 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 14, 2021 3:31 pm: > > > Le 14/06/2021 à 03:29, Nicholas Piggin a écrit : >> Excerpts from Nicholas Piggin's message of June 14, 2021 10:47 am: >>> Excerpts from Michael Ellerman's message of June 8, 2021 11:46 pm: In commit 96d7a4e06fab ("powe

Re: [PATCH v9 01/14] swiotlb: Refactor swiotlb init functions

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:46PM +0800, Claire Chang wrote: > + spin_lock_init(&mem->lock); > + for (i = 0; i < mem->nslabs; i++) { > + mem->slots[i].list = IO_TLB_SEGSIZE - io_tlb_offset(i); > + mem->slots[i].orig_addr = INVALID_PHYS_ADDR; > + mem->slo

Re: [PATCH v9 02/14] swiotlb: Refactor swiotlb_create_debugfs

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:47PM +0800, Claire Chang wrote: > Split the debugfs creation to make the code reusable for supporting > different bounce buffer pools, e.g. restricted DMA pool. > > Signed-off-by: Claire Chang > --- > kernel/dma/swiotlb.c | 23 --- > 1 file chang

Re: [PATCH v9 03/14] swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:33:15PM +0800, Claire Chang wrote: > I'm not sure if this would break arch/x86/pci/sta2x11-fixup.c > swiotlb_late_init_with_default_size is called here > https://elixir.bootlin.com/linux/v5.13-rc5/source/arch/x86/pci/sta2x11-fixup.c#L60 It will. It will also break all n

Re: [PATCH v9 04/14] swiotlb: Add restricted DMA pool initialization

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:49PM +0800, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes. Bisection hazard: we should only add the new config option when the code is actually read to be used. So this patch should move to

Re: [PATCH v9 05/14] swiotlb: Update is_swiotlb_buffer to add a struct device argument

2021-06-13 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v9 06/14] swiotlb: Update is_swiotlb_active to add a struct device argument

2021-06-13 Thread Christoph Hellwig
> kernel/dma/direct.c | 2 +- > kernel/dma/swiotlb.c | 4 ++-- > 6 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c > b/drivers/gpu/drm/i915/gem/i915_gem_internal.c > index ce6b664b10aa..

Re: [PATCH v9 07/14] swiotlb: Bounce data from/to restricted DMA pool if available

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:52PM +0800, Claire Chang wrote: > Regardless of swiotlb setting, the restricted DMA pool is preferred if > available. > > The restricted DMA pools provide a basic level of protection against the > DMA overwriting buffer contents at unexpected times. However, to protec

Re: [PATCH v9 08/14] swiotlb: Move alloc_size to find_slots

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:53PM +0800, Claire Chang wrote: > Move the maintenance of alloc_size to find_slots for better code > reusability later. Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v9 09/14] swiotlb: Refactor swiotlb_tbl_unmap_single

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:54PM +0800, Claire Chang wrote: > Add a new function, release_slots, to make the code reusable for supporting > different bounce buffer pools, e.g. restricted DMA pool. > > Signed-off-by: Claire Chang > --- > kernel/dma/swiotlb.c | 35 ---

Re: [PATCH v9 11/14] swiotlb: Add restricted DMA alloc/free support.

2021-06-13 Thread Christoph Hellwig
I think merging this with the next two patches would be a little more clear.

Re: [PATCH v9 11/14] swiotlb: Add restricted DMA alloc/free support.

2021-06-13 Thread Christoph Hellwig
On Mon, Jun 14, 2021 at 08:28:01AM +0200, Christoph Hellwig wrote: > I think merging this with the next two patches would be a little more > clear. Sorry, I mean the next patch and the previous one.