Re: Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Christophe Leroy
Le 16/06/2021 à 08:33, Madhavan Srinivasan a écrit : On 6/16/21 11:56 AM, Christophe Leroy wrote: Le 16/06/2021 à 05:40, Athira Rajeev a écrit : On 16-Jun-2021, at 8:53 AM, Madhavan Srinivasan wrote: On 6/15/21 8:35 PM, Christophe Leroy wrote: For your information, I'm getting the f

[PATCH V2 3/3] cpufreq: powerenv: Migrate to ->exit() callback instead of ->stop_cpu()

2021-06-15 Thread Viresh Kumar
commit 367dc4aa932b ("cpufreq: Add stop CPU callback to cpufreq_driver interface") added the stop_cpu() callback to allow the drivers to do clean up before the CPU is completely down and its state can't be modified. At that time the CPU hotplug framework used to call the cpufreq core's registered

[PATCH V2 0/3] cpufreq: Migrate away from ->stop_cpu() callback

2021-06-15 Thread Viresh Kumar
Hi Rafael, Sending these separately from CPPC stuff to avoid unnecessary confusion and independent merging of these patches. These should get in nevertheless. commit 367dc4aa932b ("cpufreq: Add stop CPU callback to cpufreq_driver interface") added the stop_cpu() callback to allow the drivers to d

Re: Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Madhavan Srinivasan
On 6/16/21 11:56 AM, Christophe Leroy wrote: Le 16/06/2021 à 05:40, Athira Rajeev a écrit : On 16-Jun-2021, at 8:53 AM, Madhavan Srinivasan wrote: On 6/15/21 8:35 PM, Christophe Leroy wrote: For your information, I'm getting the following Oops. Detected with 5.13-rc6, it also oopses

Re: [PATCH v11 00/12] Restricted DMA

2021-06-15 Thread Claire Chang
v12: https://lore.kernel.org/patchwork/cover/1447254/ On Wed, Jun 16, 2021 at 11:52 AM Claire Chang wrote: > > This series implements mitigations for lack of DMA access control on > systems without an IOMMU, which could result in the DMA accessing the > system memory at unexpected times and/or un

Re: Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Christophe Leroy
Le 16/06/2021 à 05:40, Athira Rajeev a écrit : On 16-Jun-2021, at 8:53 AM, Madhavan Srinivasan wrote: On 6/15/21 8:35 PM, Christophe Leroy wrote: For your information, I'm getting the following Oops. Detected with 5.13-rc6, it also oopses on 5.12 and 5.11. Runs ok on 5.10. I'm starting

[PATCH v12 12/12] of: Add plumbing for restricted DMA pool

2021-06-15 Thread Claire Chang
If a device is not behind an IOMMU, we look up the device node and set up the restricted DMA when the restricted-dma-pool is presented. Signed-off-by: Claire Chang --- drivers/of/address.c| 33 + drivers/of/device.c | 3 +++ drivers/of/of_private.h | 6 +

[PATCH v12 11/12] dt-bindings: of: Add restricted DMA pool

2021-06-15 Thread Claire Chang
Introduce the new compatible string, restricted-dma-pool, for restricted DMA. One can specify the address and length of the restricted DMA memory region by restricted-dma-pool in the reserved-memory node. Signed-off-by: Claire Chang --- .../reserved-memory/reserved-memory.txt | 36

[PATCH v12 10/12] swiotlb: Add restricted DMA pool initialization

2021-06-15 Thread Claire Chang
Add the initialization function to create restricted DMA pools from matching reserved-memory nodes. 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 unexpec

[PATCH v12 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Claire Chang
Add the functions, swiotlb_{alloc,free} and is_swiotlb_for_alloc to support the memory allocation from restricted DMA pool. The restricted DMA pool is preferred if available. Note that since coherent allocation needs remapping, one must set up another device coherent pool by shared-dma-pool and u

[PATCH v12 08/12] swiotlb: Refactor swiotlb_tbl_unmap_single

2021-06-15 Thread Claire Chang
Add a new function, swiotlb_release_slots, to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) dif

[PATCH v12 07/12] swiotlb: Move alloc_size to swiotlb_find_slots

2021-06-15 Thread Claire Chang
Rename find_slots to swiotlb_find_slots and move the maintenance of alloc_size to it for better code reusability later. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel

[PATCH v12 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-15 Thread Claire Chang
Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and use it to determine whether to bounce the data or not. This will be useful later to allow for different pools. Signed-off-by: Claire Chang --- include/linux/swiotlb.h | 11 +++ kernel/dma/direct.c | 2 +- kernel/d

[PATCH v12 05/12] swiotlb: Update is_swiotlb_active to add a struct device argument

2021-06-15 Thread Claire Chang
Update is_swiotlb_active to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/nouveau/nouveau_ttm.c| 2 +- drivers/pci/

[PATCH v12 04/12] swiotlb: Update is_swiotlb_buffer to add a struct device argument

2021-06-15 Thread Claire Chang
Update is_swiotlb_buffer to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 12 ++-- drivers/xen/swiotlb-xen.c | 2 +- include/linux/swiotlb.h | 7 ---

[PATCH v12 03/12] swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used

2021-06-15 Thread Claire Chang
Always have the pointer to the swiotlb pool used in struct device. This could help simplify the code for other pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/base/core.c| 4 include/linux/device.h | 4 kernel/dma/swiotlb.c | 8 3 files cha

[PATCH v12 02/12] swiotlb: Refactor swiotlb_create_debugfs

2021-06-15 Thread Claire Chang
Split the debugfs creation to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/kernel/dma/swiotlb.c

[PATCH v12 01/12] swiotlb: Refactor swiotlb init functions

2021-06-15 Thread Claire Chang
Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct initialization to make the code reusable. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 49 ++-- 1 file changed, 24 insertions(+), 25 deletions(

[PATCH v12 00/12] Restricted DMA

2021-06-15 Thread Claire Chang
This series implements mitigations for lack of DMA access control on systems without an IOMMU, which could result in the DMA accessing the system memory at unexpected times and/or unexpected addresses, possibly leading to data leakage or corruption. For example, we plan to use the PCI-e bus for Wi

[powerpc:merge] BUILD SUCCESS 77fe1f3ccbe0cdc6f386aef522b043c52196d4d2

2021-06-15 Thread kernel test robot
lyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a002-20210615 i386 randconfig-a006-20210615 i386 randconfig-a004-20210615 i386 randconfig-a001-202

Re: [PATCH v11 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Christoph Hellwig
On Wed, Jun 16, 2021 at 01:10:02PM +0800, Claire Chang wrote: > On Wed, Jun 16, 2021 at 12:59 PM Christoph Hellwig wrote: > > > > On Wed, Jun 16, 2021 at 12:04:16PM +0800, Claire Chang wrote: > > > Just noticed that after propagating swiotlb_force setting into > > > io_tlb_default_mem->force, the

Re: [PATCH v11 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Claire Chang
On Wed, Jun 16, 2021 at 12:59 PM Christoph Hellwig wrote: > > On Wed, Jun 16, 2021 at 12:04:16PM +0800, Claire Chang wrote: > > Just noticed that after propagating swiotlb_force setting into > > io_tlb_default_mem->force, the memory allocation behavior for > > swiotlb_force will change (i.e. alway

Re: [PATCH v11 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Christoph Hellwig
On Wed, Jun 16, 2021 at 12:04:16PM +0800, Claire Chang wrote: > Just noticed that after propagating swiotlb_force setting into > io_tlb_default_mem->force, the memory allocation behavior for > swiotlb_force will change (i.e. always skipping arch_dma_alloc and > dma_direct_alloc_from_pool). Yes, I

[PATCH v8 3/3] powerpc/mm: Enable HAVE_MOVE_PMD support

2021-06-15 Thread Aneesh Kumar K.V
mremap HAVE_MOVE_PMD/PUD optimization time comparison for 1GB region: 1GB mremap - Source PTE-aligned, Destination PTE-aligned mremap time: 2292772ns 1GB mremap - Source PMD-aligned, Destination PMD-aligned mremap time: 1158928ns 1GB mremap - Source PUD-aligned, Destination PUD-aligne

[PATCH v8 2/3] powerpc/book3s64/mm: Update flush_tlb_range to flush page walk cache

2021-06-15 Thread Aneesh Kumar K.V
flush_tlb_range is special in that we don't specify the page size used for the translation. Hence when flushing TLB we flush the translation cache for all possible page sizes. The kernel also uses the same interface when moving page tables around. Such a move requires us to flush the page walk cach

[PATCH v8 1/3] mm/mremap: Allow arch runtime override

2021-06-15 Thread Aneesh Kumar K.V
Architectures like ppc64 support faster mremap only with radix translation. Hence allow a runtime check w.r.t support for fast mremap. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/tlb.h | 6 ++ mm/mremap.c| 15 ++- 2 files changed, 20 insertio

[PATCH v8 0/3] Speedup mremap on ppc64

2021-06-15 Thread Aneesh Kumar K.V
This patchset enables MOVE_PMD/MOVE_PUD support on power. This requires the platform to support updating higher-level page tables without updating page table entries. This also needs to invalidate the Page Walk Cache on architecture supporting the same. This patchset is dependent on https://lore.k

Re: [PATCH 0/5] cpufreq: cppc: Fix suspend/resume specific races with FIE code

2021-06-15 Thread Viresh Kumar
On 15-06-21, 08:17, Qian Cai wrote: > On 6/15/2021 3:50 AM, Viresh Kumar wrote: > > This is a strange place to get the issue from. And this is a new > > issue. > > Well, it was still the same exercises with CPU online/offline. > > > > >> [ 488.151939][ T670] kthread+0x3ac/0x460 > >> [ 488.15

[PATCH v2 6/6] mm/mremap: hold the rmap lock in write mode when moving page table entries.

2021-06-15 Thread Aneesh Kumar K.V
To avoid a race between rmap walk and mremap, mremap does take_rmap_locks(). The lock was taken to ensure that rmap walk don't miss a page table entry due to PTE moves via move_pagetables(). The kernel does further optimization of this lock such that if we are going to find the newly added vma afte

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

2021-06-15 Thread Aneesh Kumar K.V
pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures like ppc64 do assume that set_pmd/pud_at can only be used to set a hugepage PTE. Since we are not setting up a hugepage PTE here, use the pmd/pud_populate interface. Signed-off-by: Anees

[PATCH v2 4/6] mm/mremap: Don't enable optimized PUD move if page table levels is 2

2021-06-15 Thread Aneesh Kumar K.V
With two level page table don't enable move_normal_pud. Signed-off-by: Aneesh Kumar K.V --- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mremap.c b/mm/mremap.c index 958ecdc6f29d..97313e316a4d 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -276,7 +276,7 @@ st

[PATCH v2 3/6] mm/mremap: Convert huge PUD move to separate helper

2021-06-15 Thread Aneesh Kumar K.V
With TRANSPARENT_HUGEPAGE_PUD enabled the kernel can find huge PUD entries. Add a helper to move huge PUD entries on mremap(). This will be used by a later patch to optimize mremap of PUD_SIZE aligned level 4 PTE mapped address This also make sure we support mremap on huge PUD entries even with C

[PATCH v2 2/6] selftest/mremap_test: Avoid crash with static build

2021-06-15 Thread Aneesh Kumar K.V
With a large mmap map size, we can overlap with the text area and using MAP_FIXED results in unmapping that area. Switch to MAP_FIXED_NOREPLACE and handle the EEXIST error. Reviewed-by: Kalesh Singh Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 5 +++-- 1 file c

[PATCH v2 1/6] selftest/mremap_test: Update the test to handle pagesize other than 4K

2021-06-15 Thread Aneesh Kumar K.V
Instead of hardcoding 4K page size fetch it using sysconf(). For the performance measurements test still assume 2M and 1G are hugepage sizes. Reviewed-by: Kalesh Singh Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/mremap_test.c | 113 --- 1 file changed, 61

[PATCH v2 0/6] mrermap fixes

2021-06-15 Thread Aneesh Kumar K.V
This patch series is split out series from [PATCH v7 00/11] Speedup mremap on ppc64 (https://lore.kernel.org/linux-mm/20210607055131.156184-1-aneesh.ku...@linux.ibm.com) dropping ppc64 specific changes. This patchset is dependent on https://lore.kernel.org/linux-mm/20210615110859.320299-1-aneesh.

Re: [PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation

2021-06-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm: > The old sync_core_before_usermode() comments suggested that a > non-icache-syncing > return-to-usermode instruction is x86-specific and that all other > architectures automatically notice cross-modified code on return to > userspa

Re: [PATCH v12 2/6] kasan: allow architectures to provide an outline readiness check

2021-06-15 Thread Daniel Axtens
Hi Marco, >> + /* Don't touch the shadow memory if arch isn't ready */ >> + if (!kasan_arch_is_ready()) >> + return; >> + > > What about kasan_poison_last_granule()? kasan_unpoison() currently > seems to potentially trip on that. Ah the perils of rebasing an old series! I

Re: [PATCH v12 1/6] kasan: allow an architecture to disable inline instrumentation

2021-06-15 Thread Daniel Axtens
Hi Marco, @@ -12,6 +12,15 @@ config HAVE_ARCH_KASAN_HW_TAGS >> config HAVE_ARCH_KASAN_VMALLOC >> bool >> >> +# Sometimes an architecture might not be able to support inline >> instrumentation >> +# but might be able to support outline instrumentation. This option allows >> an >> +# arch

Re: [PATCH 6/8] powerpc/membarrier: Remove special barrier on mm switch

2021-06-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm: > powerpc did the following on some, but not all, paths through > switch_mm_irqs_off(): > >/* > * Only need the full barrier when switching between processes. > * Barrier when switching from kernel to userspa

Re: [PATCH v11 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Claire Chang
On Wed, Jun 16, 2021 at 11:54 AM Claire Chang wrote: > > Add the functions, swiotlb_{alloc,free} to support the memory allocation > from restricted DMA pool. > > The restricted DMA pool is preferred if available. > > Note that since coherent allocation needs remapping, one must set up > another de

Re: [PATCH v10 00/12] Restricted DMA

2021-06-15 Thread Claire Chang
v11 https://lore.kernel.org/patchwork/cover/1447216/ On Tue, Jun 15, 2021 at 9:27 PM Claire Chang wrote: > > This series implements mitigations for lack of DMA access control on > systems without an IOMMU, which could result in the DMA accessing the > system memory at unexpected times and/or unex

[PATCH v11 12/12] of: Add plumbing for restricted DMA pool

2021-06-15 Thread Claire Chang
If a device is not behind an IOMMU, we look up the device node and set up the restricted DMA when the restricted-dma-pool is presented. Signed-off-by: Claire Chang --- drivers/of/address.c| 33 + drivers/of/device.c | 3 +++ drivers/of/of_private.h | 6 +

[PATCH v11 11/12] dt-bindings: of: Add restricted DMA pool

2021-06-15 Thread Claire Chang
Introduce the new compatible string, restricted-dma-pool, for restricted DMA. One can specify the address and length of the restricted DMA memory region by restricted-dma-pool in the reserved-memory node. Signed-off-by: Claire Chang --- .../reserved-memory/reserved-memory.txt | 36

[PATCH v11 10/12] swiotlb: Add restricted DMA pool initialization

2021-06-15 Thread Claire Chang
Add the initialization function to create restricted DMA pools from matching reserved-memory nodes. 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 unexpec

[PATCH v11 09/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Claire Chang
Add the functions, swiotlb_{alloc,free} to support the memory allocation from restricted DMA pool. The restricted DMA pool is preferred if available. Note that since coherent allocation needs remapping, one must set up another device coherent pool by shared-dma-pool and use dma_alloc_from_dev_coh

[PATCH v11 08/12] swiotlb: Refactor swiotlb_tbl_unmap_single

2021-06-15 Thread Claire Chang
Add a new function, swiotlb_release_slots, to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) dif

[PATCH v11 07/12] swiotlb: Move alloc_size to swiotlb_find_slots

2021-06-15 Thread Claire Chang
Rename find_slots to swiotlb_find_slots and move the maintenance of alloc_size to it for better code reusability later. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel

[PATCH v11 06/12] swiotlb: Use is_dev_swiotlb_force for swiotlb data bouncing

2021-06-15 Thread Claire Chang
Propagate the swiotlb_force setting into io_tlb_default_mem->force and use it to determine whether to bounce the data or not. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- include/linux/swiotlb.h | 11 +++ kernel/d

[PATCH v11 05/12] swiotlb: Update is_swiotlb_active to add a struct device argument

2021-06-15 Thread Claire Chang
Update is_swiotlb_active to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 2 +- drivers/gpu/drm/nouveau/nouveau_ttm.c| 2 +- drivers/pci/

[PATCH v11 04/12] swiotlb: Update is_swiotlb_buffer to add a struct device argument

2021-06-15 Thread Claire Chang
Update is_swiotlb_buffer to add a struct device argument. This will be useful later to allow for different pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 12 ++-- drivers/xen/swiotlb-xen.c | 2 +- include/linux/swiotlb.h | 7 ---

[PATCH v11 03/12] swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used

2021-06-15 Thread Claire Chang
Always have the pointer to the swiotlb pool used in struct device. This could help simplify the code for other pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- drivers/base/core.c| 4 include/linux/device.h | 4 kernel/dma/swiotlb.c | 8 3 files cha

[PATCH v11 02/12] swiotlb: Refactor swiotlb_create_debugfs

2021-06-15 Thread Claire Chang
Split the debugfs creation to make the code reusable for supporting different bounce buffer pools. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/kernel/dma/swiotlb.c

[PATCH v11 01/12] swiotlb: Refactor swiotlb init functions

2021-06-15 Thread Claire Chang
Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct initialization to make the code reusable. Signed-off-by: Claire Chang Reviewed-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 49 ++-- 1 file changed, 24 insertions(+), 25 deletions(

[PATCH v11 00/12] Restricted DMA

2021-06-15 Thread Claire Chang
This series implements mitigations for lack of DMA access control on systems without an IOMMU, which could result in the DMA accessing the system memory at unexpected times and/or unexpected addresses, possibly leading to data leakage or corruption. For example, we plan to use the PCI-e bus for Wi

Re: Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Athira Rajeev
> On 16-Jun-2021, at 8:53 AM, Madhavan Srinivasan wrote: > > > On 6/15/21 8:35 PM, Christophe Leroy wrote: >> For your information, I'm getting the following Oops. Detected with >> 5.13-rc6, it also oopses on 5.12 and 5.11. >> Runs ok on 5.10. I'm starting bisecting now. > > > Thanks for r

[powerpc:next] BUILD SUCCESS ddf4a7bcd09439e82c4d6f959f4ff6c53f07466f

2021-06-15 Thread kernel test robot
allnoconfig x86_64 randconfig-a001-20210615 x86_64 randconfig-a004-20210615 x86_64 randconfig-a002-20210615 x86_64 randconfig-a003-20210615 x86_64 randconfig-a006-20210615 x86_64 randconfig-a005-20210615 i386

[powerpc:next-test] BUILD REGRESSION 103bf32b0d2dd8b8a4d3d9ebdded5ba4e8263e6a

2021-06-15 Thread kernel test robot
-powerpc-lib-restart_table.c:warning:no-previous-prototype-for-search_kernel_restart_table `-- x86_64-allnoconfig `-- arch-powerpc-kernel-interrupt_64.S:asm-head-.h-is-included-more-than-once. clang_recent_errors `-- powerpc-randconfig-r012-20210615 |-- arch-powerpc-kernel

[powerpc:fixes-test] BUILD SUCCESS 478036c4cd1a16e613a2f883d79c03cf187faacb

2021-06-15 Thread kernel test robot
allnoconfig x86_64 randconfig-a001-20210615 x86_64 randconfig-a004-20210615 x86_64 randconfig-a002-20210615 x86_64 randconfig-a003-20210615 x86_64 randconfig-a006-20210615 x86_64 randconfig-a005-20210615

Re: Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Madhavan Srinivasan
On 6/15/21 8:35 PM, Christophe Leroy wrote: For your information, I'm getting the following Oops. Detected with 5.13-rc6, it also oopses on 5.12 and 5.11. Runs ok on 5.10. I'm starting bisecting now. Thanks for reporting, got the issue. What has happened in this case is that, pmu device is

[PATCH 6/8] powerpc/membarrier: Remove special barrier on mm switch

2021-06-15 Thread Andy Lutomirski
powerpc did the following on some, but not all, paths through switch_mm_irqs_off(): /* * Only need the full barrier when switching between processes. * Barrier when switching from kernel to userspace is not * required here, given that it is implied by mmdrop(). Barri

[PATCH 8/8] membarrier: Rewrite sync_core_before_usermode() and improve documentation

2021-06-15 Thread Andy Lutomirski
The old sync_core_before_usermode() comments suggested that a non-icache-syncing return-to-usermode instruction is x86-specific and that all other architectures automatically notice cross-modified code on return to userspace. This is misleading. The incantation needed to modify code from one CPU

Re: [PATCH] powerpc: Fix initrd corruption with relative jump labels

2021-06-15 Thread Michael Ellerman
Roman Bolshakov writes: > On Mon, Jun 14, 2021 at 11:14:40PM +1000, Michael Ellerman wrote: >> Commit b0b3b2c78ec0 ("powerpc: Switch to relative jump labels") switched >> us to using relative jump labels. That involves changing the code, >> target and key members in struct jump_entry to be relativ

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Michael Ellerman
Segher Boessenkool writes: > On Tue, Jun 15, 2021 at 03:41:00PM +0200, Jessica Yu wrote: >> +++ Segher Boessenkool [15/06/21 07:50 -0500]: >> >On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: >> >>+int __weak elf_check_module_arch(Elf_Ehdr *hdr) >> >>+{ >> >>+ return 1; >> >>+} >>

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Michael Ellerman
Jessica Yu writes: > +++ Nicholas Piggin [15/06/21 12:05 +1000]: >>Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: >>> +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but kernel modules may have more specific requir

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-06-15 Thread Michael Ellerman
Rob Herring writes: > On Tue, Jun 15, 2021 at 10:13 AM nramas wrote: >> >> On Tue, 2021-06-15 at 08:01 -0600, Rob Herring wrote: >> > On Tue, Jun 15, 2021 at 6:18 AM Geert Uytterhoeven < >> > ge...@linux-m68k.org> wrote: >> > > >> > > > +void *of_kexec_alloc_and_setup_fdt(const struct kimage *ima

Re: [PATCH v7 00/11] Speedup mremap on ppc64

2021-06-15 Thread Nicholas Piggin
Excerpts from Linus Torvalds's message of June 9, 2021 3:10 am: > On Mon, Jun 7, 2021 at 3:10 AM Nick Piggin wrote: >> >> I'd really rather not do this, I'm not sure if micro benchmark captures >> everything. > > I don't much care what powerpc code does _itnernally_ for this > architecture-speci

Re: [PATCH v3 00/11] powerpc/64: fast interrupt exits

2021-06-15 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of June 16, 2021 12:07 am: > Nicholas Piggin writes: >> This series attempts to improve the speed of interrupts and system calls >> in three major ways. > > With the full series applied I'm seeing various warnings. Gah, sorry :( I've tested hash/radix gue

Re: [PATCH v3 11/11] powerpc/64: use interrupt restart table to speed up return from interrupt

2021-06-15 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of June 15, 2021 11:44 pm: > Nicholas Piggin writes: >> diff --git a/arch/powerpc/lib/feature-fixups.c >> b/arch/powerpc/lib/feature-fixups.c >> index fe26f2fa0f3f..fbe94e2d5011 100644 >> --- a/arch/powerpc/lib/feature-fixups.c >> +++ b/arch/powerpc/lib/fe

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Nicholas Piggin
Excerpts from Jessica Yu's message of June 15, 2021 10:17 pm: > +++ Nicholas Piggin [15/06/21 12:05 +1000]: >>Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: >>> +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but ke

Re: [PATCH v2] selftests/powerpc: Always test lmw and stmw

2021-06-15 Thread Michael Ellerman
Jordan Niethe writes: > Load Multiple Word (lmw) and Store Multiple Word (stmw) will raise an > Alignment Exception: > - Little Endian mode: always > - Big Endian mode: address not word aligned > > These conditions do not depend on cache inhibited memory. Test the > alignment handler emulation

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

2021-06-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of June 16, 2021 10:14 am: > On 6/14/21 5:55 PM, Nicholas Piggin wrote: >> Excerpts from Andy Lutomirski's message of June 15, 2021 2:20 am: >>> Replying to several emails at once... >>> > >> >> So the only documentation relating to the current active_mm va

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

2021-06-15 Thread Andy Lutomirski
On 6/14/21 5:55 PM, Nicholas Piggin wrote: > Excerpts from Andy Lutomirski's message of June 15, 2021 2:20 am: >> Replying to several emails at once... >> > > So the only documentation relating to the current active_mm value or > refcounting is that it may not match what the x86 specific code is

Re: [RFC] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-06-15 Thread Michael Ellerman
Fabiano Rosas writes: > Pratik Sampat writes: ... >>> The new H_CALL exports information in direct string value format, hence a new interface has been introduced in /sys/firmware/papr to export >>> Hm.. Maybe this should be something less generic than "papr"? >> >> The interface naming

+ mm-rename-p4d_page_vaddr-to-p4d_pgtable-and-make-it-return-pud_t.patch added to -mm tree

2021-06-15 Thread akpm
The patch titled Subject: mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t * has been added to the -mm tree. Its filename is mm-rename-p4d_page_vaddr-to-p4d_pgtable-and-make-it-return-pud_t.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/br

+ mm-rename-pud_page_vaddr-to-pud_pgtable-and-make-it-return-pmd_t.patch added to -mm tree

2021-06-15 Thread akpm
The patch titled Subject: mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t * has been added to the -mm tree. Its filename is mm-rename-pud_page_vaddr-to-pud_pgtable-and-make-it-return-pmd_t.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/br

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

2021-06-15 Thread Konrad Rzeszutek Wilk
On Tue, Jun 15, 2021 at 09:27:02PM +0800, Claire Chang wrote: > Always have the pointer to the swiotlb pool used in struct device. This > could help simplify the code for other pools. Applying: swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used error: patch failed: kernel/dma/swiotlb.c:339

Re: [PATCH] powerpc: Fix initrd corruption with relative jump labels

2021-06-15 Thread Anastasia Kovaleva
> On 14 Jun 2021, at 16:14, Michael Ellerman wrote: > > Commit b0b3b2c78ec0 ("powerpc: Switch to relative jump labels") switched > us to using relative jump labels. That involves changing the code, > target and key members in struct jump_entry to be relative to the > address of the jump_entry,

[powerpc:next-test 119/124] arch/powerpc/kernel/interrupt.c:378:23: warning: no previous prototype for 'syscall_exit_restart'

2021-06-15 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: 103bf32b0d2dd8b8a4d3d9ebdded5ba4e8263e6a commit: 88a293b28ae07acc86b09ebbe8715bcee412a63e [119/124] powerpc/64: use interrupt restart table to speed up return from interrupt config: powerpc-allyesconfig (a

[powerpc:next-test 116/124] arch/powerpc/lib/restart_table.c:13:15: warning: no previous prototype for 'search_kernel_restart_table'

2021-06-15 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: 103bf32b0d2dd8b8a4d3d9ebdded5ba4e8263e6a commit: 9d1e5f27172b011ed4d07c92c304fa60caef03ff [116/124] powerpc/64: allow alternate return locations for soft-masked interrupts config: powerpc-allyesconfig (att

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-06-15 Thread Rob Herring
On Tue, Jun 15, 2021 at 10:13 AM nramas wrote: > > On Tue, 2021-06-15 at 08:01 -0600, Rob Herring wrote: > > On Tue, Jun 15, 2021 at 6:18 AM Geert Uytterhoeven < > > ge...@linux-m68k.org> wrote: > > > > > > > +void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, > > > > +

Re: [PATCH 09/30] mtd_blkdevs: use blk_mq_alloc_disk

2021-06-15 Thread Marek Szyprowski
Hi Christoph, On 15.06.2021 17:58, Christoph Hellwig wrote: > On Tue, Jun 15, 2021 at 05:47:44PM +0200, Marek Szyprowski wrote: >> On 02.06.2021 08:53, Christoph Hellwig wrote: >>> Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue >>> allocation. >>> >>> Signed-off-by: Christ

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-06-15 Thread nramas
On Tue, 2021-06-15 at 08:01 -0600, Rob Herring wrote: > On Tue, Jun 15, 2021 at 6:18 AM Geert Uytterhoeven < > ge...@linux-m68k.org> wrote: > > > > > +void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, > > > + unsigned long > > > initrd_load_addr, > > >

Re: [PATCH 09/30] mtd_blkdevs: use blk_mq_alloc_disk

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 05:47:44PM +0200, Marek Szyprowski wrote: > Hi, > > On 02.06.2021 08:53, Christoph Hellwig wrote: > > Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue > > allocation. > > > > Signed-off-by: Christoph Hellwig > > This patch landed in linux-next as co

Re: [PATCH 09/30] mtd_blkdevs: use blk_mq_alloc_disk

2021-06-15 Thread Marek Szyprowski
Hi, On 02.06.2021 08:53, Christoph Hellwig wrote: > Use the blk_mq_alloc_disk API to simplify the gendisk and request_queue > allocation. > > Signed-off-by: Christoph Hellwig This patch landed in linux-next as commit 6966bb921def ("mtd_blkdevs: use blk_mq_alloc_disk"). It causes the following r

[PATCH AUTOSEL 5.10 07/30] ASoC: fsl-asoc-card: Set .owner attribute when registering card.

2021-06-15 Thread Sasha Levin
From: Nicolas Cavallari [ Upstream commit a8437f05384cb472518ec21bf4fffbe8f0a47378 ] Otherwise, when compiled as module, a WARN_ON is triggered: WARNING: CPU: 0 PID: 5 at sound/core/init.c:208 snd_card_new+0x310/0x39c [snd] [...] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.10.39 #1 Hardware n

[PATCH AUTOSEL 5.12 07/33] ASoC: fsl-asoc-card: Set .owner attribute when registering card.

2021-06-15 Thread Sasha Levin
From: Nicolas Cavallari [ Upstream commit a8437f05384cb472518ec21bf4fffbe8f0a47378 ] Otherwise, when compiled as module, a WARN_ON is triggered: WARNING: CPU: 0 PID: 5 at sound/core/init.c:208 snd_card_new+0x310/0x39c [snd] [...] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.10.39 #1 Hardware n

Re: [PATCH kernel v2] powerpc/powernv: Reserve a hole which appears after enabling IOV

2021-06-15 Thread Bjorn Helgaas
On Wed, Sep 27, 2017 at 04:52:31PM +1000, Alexey Kardashevskiy wrote: > In order to make generic IOV code work, the physical function IOV BAR > should start from offset of the first VF. Since M64 segments share > PE number space across PHB, and some PEs may be in use at the time > when IOV is enabl

Oops (NULL pointer) with 'perf record' of selftest 'null_syscall'

2021-06-15 Thread Christophe Leroy
For your information, I'm getting the following Oops. Detected with 5.13-rc6, it also oopses on 5.12 and 5.11. Runs ok on 5.10. I'm starting bisecting now. root@vgoippro:/tmp# perf record /root/null_syscall [ 285.559987] BUG: Kernel NULL pointer dereference on read at 0x0040 [ 285.566533]

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Segher Boessenkool
On Tue, Jun 15, 2021 at 03:41:00PM +0200, Jessica Yu wrote: > +++ Segher Boessenkool [15/06/21 07:50 -0500]: > >On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: > >>+int __weak elf_check_module_arch(Elf_Ehdr *hdr) > >>+{ > >>+ return 1; > >>+} > > > >But is this a good idea? It is

Re: [PATCH v12 0/6] KASAN core changes for ppc64 radix KASAN

2021-06-15 Thread Marco Elver
[+Cc Andrey] On Tue, 15 Jun 2021 at 03:47, Daniel Axtens wrote: > > Building on the work of Christophe, Aneesh and Balbir, I've ported > KASAN to 64-bit Book3S kernels running on the Radix MMU. > > I've been trying this for a while, but we keep having collisions > between the kasan code in the mm

Re: [PATCH v12 2/6] kasan: allow architectures to provide an outline readiness check

2021-06-15 Thread Marco Elver
On Tue, 15 Jun 2021 at 03:47, Daniel Axtens wrote: > > Allow architectures to define a kasan_arch_is_ready() hook that bails > out of any function that's about to touch the shadow unless the arch > says that it is ready for the memory to be accessed. This is fairly > uninvasive and should have a n

Re: [PATCH v3 00/11] powerpc/64: fast interrupt exits

2021-06-15 Thread Michael Ellerman
Nicholas Piggin writes: > This series attempts to improve the speed of interrupts and system calls > in three major ways. With the full series applied I'm seeing various warnings. I feel like I must be missing some lead up patch? cheers mambo, p8, hash, be: [0.001038][T0] ---

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-06-15 Thread Rob Herring
On Tue, Jun 15, 2021 at 6:18 AM Geert Uytterhoeven wrote: > > Hi Lakshmi and Rob, > > On Sun, Feb 21, 2021 at 6:52 PM Lakshmi Ramasubramanian > wrote: > > From: Rob Herring > > > > Both arm64 and powerpc do essentially the same FDT /chosen setup for > > kexec. The differences are either omissio

Re: [PATCH v3 11/11] powerpc/64: use interrupt restart table to speed up return from interrupt

2021-06-15 Thread Michael Ellerman
Nicholas Piggin writes: > diff --git a/arch/powerpc/lib/feature-fixups.c > b/arch/powerpc/lib/feature-fixups.c > index fe26f2fa0f3f..fbe94e2d5011 100644 > --- a/arch/powerpc/lib/feature-fixups.c > +++ b/arch/powerpc/lib/feature-fixups.c > @@ -412,12 +430,19 @@ void do_entry_flush_fixups(enum l1d_

Re: [PATCH v10 10/12] swiotlb: Add restricted DMA alloc/free support

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 09:27:09PM +0800, Claire Chang wrote: > Add the functions, swiotlb_{alloc,free} to support the memory allocation > from restricted DMA pool. > > The restricted DMA pool is preferred if available. > > Note that since coherent allocation needs remapping, one must set up > an

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Jessica Yu
+++ Segher Boessenkool [15/06/21 07:50 -0500]: On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: +int __weak elf_check_module_arch(Elf_Ehdr *hdr) +{ + return 1; +} But is this a good idea? It isn't useful to be able to attempt to load a module not compiled for your architectur

Re: [PATCH] powerpc: Fix initrd corruption with relative jump labels

2021-06-15 Thread Roman Bolshakov
On Mon, Jun 14, 2021 at 11:14:40PM +1000, Michael Ellerman wrote: > Commit b0b3b2c78ec0 ("powerpc: Switch to relative jump labels") switched > us to using relative jump labels. That involves changing the code, > target and key members in struct jump_entry to be relative to the > address of the jump

Re: [PATCH v10 09/12] swiotlb: Add restricted DMA pool initialization

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 09:27:08PM +0800, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes. > > Regardless of swiotlb setting, the restricted DMA pool is preferred if > available. > > The restricted DMA pools provide a basi

Re: [PATCH v10 08/12] swiotlb: Refactor swiotlb_tbl_unmap_single

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

Re: [PATCH v10 07/12] swiotlb: Move alloc_size to swiotlb_find_slots

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 09:27:06PM +0800, Claire Chang wrote: > Rename find_slots to swiotlb_find_slots and move the maintenance of > alloc_size to it for better code reusability later. > > Signed-off-by: Claire Chang Looks good, Reviewed-by: Christoph Hellwig

  1   2   >