Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Christophe Leroy
Hi, On 08/05/2020 06:40 PM, Segher Boessenkool wrote: Hi! On Wed, Aug 05, 2020 at 04:40:16PM +, Christophe Leroy wrote: It cannot optimise it because it does not know shift < 32. The code below is incorrect for shift equal to 32, fwiw. Is there a way to tell it ? Sure, for example

Re: [PATCH 1/2] sched/topology: Allow archs to override cpu_smt_mask

2020-08-05 Thread Michael Ellerman
pet...@infradead.org writes: > On Tue, Aug 04, 2020 at 05:40:07PM +0530, Srikar Dronamraju wrote: >> * pet...@infradead.org [2020-08-04 12:45:20]: >> >> > On Tue, Aug 04, 2020 at 09:03:06AM +0530, Srikar Dronamraju wrote: >> > > cpu_smt_mask tracks topology_sibling_cpumask. This would be good

[powerpc:merge] BUILD SUCCESS 3cd2184115b85cc8242fec3d42529cd112962984

2020-08-05 Thread kernel test robot
randconfig-a005-20200805 i386 randconfig-a004-20200805 i386 randconfig-a001-20200805 i386 randconfig-a003-20200805 i386 randconfig-a002-20200805 i386 randconfig-a006-20200805 x86_64 randconfig-a013-20200805 x86_64

[powerpc:next] BUILD SUCCESS a7aaa2f26bfd932a654706b19859e7adf802bee2

2020-08-05 Thread kernel test robot
allyesconfig mips allmodconfig powerpc defconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a005-20200805 i386

Re: [PATCH v2 2/5] powerpc/lib: Initialize a temporary mm for code patching

2020-08-05 Thread Daniel Axtens
"Christopher M. Riedl" writes: > When code patching a STRICT_KERNEL_RWX kernel the page containing the > address to be patched is temporarily mapped with permissive memory > protections. Currently, a per-cpu vmalloc patch area is used for this > purpose. While the patch area is per-cpu, the

Re: [PATCH] powerpc/40x: Fix assembler warning about r0

2020-08-05 Thread Michael Ellerman
Christophe Leroy writes: > Le 22/07/2020 à 04:24, Michael Ellerman a écrit : >> The assembler says: >>arch/powerpc/kernel/head_40x.S:623: Warning: invalid register expression > > I get exactly the same with head_32.S, for the exact same reason. Ah yep, I see it. I mostly build

Re: [PATCH v8 5/8] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Michael Ellerman
Segher Boessenkool writes: > On Wed, Aug 05, 2020 at 04:24:16PM +1000, Michael Ellerman wrote: >> Christophe Leroy writes: >> > Indeed, 32-bit doesn't have a redzone, so I believe it needs a stack >> > frame whenever it has anything to same. >> >> Yeah OK that would explain it. >> >> > Here

Re: How would I code a Write to a proc file from within the kernel without reading anything from user space?

2020-08-05 Thread Michael Ellerman
thefirst ECS writes: > In order to help debug a certain discrepancy, I need to "simulate" an "echo 1 > > /proc/file" but doing it from kernel even when root file system is > unavailable. > > I have simulated it just fine via call_usermodehelper (with argv etc of "echo > 1 > /proc/file") from

Re: [PATCH v2 1/5] powerpc/mm: Introduce temporary mm

2020-08-05 Thread Daniel Axtens
Hi Chris, > void __set_breakpoint(int nr, struct arch_hw_breakpoint *brk); > +void __get_breakpoint(int nr, struct arch_hw_breakpoint *brk); > bool ppc_breakpoint_available(void); > #ifdef CONFIG_PPC_ADV_DEBUG_REGS > extern void do_send_trap(struct pt_regs *regs, unsigned long address, >

Re: [PATCH v2] powerpc: Warn about use of smt_snooze_delay

2020-08-05 Thread Joel Stanley
On Tue, 4 Aug 2020 at 11:59, Michael Ellerman wrote: > > Joel Stanley writes: > > It's not done anything for a long time. Save the percpu variable, and > > emit a warning to remind users to not expect it to do anything. > > > > Fixes: 3fa8cad82b94 ("powerpc/pseries/cpuidle: smt-snooze-delay

Re: linux-next: manual merge of the char-misc tree with the powerpc tree

2020-08-05 Thread Stephen Rothwell
Hi all, On Mon, 3 Aug 2020 16:55:46 +1000 Stephen Rothwell wrote: > > Today's linux-next merge of the char-misc tree got a conflict in: > > drivers/misc/ocxl/config.c > > between commit: > > 3591538a31af ("ocxl: Address kernel doc errors & warnings") > > from the powerpc tree and

Re: [PATCH v2 2/2] powerpc/pseries: new lparcfg key/value pair: partition_affinity_score

2020-08-05 Thread Tyrel Datwyler
On 7/27/20 11:46 AM, Scott Cheloha wrote: > The H_GetPerformanceCounterInfo (GPCI) PHYP hypercall has a subcall, > Affinity_Domain_Info_By_Partition, which returns, among other things, > a "partition affinity score" for a given LPAR. This score, a value on > [0-100], represents the

Re: [PATCH v2 1/2] powerpc/perf: consolidate GPCI hcall structs into asm/hvcall.h

2020-08-05 Thread Tyrel Datwyler
On 7/27/20 11:46 AM, Scott Cheloha wrote: > The H_GetPerformanceCounterInfo (GPCI) hypercall input/output structs are > useful to modules outside of perf/, so move them into asm/hvcall.h to live > alongside the other powerpc hypercall structs. > > Leave the perf-specific GPCI stuff in

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-05 Thread Michael Roth
Quoting Michael Roth (2020-08-05 17:29:28) > Quoting Michael Roth (2020-08-04 23:37:32) > > Quoting Michael Ellerman (2020-08-04 22:07:08) > > > Greg Kurz writes: > > > > On Tue, 04 Aug 2020 23:35:10 +1000 > > > > Michael Ellerman wrote: > > > >> Spinning forever seems like a bad idea, but as

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-05 Thread Michael Roth
Quoting Michael Roth (2020-08-04 23:37:32) > Quoting Michael Ellerman (2020-08-04 22:07:08) > > Greg Kurz writes: > > > On Tue, 04 Aug 2020 23:35:10 +1000 > > > Michael Ellerman wrote: > > >> Spinning forever seems like a bad idea, but as has been demonstrated at > > >> least twice now,

Re: [PATCH] macintosh: windfarm: fix spelling mistake "detatch" -> "detach"

2020-08-05 Thread Wolfram Sang
On Wed, Aug 05, 2020 at 11:43:37AM +0100, Colin King wrote: > From: Colin Ian King > > There are spelling mistakes in DBG messages. Fix them. > > Signed-off-by: Colin Ian King These comments can go entirely. i2c_detach is long history. And for remove, we have debugging output in the driver

Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Segher Boessenkool
Hi! On Wed, Aug 05, 2020 at 06:51:44PM +0200, Christophe Leroy wrote: > Le 05/08/2020 à 16:03, Segher Boessenkool a écrit : > >On Wed, Aug 05, 2020 at 07:09:23AM +, Christophe Leroy wrote: > >>+/* > >>+ * The macros sets two stack frames, one for the caller and one for the > >>callee > >>+ *

Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Segher Boessenkool
Hi! On Wed, Aug 05, 2020 at 04:40:16PM +, Christophe Leroy wrote: > >It cannot optimise it because it does not know shift < 32. The code > >below is incorrect for shift equal to 32, fwiw. > > Is there a way to tell it ? Sure, for example the &31 should work (but it doesn't, with the GCC

Re: [PATCH v5 0/4] Allow bigger 64bit window by removing default DMA window

2020-08-05 Thread Leonardo Bras
Travis reported successful compilation with mpe/merge: https://travis-ci.org/github/LeoBras/linux-ppc/builds/715028857

Re: [PATCH v2 16/17] memblock: implement for_each_reserved_mem_region() using __next_mem_region()

2020-08-05 Thread Miguel Ojeda
On Sun, Aug 2, 2020 at 6:40 PM Mike Rapoport wrote: > > .clang-format| 2 +- The .clang-format bit: Acked-by: Miguel Ojeda Cheers, Miguel

Re: [PATCH v2 17/17] memblock: use separate iterators for memory and reserved regions

2020-08-05 Thread Miguel Ojeda
On Sun, Aug 2, 2020 at 6:41 PM Mike Rapoport wrote: > > .clang-format | 3 ++- The .clang-format bit: Acked-by: Miguel Ojeda Cheers, Miguel

Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Christophe Leroy
Hi Again, Le 05/08/2020 à 16:03, Segher Boessenkool a écrit : Hi! On Wed, Aug 05, 2020 at 07:09:23AM +, Christophe Leroy wrote: +/* + * The macros sets two stack frames, one for the caller and one for the callee + * because there are no requirement for the caller to set a stack frame when

Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Christophe Leroy
Hi, On 08/05/2020 02:03 PM, Segher Boessenkool wrote: Hi! On Wed, Aug 05, 2020 at 07:09:23AM +, Christophe Leroy wrote: +/* + * powerpc specific delta calculation. + * + * This variant removes the masking of the subtraction because the + * clocksource mask of all VDSO capable clocksources

Re: [PATCH][next] dmaengine: Use fallthrough pseudo-keyword

2020-08-05 Thread Tyrel Datwyler
On 8/5/20 6:19 AM, Vinod Koul wrote: > On 27-07-20, 15:34, Gustavo A. R. Silva wrote: > >> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c >> index 2c508ee672b9..9b69716172a4 100644 >> --- a/drivers/dma/pl330.c >> +++ b/drivers/dma/pl330.c >> @@ -1061,16 +1061,16 @@ static bool

Re: [PATCH] powerpc/40x: Fix assembler warning about r0

2020-08-05 Thread Christophe Leroy
Le 22/07/2020 à 04:24, Michael Ellerman a écrit : The assembler says: arch/powerpc/kernel/head_40x.S:623: Warning: invalid register expression I get exactly the same with head_32.S, for the exact same reason. Christophe It's objecting to the use of r0 as the RA argument. That's

[PATCH] powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined

2020-08-05 Thread Christophe Leroy
When MODULES_VADDR is defined, is_module_segment() shall check the address against it instead of checking agains VMALLOC_START. Fixes: 6ca055322da8 ("powerpc/32s: Use dedicated segment for modules with STRICT_KERNEL_RWX") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/book3s32/mmu.c | 7

[PATCH] powerpc/kasan: Fix KASAN_SHADOW_START on BOOK3S_32

2020-08-05 Thread Christophe Leroy
On BOOK3S_32, when we have modules and strict kernel RWX, modules are not in vmalloc space but in a dedicated segment that is below PAGE_OFFSET. So KASAN_SHADOW_START must take it into account. MODULES_VADDR can't be used because it is not defined yet in kasan.h Fixes: 6ca055322da8

Re: [PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Segher Boessenkool
Hi! On Wed, Aug 05, 2020 at 07:09:23AM +, Christophe Leroy wrote: > Provide vdso_shift_ns(), as the generic x >> s gives the following > bad result: > > 18: 35 25 ff e0 addic. r9,r5,-32 > 1c: 41 80 00 10 blt 2c > 20: 7c 64 4c 30 srw r4,r3,r9 > 24: 38 60 00 00

Re: [PATCH v8 5/8] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Segher Boessenkool
Hi! On Wed, Aug 05, 2020 at 04:24:16PM +1000, Michael Ellerman wrote: > Christophe Leroy writes: > > Indeed, 32-bit doesn't have a redzone, so I believe it needs a stack > > frame whenever it has anything to same. > > Yeah OK that would explain it. > > > Here is what I have in libc.so: > > >

[PATCH v2] powerpc/drmem: Don't compute the NUMA node for each LMB

2020-08-05 Thread Laurent Dufour
All the LMB from the same set of ibm,dynamic-memory-v2 property are sharing the same NUMA node. Don't compute that node for each one. Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to lmb_set_nid() have been made instead of 1022. This should prevent some soft lockups when

Re: [PATCH][next] dmaengine: Use fallthrough pseudo-keyword

2020-08-05 Thread Vinod Koul
On 27-07-20, 15:34, Gustavo A. R. Silva wrote: > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > index 2c508ee672b9..9b69716172a4 100644 > --- a/drivers/dma/pl330.c > +++ b/drivers/dma/pl330.c > @@ -1061,16 +1061,16 @@ static bool _start(struct pl330_thread *thrd) > > if

[PATCH] usb: gadget: fix spelling mistake "Dectected" -> "Detected"

2020-08-05 Thread Colin King
From: Colin Ian King There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c

Re: [PATCH v3 2/4] powerpc/sstep: support emulation for vsx vector paired storage access instructions

2020-08-05 Thread Naveen N. Rao
Balamuruhan S wrote: add emulate_step() changes to support vsx vector paired storage access instructions that provides octword operands loads/stores between storage and set of 64 Vector Scalar Registers (VSRs). This should be squashed in with the previous patch. Otherwise, emulation of these

Re: [PATCH] powerpc/drmem: Don't compute the NUMA node for each LMB

2020-08-05 Thread Laurent Dufour
a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Laurent-Dufour/powerpc-drmem-Don-t-compute-the-NUMA-node-for-each-LMB/20200805-173213 base: https://git.kernel.org/pub/scm/linux

Re: [PATCH v2 12/17] arch, drivers: replace for_each_membock() with for_each_mem_range()

2020-08-05 Thread Thomas Bogendoerfer
On Sun, Aug 02, 2020 at 07:35:56PM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > There are several occurrences of the following pattern: > > for_each_memblock(memory, reg) { > start = __pfn_to_phys(memblock_region_memory_base_pfn(reg); > end =

Re: [PATCH v2 17/17] memblock: use separate iterators for memory and reserved regions

2020-08-05 Thread Thomas Bogendoerfer
On Sun, Aug 02, 2020 at 07:36:01PM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > for_each_memblock() is used to iterate over memblock.memory in > a few places that use data from memblock_region rather than the memory > ranges. > > Introduce separate for_each_mem_region() and

Re: [PATCH] powerpc/drmem: Don't compute the NUMA node for each LMB

2020-08-05 Thread kernel test robot
'--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Laurent-Dufour/powerpc-drmem-Don-t-compute-the-NUMA-node-for-each-LMB/20200805-173213 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc

[PATCH] macintosh: windfarm: fix spelling mistake "detatch" -> "detach"

2020-08-05 Thread Colin King
From: Colin Ian King There are spelling mistakes in DBG messages. Fix them. Signed-off-by: Colin Ian King --- drivers/macintosh/windfarm_lm75_sensor.c | 2 +- drivers/macintosh/windfarm_lm87_sensor.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v2 17/17] memblock: use separate iterators for memory and reserved regions

2020-08-05 Thread Baoquan He
On 08/02/20 at 07:36pm, Mike Rapoport wrote: > From: Mike Rapoport > > for_each_memblock() is used to iterate over memblock.memory in > a few places that use data from memblock_region rather than the memory > ranges. > > Introduce separate for_each_mem_region() and

[PATCH] powerpc/drmem: Don't compute the NUMA node for each LMB

2020-08-05 Thread Laurent Dufour
All the LMB from the same set of ibm,dynamic-memory-v2 property are sharing the same NUMA node. Don't compute that node for each one. Tested on a system with 1022 LMBs spread on 4 NUMA nodes, only 4 calls to lmb_set_nid() have been made instead of 1022. This should prevent some soft lockups when

Re: [PATCH v2 16/17] memblock: implement for_each_reserved_mem_region() using __next_mem_region()

2020-08-05 Thread Baoquan He
On 08/02/20 at 07:36pm, Mike Rapoport wrote: > From: Mike Rapoport > > Iteration over memblock.reserved with for_each_reserved_mem_region() used > __next_reserved_mem_region() that implemented a subset of > __next_mem_region(). > > Use __for_each_mem_range() and, essentially,

Re: [PATCH v2 15/17] memblock: remove unused memblock_mem_size()

2020-08-05 Thread Baoquan He
On 08/02/20 at 07:35pm, Mike Rapoport wrote: > From: Mike Rapoport > > The only user of memblock_mem_size() was x86 setup code, it is gone now and > memblock_mem_size() funciton can be removed. > > Signed-off-by: Mike Rapoport > --- > include/linux/memblock.h | 1 - > mm/memblock.c

[PATCH v10 2/5] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Christophe Leroy
Prepare for switching VDSO to generic C implementation in following patch. Here, we: - Prepare the helpers to call the C VDSO functions - Prepare the required callbacks for the C VDSO functions - Prepare the clocksource.h files to define VDSO_ARCH_CLOCKMODES - Add the C trampolines to the generic

[PATCH v10 4/5] powerpc/vdso: Switch VDSO to generic C implementation.

2020-08-05 Thread Christophe Leroy
For VDSO32 on PPC64, we create a fake 32 bits config, on the same principle as MIPS architecture, in order to get the correct parts of the different asm header files. With the C VDSO, the performance is slightly lower, but it is worth it as it will ease maintenance and evolution, and also brings

[PATCH v10 5/5] powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32

2020-08-05 Thread Christophe Leroy
Provides __kernel_clock_gettime64() on vdso32. This is the 64 bits version of __kernel_clock_gettime() which is y2038 compliant. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso32/gettimeofday.S | 9 + arch/powerpc/kernel/vdso32/vdso32.lds.S| 1 +

[PATCH v10 1/5] powerpc/processor: Move cpu_relax() into asm/vdso/processor.h

2020-08-05 Thread Christophe Leroy
cpu_relax() need to be in asm/vdso/processor.h to be used by the C VDSO generic library. Move it there. Signed-off-by: Christophe Leroy --- v9: Forgot to remove cpu_relax() from processor.h in v8 --- arch/powerpc/include/asm/processor.h | 13 ++---

[PATCH v10 0/5] powerpc: switch VDSO to C implementation

2020-08-05 Thread Christophe Leroy
This is the tenth version of a series to switch powerpc VDSO to generic C implementation. Changes since v10 are: - Added a comment explaining the reason for the double stack frame - Moved back .cfi_register lr next to mflr Main changes since v9 are: - Dropped the patches which put the VDSO

[PATCH v10 3/5] powerpc/vdso: Save and restore TOC pointer on PPC64

2020-08-05 Thread Christophe Leroy
On PPC64, the TOC pointer needs to be saved and restored. Suggested-by: Michael Ellerman Signed-off-by: Christophe Leroy --- v9: New. I'm not sure this is really needed, I can't see the VDSO C code doing anything with r2, at least on ppc64_defconfig. So I let you decide whether you take it or

[PATCH v3 2/2] powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_ARCH_31

2020-08-05 Thread Ravi Bangoria
PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 can be used to determine whether we are running on an ISA 3.1 compliant machine. Which is needed to determine DAR behaviour, 512 byte boundary limit etc. This was requested by Pedro Miraglia Franco de Carvalho for extending watchpoint features in gdb. Note that

[PATCH v3 1/2] powerpc/watchpoint/ptrace: Fix SETHWDEBUG when CONFIG_HAVE_HW_BREAKPOINT=N

2020-08-05 Thread Ravi Bangoria
When kernel is compiled with CONFIG_HAVE_HW_BREAKPOINT=N, user can still create watchpoint using PPC_PTRACE_SETHWDEBUG, with limited functionalities. But, such watchpoints are never firing because of the missing privilege settings. Fix that. Reported-by: Pedro Miraglia Franco de Carvalho

[PATCH v3 0/2] powerpc/watchpoint/ptrace: Buf fix plus new feature flag

2020-08-05 Thread Ravi Bangoria
Patch #1 fixes a bug when watchpoint is created with ptrace PPC_PTRACE_SETHWDEBUG and CONFIG_HAVE_HW_BREAKPOINT=N. patch #2 introduce new feature bit PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 which will be set when running on ISA 3.1 compliant machine. v2:

Re: [PATCH v8 5/8] powerpc/vdso: Prepare for switching VDSO to generic C implementation.

2020-08-05 Thread Michael Ellerman
Christophe Leroy writes: > On 07/15/2020 01:04 AM, Michael Ellerman wrote: >> Christophe Leroy writes: >>> Prepare for switching VDSO to generic C implementation in following >>> patch. Here, we: >>> - Modify __get_datapage() to take an offset >>> - Prepare the helpers to call the C VDSO

Re: [PATCH v2 14/17] x86/setup: simplify reserve_crashkernel()

2020-08-05 Thread Baoquan He
On 08/02/20 at 07:35pm, Mike Rapoport wrote: > From: Mike Rapoport > > * Replace magic numbers with defines > * Replace memblock_find_in_range() + memblock_reserve() with > memblock_phys_alloc_range() > * Stop checking for low memory size in reserve_crashkernel_low(). The > allocation from

Re: [PATCH v2 13/17] x86/setup: simplify initrd relocation and reservation

2020-08-05 Thread Mike Rapoport
On Wed, Aug 05, 2020 at 12:20:24PM +0800, Baoquan He wrote: > On 08/02/20 at 07:35pm, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Currently, initrd image is reserved very early during setup and then it > > might be relocated and re-reserved after the initial physical memory > > mapping