[PATCH v3] pseries/drmem: update LMBs after LPM

2021-04-28 Thread Laurent Dufour
After a LPM, the device tree node ibm,dynamic-reconfiguration-memory may be updated by the hypervisor in the case the NUMA topology of the LPAR's memory is updated. This is caught by the kernel, but the memory's node is updated because there is no way to move a memory block between nodes. If

Re: [PATCH] cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards

2021-04-28 Thread Michal Suchánek
On Wed, Apr 28, 2021 at 11:28:48AM +0530, Gautham R Shenoy wrote: > Hello Michal, > > On Sun, Apr 25, 2021 at 01:07:14PM +0200, Michal Suchánek wrote: > > On Sat, Apr 24, 2021 at 01:07:16PM +0530, Vaidyanathan Srinivasan wrote: > > > * Michal Such?nek [2021-04-23 20:42:16]: > > > > > > > On

Re: [PATCH v5 05/16] swiotlb: Add restricted DMA pool initialization

2021-04-28 Thread Steven Price
On 26/04/2021 17:37, Claire Chang wrote: On Fri, Apr 23, 2021 at 7:34 PM Steven Price wrote: [...] But even then if it's not and we have the situation where debugfs==NULL then the debugfs_create_dir() here will cause a subsequent attempt in swiotlb_create_debugfs() to fail (directory already

Re: [PATCH v13 06/14] mm: HUGE_VMAP arch support cleanup

2021-04-28 Thread Christophe Leroy
Le 17/03/2021 à 07:23, Nicholas Piggin a écrit : This changes the awkward approach where architectures provide init functions to determine which levels they can provide large mappings for, to one where the arch is queried for each call. This removes code and indirection, and allows

Re: [PATCH v13 06/14] mm: HUGE_VMAP arch support cleanup

2021-04-28 Thread Christophe Leroy
Le 28/04/2021 à 10:32, Christophe Leroy a écrit : Le 17/03/2021 à 07:23, Nicholas Piggin a écrit : This changes the awkward approach where architectures provide init functions to determine which levels they can provide large mappings for, to one where the arch is queried for each call.

Re: [PATCH 04/17] rtc: cmos: remove cmos_rtc_ops_no_alarm

2021-04-28 Thread Alexandre Belloni
Hello, On 29/04/2021 02:49:46+0800, youling257 wrote: > this patch cause suspend failed on my Bay trail z3735f tablet. > > [ 162.038713] PM: dpm_run_callback(): platform_pm_suspend+0x0/0x40 returns > -22 > [ 162.038760] alarmtimer alarmtimer.0.auto: PM: failed to suspend: error -22 I think I

[PATCH] Add blank line after declarations

2021-04-28 Thread Sanjana Srinidhi
Blank line is added after declarations to maintain code uniformity. Signed-off-by: Sanjana Srinidhi --- drivers/ps3/ps3av.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 9d66257e1da5..c4ea494ce464 100644 --- a/drivers/ps3/ps3av.c +++

Re: [PATCH 04/17] rtc: cmos: remove cmos_rtc_ops_no_alarm

2021-04-28 Thread youling 257
test this patch can fix my problem. 2021-04-29 4:20 GMT+08:00, Alexandre Belloni : > Hello, > > On 29/04/2021 02:49:46+0800, youling257 wrote: >> this patch cause suspend failed on my Bay trail z3735f tablet. >> >> [ 162.038713] PM: dpm_run_callback(): platform_pm_suspend+0x0/0x40 >> returns -22

Re: [PATCH] powerpc: Avoid clang uninitialized warning in __get_user_size_allowed

2021-04-28 Thread Nathan Chancellor
On Tue, Apr 27, 2021 at 07:05:12AM +0200, Christophe Leroy wrote: > > > Le 26/04/2021 à 22:35, Nathan Chancellor a écrit : > > Commit 9975f852ce1b ("powerpc/uaccess: Remove calls to __get_user_bad() > > and __put_user_bad()") switch to BUILD_BUG() in the default case, which > > leaves x

Re: [PATCH 04/17] rtc: cmos: remove cmos_rtc_ops_no_alarm

2021-04-28 Thread youling257
this patch cause suspend failed on my Bay trail z3735f tablet. [ 162.038713] PM: dpm_run_callback(): platform_pm_suspend+0x0/0x40 returns -22 [ 162.038760] alarmtimer alarmtimer.0.auto: PM: failed to suspend: error -22

Re: PPC476 hangs during tlb flush after calling /init in crash kernel with linux 5.4+

2021-04-28 Thread Christophe Leroy
Le 28/04/2021 à 00:42, Eddie James a écrit : On Tue, 2021-04-27 at 19:26 +0200, Christophe Leroy wrote: Hi Eddies, Le 27/04/2021 à 19:03, Eddie James a écrit : Hi all, I'm having a problem in simulation and hardware where my PPC476 processor stops executing instructions after callling

[PATCH] powerpc/Makefile: Add ppc32/ppc64_randconfig targets

2021-04-28 Thread Michael Ellerman
Make it easier to generate a 32 or 64-bit specific randconfig. Requested-by: Randy Dunlap Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Michael Ellerman --- arch/powerpc/Makefile | 10 ++ arch/powerpc/configs/32-bit.config | 1 +

Re: PPC476 hangs during tlb flush after calling /init in crash kernel with linux 5.4+

2021-04-28 Thread Eddie James
On Wed, 2021-04-28 at 08:08 +0200, Christophe Leroy wrote: > > Le 28/04/2021 à 00:42, Eddie James a écrit : > > On Tue, 2021-04-27 at 19:26 +0200, Christophe Leroy wrote: > > > Hi Eddies, > > > > > > Le 27/04/2021 à 19:03, Eddie James a écrit : > > > > Hi all, > > > > > > > > I'm having a

Re: [PATCH] cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards

2021-04-28 Thread Gautham R Shenoy
Hello Michal, On Wed, Apr 28, 2021 at 10:03:26AM +0200, Michal Suchánek wrote: > > > That's a nice detailed explanation. Maybe you could summarize it in the > commit message so that people looking at the patch in the future can > tell where the value comes from. Sure, I will do that and send a

Re: [PATCH net-next v4 2/2] of: net: fix of_get_mac_addr_nvmem() for non-platform devices

2021-04-28 Thread Michael Walle
Am 2021-04-27 01:44, schrieb Benjamin Herrenschmidt: On Mon, 2021-04-26 at 12:54 +0200, Michael Walle wrote: (2) What do you think of eth_get_mac_address(ndev). That is, the Not sure what you mean, eth_platform_get_mac_address() takes the address as an argument. I think what you want is a

[PATCH] powerpc: mpc52xx: fix some pr_debug() issues

2021-04-28 Thread Randy Dunlap
Fix some pr_debug() issues in mpc52xx_pci.c: - use __func__ to print function names - use "%pr" to print struct resource entries - use "%pa" to print a resource_size_t (phys_addr_t) The latter two fix several build warnings: ../arch/powerpc/platforms/52xx/mpc52xx_pci.c: In function

[PATCH v11 1/9] powerpc/mm: Implement set_memory() routines

2021-04-28 Thread Jordan Niethe
From: Russell Currey The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be generic across powerpc's many MMUs. It's possible that this could be optimised to be faster for specific MMUs.

[PATCH v11 0/9] powerpc: Further Strict RWX support

2021-04-28 Thread Jordan Niethe
Adding more Strict RWX support on powerpc, in particular Strict Module RWX. Thanks for all of the feedback everyone. It is now rebased on linux-next. For reference the previous revision is available here: https://lore.kernel.org/linuxppc-dev/20210330045132.722243-1-jniet...@gmail.com/ The

[PATCH v11 9/9] powerpc/32: use set_memory_attr()

2021-04-28 Thread Jordan Niethe
From: Christophe Leroy Use set_memory_attr() instead of the PPC32 specific change_page_attr() change_page_attr() was checking that the address was not mapped by blocks and was handling highmem, but that's unneeded because the affected pages can't be in highmem and block mapping verification is

[PATCH v11 7/9] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2021-04-28 Thread Jordan Niethe
From: Russell Currey To enable strict module RWX on powerpc, set: CONFIG_STRICT_MODULE_RWX=y You should also have CONFIG_STRICT_KERNEL_RWX=y set to have any real security benefit. ARCH_HAS_STRICT_MODULE_RWX is set to require ARCH_HAS_STRICT_KERNEL_RWX. This is due to a quirk in

[PATCH v11 8/9] powerpc/mm: implement set_memory_attr()

2021-04-28 Thread Jordan Niethe
From: Christophe Leroy In addition to the set_memory_xx() functions which allows to change the memory attributes of not (yet) used memory regions, implement a set_memory_attr() function to: - set the final memory protection after init on currently used kernel regions. - enable/disable kernel

[PATCH v11 6/9] powerpc/bpf: Write protect JIT code

2021-04-28 Thread Jordan Niethe
Add the necessary call to bpf_jit_binary_lock_ro() to remove write and add exec permissions to the JIT image after it has finished being written. Without CONFIG_STRICT_MODULE_RWX the image will be writable and executable until the call to bpf_jit_binary_lock_ro(). Signed-off-by: Jordan Niethe

[PATCH v11 3/9] powerpc: Always define MODULES_{VADDR,END}

2021-04-28 Thread Jordan Niethe
If MODULES_{VADDR,END} are not defined set them to VMALLOC_START and VMALLOC_END respectively. This reduces the need for special cases. For example, powerpc's module_alloc() was previously predicated on MODULES_VADDR being defined but now is unconditionally defined. This will be useful reducing

[PATCH v11 2/9] powerpc/lib/code-patching: Set up Strict RWX patching earlier

2021-04-28 Thread Jordan Niethe
setup_text_poke_area() is a late init call so it runs before mark_rodata_ro() and after the init calls. This lets all the init code patching simply write to their locations. In the future, kprobes is going to allocate its instruction pages RO which means they will need setup_text__poke_area() to

[PATCH v11 4/9] powerpc/kprobes: Mark newly allocated probes as ROX

2021-04-28 Thread Jordan Niethe
From: Russell Currey Add the arch specific insn page allocator for powerpc. This allocates ROX pages if STRICT_KERNEL_RWX is enabled. These pages are only written to with patch_instruction() which is able to write RO pages. Reviewed-by: Daniel Axtens Signed-off-by: Russell Currey

[PATCH v11 5/9] powerpc/bpf: Remove bpf_jit_free()

2021-04-28 Thread Jordan Niethe
Commit 74451e66d516 ("bpf: make jited programs visible in traces") added a default bpf_jit_free() implementation. Powerpc did not use the default bpf_jit_free() as powerpc did not set the images read-only. The default bpf_jit_free() called bpf_jit_binary_unlock_ro() is why it could not be used for

Re: [PATCH v11 2/9] powerpc/lib/code-patching: Set up Strict RWX patching earlier

2021-04-28 Thread Christophe Leroy
Le 29/04/2021 à 05:15, Jordan Niethe a écrit : setup_text_poke_area() is a late init call so it runs before mark_rodata_ro() and after the init calls. This lets all the init code patching simply write to their locations. In the future, kprobes is going to allocate its instruction pages RO

[PATCH v2] cpuidle/pseries: Fixup CEDE0 latency only for POWER10 onwards

2021-04-28 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Commit d947fb4c965c ("cpuidle: pseries: Fixup exit latency for CEDE(0)") sets the exit latency of CEDE(0) based on the latency values of the Extended CEDE states advertised by the platform On POWER9 LPARs, the firmwares advertise a very low value of 2us for CEDE1 exit

Re: [PATCH v11 3/9] powerpc: Always define MODULES_{VADDR,END}

2021-04-28 Thread Christophe Leroy
Le 29/04/2021 à 05:15, Jordan Niethe a écrit : If MODULES_{VADDR,END} are not defined set them to VMALLOC_START and VMALLOC_END respectively. This reduces the need for special cases. For example, powerpc's module_alloc() was previously predicated on MODULES_VADDR being defined but now is

[PATCH] powerpc/perf: Update MMCR2 to support event exclude_idle

2021-04-28 Thread Madhavan Srinivasan
struct perf_event_attr supports exclude counting of idle task. This is sent to kernel via perf_event_attr.exclude_idle and in perf tool, user can use ":I" event modifier to enable this for specific event. Monitor Mode Control Register 2 (MMCR2) SPR has control bits for each PMCs to freeze

Re: PPC476 hangs during tlb flush after calling /init in crash kernel with linux 5.4+

2021-04-28 Thread Eddie James
On Wed, 2021-04-28 at 08:08 +0200, Christophe Leroy wrote: > > Le 28/04/2021 à 00:42, Eddie James a écrit : > > On Tue, 2021-04-27 at 19:26 +0200, Christophe Leroy wrote: > > > Hi Eddies, > > > > > > Le 27/04/2021 à 19:03, Eddie James a écrit : > > > > Hi all, > > > > > > > > I'm having a

[RFC PATCH v1 1/4] mm/ioremap: Fix iomap_max_page_shift

2021-04-28 Thread Christophe Leroy
iomap_max_page_shift is expected to contain a page shift, so it can't be a 'bool', has to be an 'unsigned int' And fix the default values: P4D_SHIFT is when huge iomap is allowed. Signed-off-by: Christophe Leroy --- mm/ioremap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[RFC PATCH v1 2/4] mm/hugetlb: Change parameters of arch_make_huge_pte()

2021-04-28 Thread Christophe Leroy
At the time being, arch_make_huge_pte() has the following prototype: pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, struct page *page, int writable); vma is used to get the pages shift or size. vma is also used on Sparc to get vm_flags.

[RFC PATCH v1 0/4] Implement huge VMAP and VMALLOC on powerpc 8xx

2021-04-28 Thread Christophe Leroy
This series is a first tentative to implement huge VMAP and VMALLOC on powerpc 8xx. This series applies on Linux next. For the time being the 8xx specificities are plugged directly into generic mm functions. I have no real idea on how to make it a nice beautiful generic implementation for the time

[RFC PATCH v1 3/4] mm/pgtable: Add stubs for {pmd/pub}_{set/clear}_huge

2021-04-28 Thread Christophe Leroy
For architectures with no PMD and/or no PUD, add stubs similar to what we have for architectures without P4D. Signed-off-by: Christophe Leroy --- include/linux/pgtable.h | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/pgtable.h

[RFC PATCH v1 4/4] mm/vmalloc: Add support for huge pages on VMAP and VMALLOC for powerpc 8xx

2021-04-28 Thread Christophe Leroy
powerpc 8xx has 4 page sizes: - 4k - 16k - 512k - 8M At the time being, vmalloc and vmap only support huge pages which are leaf at PMD level. Here the PMD level is 4M, it doesn't correspond to any supported page size. For the time being, implement use of 16k and 512k pages which is done at PTE

Re: PPC32: Boot regression on Nintendo Wii, after create_branch rework in 5.8

2021-04-28 Thread Jonathan Neuschäfer
Hi, On Wed, Apr 28, 2021 at 11:33:24AM +1000, Jordan Niethe wrote: > On Mon, Apr 26, 2021 at 1:40 AM Jonathan Neuschäfer > wrote: > > > > Hi, > > > > I recently booted my Wii again, and I noticed a regression at boot time. > > Output stops after the "Finalizing device tree... flat tree at