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

[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

[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

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 >

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

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

[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

[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

[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(-)

[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 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

[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

[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

[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 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

[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:

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 > >> [

[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 @@

[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 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

[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 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

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!

[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

[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().

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

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 >> +#

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: 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

[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

[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 +++

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

[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

[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

[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

[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

[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

[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 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 +-

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.

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,

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

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 >> +++

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

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

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

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

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

+ 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

+ 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

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 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

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 >

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

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

[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

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

2021-06-15 Thread Christophe Leroy
Le 14/06/2021 à 13:49, Christophe Leroy a écrit : Le 14/06/2021 à 07:49, Nicholas Piggin a écrit : 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:

Re: [RFC PATCH 8/8] powerpc/papr_scm: Use FORM2 associativity details

2021-06-15 Thread David Gibson
On Tue, Jun 15, 2021 at 11:27:50AM +0530, Aneesh Kumar K.V wrote: > David Gibson writes: > > > On Mon, Jun 14, 2021 at 10:10:03PM +0530, Aneesh Kumar K.V wrote: > >> FORM2 introduce a concept of secondary domain which is identical to the > >> conceept of FORM1 primary domain. Use secondary

Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'

2021-06-15 Thread Christophe Leroy
Le 15/06/2021 à 09:18, Michael Ellerman a écrit : Christophe Leroy writes: This series is a cleanup of the use of 'struct ppc_inst'. A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of

Re: [PATCH 5/7] signal: Add unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christophe Leroy
Le 15/06/2021 à 09:21, Christoph Hellwig a écrit : On Tue, Jun 15, 2021 at 09:03:42AM +0200, Christophe Leroy wrote: Le 15/06/2021 ?? 08:52, Christoph Hellwig a ??crit??: On Tue, Jun 15, 2021 at 06:41:01AM +, Christophe Leroy wrote: + unsafe_copy_to_user(__ucs_to, __ucs_from,

Re: [RFC PATCH 7/8] powerpc/pseries: Add support for FORM2 associativity

2021-06-15 Thread David Gibson
On Tue, Jun 15, 2021 at 10:58:42AM +0530, Aneesh Kumar K.V wrote: > David Gibson writes: > > > On Mon, Jun 14, 2021 at 10:10:02PM +0530, Aneesh Kumar K.V wrote: > >> Signed-off-by: Daniel Henrique Barboza > >> Signed-off-by: Aneesh Kumar K.V > >> --- > >>

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

2021-06-15 Thread Haren Myneni
On Mon, 2021-06-14 at 12:55 +1000, Nicholas Piggin wrote: > 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

Re: [RFC PATCH 8/8] powerpc/papr_scm: Use FORM2 associativity details

2021-06-15 Thread Aneesh Kumar K.V
David Gibson writes: > On Tue, Jun 15, 2021 at 11:27:50AM +0530, Aneesh Kumar K.V wrote: >> David Gibson writes: >> >> > On Mon, Jun 14, 2021 at 10:10:03PM +0530, Aneesh Kumar K.V wrote: >> >> FORM2 introduce a concept of secondary domain which is identical to the >> >> conceept of FORM1

Re: [PATCH 7/7] powerpc/signal: Use unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christoph Hellwig
> @@ -836,14 +830,19 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t > *oldset, > asm("dcbst %y0; sync; icbi %y0; sync" :: "Z" (mctx->mc_pad[0])); > } > unsafe_put_sigset_t(>uc.uc_sigmask, oldset, failed); > +#ifndef CONFIG_COMPAT > +

[PATCH 1/3] powerpc/cacheinfo: Lookup cache by dt node and thread-group id

2021-06-15 Thread Parth Shah
From: "Gautham R. Shenoy" Currently the cacheinfo code on powerpc indexes the "cache" objects (modelling the L1/L2/L3 caches) where the key is device-tree node corresponding to that cache. On some of the POWER server platforms thread-groups within the core share different sets of caches (Eg: On

[PATCH 2/3] powerpc/cacheinfo: Remove the redundant get_shared_cpu_map()

2021-06-15 Thread Parth Shah
From: "Gautham R. Shenoy" The helper function get_shared_cpu_map() was added in 'commit 500fe5f550ec ("powerpc/cacheinfo: Report the correct shared_cpu_map on big-cores")' and subsequently expanded upon in 'commit 0be47634db0b ("powerpc/cacheinfo: Print correct cache-sibling map/list for L2

Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'

2021-06-15 Thread Michael Ellerman
Christophe Leroy writes: > This series is a cleanup of the use of 'struct ppc_inst'. > > A confusion is made between internal representation of powerpc > instructions with 'struct ppc_inst' and in-memory code which is > and will always be an array of 'unsigned int'. Why don't we use u32 *, to

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

2021-06-15 Thread Haren Myneni
On Mon, 2021-06-14 at 12:55 +1000, Nicholas Piggin wrote: > 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

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

2021-06-15 Thread Viresh Kumar
Hi Qian, First of all thanks for testing this, I need more of your help to test this out :) FWIW, I did test this on my Hikey board today, with some hacks, and tried multiple insmod/rmmod operations for the driver, and I wasn't able to reproduce the issue you reported. I did enable the

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

2021-06-15 Thread Haren Myneni
On Mon, 2021-06-14 at 12:24 +1000, Nicholas Piggin wrote: > 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

[PATCH 7/7] powerpc/signal: Use unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christophe Leroy
Use unsafe_copy_siginfo_to_user() in order to do the copy within the user access block. On an mpc 8321 (book3s/32) the improvment is about 5% on a process sending a signal to itself. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 13 ++---

[PATCH 5/7] signal: Add unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christophe Leroy
In the same spirit as commit fb05121fd6a2 ("signal: Add unsafe_get_compat_sigset()"), implement an 'unsafe' version of copy_siginfo_to_user() in order to use it within user access blocks. For that, also add an 'unsafe' version of clear_user(). Signed-off-by: Christophe Leroy ---

[PATCH 6/7] powerpc/uaccess: Add unsafe_clear_user()

2021-06-15 Thread Christophe Leroy
Implement unsafe_clear_user() for powerpc. It's a copy/paste of unsafe_copy_to_user() with value 0 as source. It may be improved in a later patch by using 'dcbz' instruction to zeroize full cache lines at once. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/uaccess.h | 20

Re: [PATCH 5/7] signal: Add unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 09:03:42AM +0200, Christophe Leroy wrote: > > > Le 15/06/2021 ?? 08:52, Christoph Hellwig a ??crit??: > > On Tue, Jun 15, 2021 at 06:41:01AM +, Christophe Leroy wrote: > > > + unsafe_copy_to_user(__ucs_to, __ucs_from, \ > > > +

Re: [PATCH 2/2] selftests: Skip TM tests on synthetic TM implementations

2021-06-15 Thread Jordan Niethe
On Tue, Jun 8, 2021 at 9:37 AM Jordan Niethe wrote: > > Transactional Memory was removed from the architecture in ISA v3.1. For > threads running in P8/P9 compatibility mode on P10 a synthetic TM > implementation is provided. In this implementation, tbegin. always sets > cr0 eq meaning the abort

[PATCH 4/7] powerpc/signal: Include the new stack frame inside the user access block

2021-06-15 Thread Christophe Leroy
Include the new stack frame inside the user access block and set it up using unsafe_put_user(). On an mpc 8321 (book3s/32) the improvment is about 4% on a process sending a signal to itself. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_32.c | 29 +

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

2021-06-15 Thread Christophe Leroy
From: Michael Ellerman 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 sigframe in user memory, even though the values in user

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

2021-06-15 Thread Christophe Leroy
From: Michael Ellerman 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_siginfo_to_user() was moved later in the function, so

[PATCH 3/7] powerpc/signal64: Access function descriptor with user access block

2021-06-15 Thread Christophe Leroy
Access the function descriptor of the handler within a user access block. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/signal_64.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c

Re: [PATCH 5/7] signal: Add unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 06:41:01AM +, Christophe Leroy wrote: > + unsafe_copy_to_user(__ucs_to, __ucs_from, \ > + sizeof(struct kernel_siginfo), label); \ > + unsafe_clear_user(__ucs_expansion, SI_EXPANSION_SIZE, label); \ > +} while

Re: [PATCH 5/7] signal: Add unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christophe Leroy
Le 15/06/2021 à 08:52, Christoph Hellwig a écrit : On Tue, Jun 15, 2021 at 06:41:01AM +, Christophe Leroy wrote: + unsafe_copy_to_user(__ucs_to, __ucs_from, \ + sizeof(struct kernel_siginfo), label); \ +

[PATCH 0/3] Make cache-object aware of L3 siblings by parsing "ibm, thread-groups" property

2021-06-15 Thread Parth Shah
On POWER10 big-core system, the L3 cache reflected by sysfs contains all the CPUs in the big-core. grep . /sys/devices/system/cpu/cpu0/cache/index*/shared_cpu_list /sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list:0,2,4,6 /sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list:0,2,4,6

Re: [RFC PATCH 7/8] powerpc/pseries: Add support for FORM2 associativity

2021-06-15 Thread Aneesh Kumar K.V
David Gibson writes: > On Tue, Jun 15, 2021 at 10:58:42AM +0530, Aneesh Kumar K.V wrote: >> David Gibson writes: >> >> > On Mon, Jun 14, 2021 at 10:10:02PM +0530, Aneesh Kumar K.V wrote: >> >> Signed-off-by: Daniel Henrique Barboza >> >> Signed-off-by: Aneesh Kumar K.V >> >> --- >> >>

Re: [PATCH 6/7] powerpc/uaccess: Add unsafe_clear_user()

2021-06-15 Thread Christoph Hellwig
On Tue, Jun 15, 2021 at 06:41:02AM +, Christophe Leroy wrote: > Implement unsafe_clear_user() for powerpc. > It's a copy/paste of unsafe_copy_to_user() with value 0 as source. > > It may be improved in a later patch by using 'dcbz' instruction > to zeroize full cache lines at once. Please

Re: [PATCH 7/7] powerpc/signal: Use unsafe_copy_siginfo_to_user()

2021-06-15 Thread Christophe Leroy
Le 15/06/2021 à 08:55, Christoph Hellwig a écrit : @@ -836,14 +830,19 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, asm("dcbst %y0; sync; icbi %y0; sync" :: "Z" (mctx->mc_pad[0])); } unsafe_put_sigset_t(>uc.uc_sigmask, oldset, failed);

Re: [PATCH 6/7] powerpc/uaccess: Add unsafe_clear_user()

2021-06-15 Thread Christophe Leroy
Le 15/06/2021 à 08:53, Christoph Hellwig a écrit : On Tue, Jun 15, 2021 at 06:41:02AM +, Christophe Leroy wrote: Implement unsafe_clear_user() for powerpc. It's a copy/paste of unsafe_copy_to_user() with value 0 as source. It may be improved in a later patch by using 'dcbz' instruction

[PATCH 3/3] powerpc/smp: Use existing L2 cache_map cpumask to find L3 cache siblings

2021-06-15 Thread Parth Shah
On POWER10 systems, the "ibm,thread-groups" property "2" indicates the cpus in thread-group share both L2 and L3 caches. Hence, use cache_property = 2 itself to find both the L2 and L3 cache siblings. Hence, rename existing macros to detect if the cache property is for L2 or L3 and use the L2

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

2021-06-15 Thread Jessica Yu
+++ 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 requirements. powerpc would like to

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

2021-06-15 Thread Geert Uytterhoeven
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 omissions that arm64 should have > or additional properties that will be ignored.

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 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 architecture, and it increases the attack surface

switch the block layer to use kmap_local_page v2

2021-06-15 Thread Christoph Hellwig
Hi all, this series switches the core block layer code and all users of the existing bvec kmap helpers to use kmap_local_page. Drivers that currently use open coded kmap_atomic calls will converted in a follow on series. To do so a new kunmap variant is added that calls

[PATCH 01/18] mm: add a kunmap_local_dirty helper

2021-06-15 Thread Christoph Hellwig
Add a helper that calls flush_kernel_dcache_page before unmapping the local mapping. flush_kernel_dcache_page is required for all pages potentially mapped into userspace that were written to using kmap*, so having a helper that does the right thing can be very convenient. Signed-off-by:

[PATCH 02/18] mm: use kunmap_local_dirty in memcpy_to_page

2021-06-15 Thread Christoph Hellwig
memcpy_to_page can write to potentially mapped page cache pages, so use kunmap_local_dirty to make sure flush_kernel_dcache_pages is called. Signed-off-by: Christoph Hellwig --- include/linux/highmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/highmem.h

[PATCH 03/18] mm: use kmap_local_page in memzero_page

2021-06-15 Thread Christoph Hellwig
No need for kmap_atomic here. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ira Weiny --- include/linux/highmem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index

[PATCH 04/18] MIPS: don't include in

2021-06-15 Thread Christoph Hellwig
There is no need to include genhd.h from a random arch header, and not doing so prevents the possibility for nasty include loops. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ira Weiny --- arch/mips/include/asm/mach-rc32434/rb.h | 2 -- 1 file changed, 2

[PATCH v10 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 --- drivers/iommu/dma-iommu.c | 12 ++-- drivers/xen/swiotlb-xen.c | 2 +- include/linux/swiotlb.h | 7 --- kernel/dma/direct.c |

[PATCH v10 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 --- drivers/base/core.c| 4 include/linux/device.h | 4 kernel/dma/swiotlb.c | 8 3 files changed, 12 insertions(+), 4

[PATCH 06/18] bvec: add a bvec_kmap_local helper

2021-06-15 Thread Christoph Hellwig
Add a helper to call kmap_local_page on a bvec. There is no need for an unmap helper given that kunmap_local accept any address in the mapped page. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ira Weiny --- include/linux/bvec.h | 13 + 1 file

  1   2   >