[PATCH v2 3/3] i2c: mpc: implement erratum A-004447 workaround

2021-05-06 Thread Chris Packham
The P2040/P2041 has an erratum where the normal i2c recovery mechanism does not work. Implement the alternative recovery mechanism documented in the P2040 Chip Errata Rev Q. Signed-off-by: Chris Packham --- Notes: Changes in v2: - Use readb_poll_timeout instead of open-coded loop

[PATCH v2 2/3] powerpc/fsl: set fsl, i2c-erratum-a004447 flag for P2041 i2c controllers

2021-05-06 Thread Chris Packham
The i2c controllers on the P2040/P2041 have an erratum where the documented scheme for i2c bus recovery will not work (A-004447). A different mechanism is needed which is documented in the P2040 Chip Errata Rev Q (latest available at the time of writing). Signed-off-by: Chris Packham ---

[PATCH v2 1/3] dt-bindings: i2c: mpc: Add fsl, i2c-erratum-a004447 flag

2021-05-06 Thread Chris Packham
Document the fsl,i2c-erratum-a004447 flag which indicates the presence of an i2c erratum on some QorIQ SoCs. Signed-off-by: Chris Packham --- Documentation/devicetree/bindings/i2c/i2c-mpc.yaml | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH v2 0/3] P2040/P2041 i2c recovery erratum

2021-05-06 Thread Chris Packham
The P2040/P2041 has an erratum where the i2c recovery scheme documented in the reference manual (and currently implemented in the i2c-mpc.c driver) does not work. The errata document provides an alternative that does work. This series implements that alternative and uses a property in the

[PATCH] powerpc/mmu: Don't duplicate radix_enabled()

2021-05-06 Thread Christophe Leroy
mmu_has_feature(MMU_FTR_TYPE_RADIX) can be evaluated regardless of CONFIG_PPC_RADIX_MMU. When CONFIG_PPC_RADIX_MMU is not set, mmu_has_feature(MMU_FTR_TYPE_RADIX) will evaluate to 'false' at build time because MMU_FTR_TYPE_RADIX wont be included in MMU_FTRS_POSSIBLE. Signed-off-by: Christophe

Re: [PATCH v12 3/8] powerpc/kprobes: Mark newly allocated probes as ROX

2021-05-06 Thread Christophe Leroy
Le 06/05/2021 à 04:34, Jordan Niethe a écrit : 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

Re: [PATCH v12 5/8] powerpc/bpf: Write protect JIT code

2021-05-06 Thread Christophe Leroy
Le 06/05/2021 à 04:34, Jordan Niethe a écrit : 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

[PATCH] powerpc/603: Avoid a pile of NOPs when not using SW LRU in TLB exceptions

2021-05-06 Thread Christophe Leroy
The SW LRU is in an MMU feature section. When not used, that's a dozen of NOPs to fetch for nothing. Define an ALT section that does the few remaining operations. That also avoids a double read on SRR1 in the SW LRU case. Signed-off-by: Christophe Leroy ---

Re: [PATCH v12 6/8] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2021-05-06 Thread Christophe Leroy
Le 06/05/2021 à 04:34, Jordan Niethe a écrit : 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

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

2021-05-06 Thread Christophe Leroy
Le 06/05/2021 à 04:34, 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

Re: [PATCH v12 4/8] powerpc/bpf: Remove bpf_jit_free()

2021-05-06 Thread Christophe Leroy
Le 06/05/2021 à 04:34, Jordan Niethe a écrit : 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

Re: [PATCH] powerpc/eeh: skip slot presence check when PE is temporarily unavailable.

2021-05-06 Thread Oliver O'Halloran
On Fri, May 7, 2021 at 3:43 AM Mahesh Salgaonkar wrote: > > When certain PHB HW failure causes phyp to recover PHB, it marks the PE > state as temporarily unavailable. In this case, per PAPR, rtas call > ibm,read-slot-reset-state2 returns a PE state as temporarily unavailable(5) > and OS has to

Re: Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board

2021-05-06 Thread Gustavo A. R. Silva
Hi Christian, On 4/30/21 06:59, Christian Zigotzky wrote: > Hello, > > The Nemo board (A-EON AmigaOne X1000) [1] and the FSL P5040 Cyrus+ board > (A-EON AmigaOne X5000) [2] with installed AMD Radeon HD6970 NI graphics cards > (Cayman > XT) [3] don't boot with the latest git kernel anymore

Re: [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1

2021-05-06 Thread Christian Zigotzky
Hi Christophe, Ok, so let's summarise from my side. The issue is in the PowerPC updates 5.13-1. I reverted these and after that the issue is gone. We know that only BookE machines are affected. Book3S machines are working with the PowerPC updates. I think it’s not directly an Xorg issue. It’s

Re: [PATCH v7 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-05-06 Thread Bharata B Rao
On Thu, May 06, 2021 at 03:45:21PM +1000, Nicholas Piggin wrote: > Excerpts from Bharata B Rao's message of May 6, 2021 1:46 am: > > > > +static long kvmppc_h_rpt_invalidate(struct kvm_vcpu *vcpu, > > + unsigned long id, unsigned long target, > > +

Re: [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1

2021-05-06 Thread Christophe Leroy
Le 05/05/2021 à 14:43, Christian Zigotzky a écrit : On 04 May 2021 at 05:17pm, Christophe Leroy wrote: Le 04/05/2021 à 16:59, Christian Zigotzky a écrit : On 04 May 2021 at 04:41pm Christophe Leroy wrote: Le 04/05/2021 à 13:02, Christian Zigotzky a écrit : On 04 May 2021 at 12:07pm,

Re: [PATCH v7 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-05-06 Thread Nicholas Piggin
Excerpts from Bharata B Rao's message of May 6, 2021 1:46 am: > Enable support for process-scoped invalidations from nested > guests and partition-scoped invalidations for nested guests. > > Process-scoped invalidations for any level of nested guests > are handled by implementing H_RPT_INVALIDATE

[PATCH] powerpc/syscall: Calling kuap_save_and_lock() is wrong

2021-05-06 Thread Christophe Leroy
kuap_save_and_lock() is only for interrupts inside kernel. system call are only from user, calling kuap_save_and_lock() is wrong. Fixes: c16728835eec ("powerpc/32: Manage KUAP in C") Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/interrupt.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH] powerpc/32s: Remove m8260_gorom()

2021-05-06 Thread Christophe Leroy
Last user of m8260_gorom() was removed by Commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc") removed last user of m8260_gorom(). In fact m8260_gorom() was ported to arch/powerpc/ but the platform using it died with arch/ppc/ Remove it. Signed-off-by: Christophe Leroy ---

Re: [RESEND PATCH v4 10/11] powerpc: Protect patching_mm with a lock

2021-05-06 Thread Peter Zijlstra
On Wed, May 05, 2021 at 11:34:51PM -0500, Christopher M. Riedl wrote: > Powerpc allows for multiple CPUs to patch concurrently. When patching > with STRICT_KERNEL_RWX a single patching_mm is allocated for use by all > CPUs for the few times that patching occurs. Use a spinlock to protect > the

Re: [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1

2021-05-06 Thread Christophe Leroy
Hi, Le 06/05/2021 à 09:56, Christian Zigotzky a écrit : Hi Christophe, Ok, so let's summarise from my side. The issue is in the PowerPC updates 5.13-1. I reverted these and after that the issue is gone. We know that only BookE machines are affected. Book3S machines are working with the

Re: [PATCH 3/3] i2c: mpc: implement erratum A-004447 workaround

2021-05-06 Thread Andy Shevchenko
On Thursday, May 6, 2021, Chris Packham wrote: > The P2040/P2041 has an erratum where the normal i2c recovery mechanism > does not work. Implement the alternative recovery mechanism documented > in the P2040 Chip Errata Rev Q. > > Signed-off-by: Chris Packham > --- >

[PATCH] powerpc: Only pad struct pt_regs when needed

2021-05-06 Thread Christophe Leroy
If neither KUAP nor PPC64 is selected, there is nothing in the second union of struct pt_regs, so the alignment padding is waste of memory. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH] powerpc/32s: Remove asm/book3s/32/hash.h

2021-05-06 Thread Christophe Leroy
Move the PAGE bits into pgtable.h to be more similar to book3s/64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/hash.h| 45 arch/powerpc/include/asm/book3s/32/pgtable.h | 38 - 2 files changed, 37 insertions(+), 46 deletions(-)

Re: [PATCH] KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks

2021-05-06 Thread Michael Ellerman
Paolo Bonzini writes: > On 05/05/21 14:15, Nicholas Piggin wrote: >> Commit b1c5356e873c ("KVM: PPC: Convert to the gfn-based MMU notifier >> callbacks") causes unmap_gfn_range and age_gfn callbacks to only work >> on the first gfn in the range. It also makes the aging callbacks call >> into both

[PATCH] powerpc/interrupts: Fix kuep_unlock() call

2021-05-06 Thread Christophe Leroy
Same as kuap_user_restore(), kuep_unlock() has to be called when really returning to user, that is in interrupt_exit_user_prepare(), not in interrupt_exit_prepare(). Fixes: b5efec00b671 ("powerpc/32s: Move KUEP locking/unlocking in C") Signed-off-by: Christophe Leroy ---

[PATCH] powerpc/32s: Speed up likely path of kuap_update_sr()

2021-05-06 Thread Christophe Leroy
In most cases, kuap_update_sr() will update a single segment register. We know that first update will always be done, if there is no segment register to update at all, kuap_update_sr() is not called. Avoid recurring calculations and tests in that case. Signed-off-by: Christophe Leroy ---

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
On 06.05.21 17:26, Zi Yan wrote: From: Zi Yan Hi all, This patchset tries to remove the restriction on memory hotplug/hotremove granularity, which is always greater or equal to memory section size[1]. With the patchset, kernel is able to online/offline memory at a size independent of memory

[RFC PATCH 1/7] mm: sparse: set/clear subsection bitmap when pages are onlined/offlined.

2021-05-06 Thread Zi Yan
From: Zi Yan subsection bitmap was set/cleared when a section is added/removed, but pfn_to_online_page() uses subsection bitmap to check if the page is online, which is not accurate. It was working when a whole section is added/removed during memory hotplug and hotremove. When the following

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
On 06.05.21 17:31, David Hildenbrand wrote: On 06.05.21 17:26, Zi Yan wrote: From: Zi Yan Hi all, This patchset tries to remove the restriction on memory hotplug/hotremove granularity, which is always greater or equal to memory section size[1]. With the patchset, kernel is able to

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
On 06.05.21 17:50, Zi Yan wrote: On 6 May 2021, at 11:40, David Hildenbrand wrote: The last patch increases SECTION_SIZE_BITS to demonstrate the use of memory hotplug/hotremove subsection, but is not intended to be merged as is. It is there in case one wants to try this out and will be removed

Re: [RFC PATCH 1/7] mm: sparse: set/clear subsection bitmap when pages are onlined/offlined.

2021-05-06 Thread David Hildenbrand
On 06.05.21 17:26, Zi Yan wrote: From: Zi Yan subsection bitmap was set/cleared when a section is added/removed, but pfn_to_online_page() uses subsection bitmap to check if the page is online, which is not accurate. It was working when a whole section is added/removed during memory hotplug and

[RFC PATCH 3/7] mm: memory_hotplug: decouple memory_block size with section size.

2021-05-06 Thread Zi Yan
From: Zi Yan To enable subsection memory online/offline, we need to remove the assumption of memory_block size being greater or equal to section size. The following changes are made: 1. use (start_pfn, nr_pages) pair to specify memory_block size instead of start_section_nr. 2. calculate

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Zi Yan
On 6 May 2021, at 11:31, David Hildenbrand wrote: > On 06.05.21 17:26, Zi Yan wrote: >> From: Zi Yan >> >> Hi all, >> >> This patchset tries to remove the restriction on memory hotplug/hotremove >> granularity, which is always greater or equal to memory section size[1]. >> With the patchset,

[PATCH] powerpc/eeh: skip slot presence check when PE is temporarily unavailable.

2021-05-06 Thread Mahesh Salgaonkar
When certain PHB HW failure causes phyp to recover PHB, it marks the PE state as temporarily unavailable. In this case, per PAPR, rtas call ibm,read-slot-reset-state2 returns a PE state as temporarily unavailable(5) and OS has to wait until that recovery is complete. During this state the slot

[RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Zi Yan
From: Zi Yan Hi all, This patchset tries to remove the restriction on memory hotplug/hotremove granularity, which is always greater or equal to memory section size[1]. With the patchset, kernel is able to online/offline memory at a size independent of memory section size, as small as 2MB (the

[RFC PATCH 4/7] mm: pageblock: allow set/unset migratetype for partial pageblock

2021-05-06 Thread Zi Yan
From: Zi Yan When we online subsections and pageblock size is larger than a subsection, we should be able to change migratetype for partial pageblocks. We also change the assumption that all pageblocks are in a whole. Signed-off-by: Zi Yan --- include/linux/page-isolation.h | 8 ++--

[RFC PATCH 6/7] arch: x86: no MAX_ORDER exceeds SECTION_SIZE check for 32bit vdso.

2021-05-06 Thread Zi Yan
From: Zi Yan For x86_64, 32bit vdso is compiled for compatibility reason and 32bit SECTION_SIZE_BITS value is used during compilation. It causes compilation time error when MAX_ORDER is increased in the 64bit environment even if it is OK for 64bit SECTION_SIZE_BITS. Remove the check during 32bit

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
The last patch increases SECTION_SIZE_BITS to demonstrate the use of memory hotplug/hotremove subsection, but is not intended to be merged as is. It is there in case one wants to try this out and will be removed during the final submission. Feel free to give suggestions and comments. I am

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Zi Yan
On 6 May 2021, at 11:40, David Hildenbrand wrote: The last patch increases SECTION_SIZE_BITS to demonstrate the use of memory hotplug/hotremove subsection, but is not intended to be merged as is. It is there in case one wants to try this out and will be removed during the

[RFC PATCH 2/7] mm: set pageblock_order to the max of HUGETLB_PAGE_ORDER and MAX_ORDER-1

2021-05-06 Thread Zi Yan
From: Zi Yan As MAX_ORDER can be increased to larger than hugetlb page orders, pageblock_order will be limited at HUGETLB_PAGE_ORDER. It is not ideal for anti-fragmentation for allocating pages from buddy allocator with MAX_ORDER > HUGETLB_PAGE_ORDER. Make pageblock_order a variable and set it

[RFC PATCH 5/7] mm: memory_hotplug, sparse: enable memory hotplug/hotremove subsections

2021-05-06 Thread Zi Yan
From: Zi Yan Remove the section size alignment checks for memory hotplug/hotremove, so that we can online/offline subsection memory. Signed-off-by: Zi Yan --- mm/memory_hotplug.c | 16 +--- mm/page_isolation.c | 4 mm/sparse.c | 17 ++--- 3 files changed,

[RFC PATCH 7/7] [not for merge] mm: increase SECTION_SIZE_BITS to 31

2021-05-06 Thread Zi Yan
From: Zi Yan This is only used to test onlining/offlining subsection memory in a x86_64 system by increasing section size to 2GB and pageblock size to 1GB when MAX_ORDER is set to 20. Signed-off-by: Zi Yan --- arch/x86/Kconfig | 15 +++

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Zi Yan
On 6 May 2021, at 11:26, Zi Yan wrote: > From: Zi Yan > > Hi all, > > This patchset tries to remove the restriction on memory hotplug/hotremove > granularity, which is always greater or equal to memory section size[1]. > With the patchset, kernel is able to online/offline memory at a size >

Re: [RFC PATCH 1/7] mm: sparse: set/clear subsection bitmap when pages are onlined/offlined.

2021-05-06 Thread Zi Yan
On 6 May 2021, at 13:48, David Hildenbrand wrote: > On 06.05.21 17:26, Zi Yan wrote: >> From: Zi Yan >> >> subsection bitmap was set/cleared when a section is added/removed, but >> pfn_to_online_page() uses subsection bitmap to check if the page is >> online, which is not accurate. It was

WARNING: CPU: 0 PID: 1 at arch/powerpc/lib/feature-fixups.c:109 do_feature_fixups+0xb0/0xf0

2021-05-06 Thread Paul Menzel
Dear Linux folks, On the POWER8 system IBM S822LC, Linux 5.13+, built with USSAN, logs the warning below. ``` [0.030091] [0.030295] UBSAN: array-index-out-of-bounds in

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
On 06.05.21 21:30, Matthew Wilcox wrote: On Thu, May 06, 2021 at 09:10:52PM +0200, David Hildenbrand wrote: I have to admit that I am not really a friend of that. I still think our target goal should be to have gigantic THP *in addition to* ordinary THP. Use gigantic THP where enabled and

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread David Hildenbrand
1. Pageblock size There are a couple of features that rely on the pageblock size to be reasonably small to work as expected. One example is virtio-balloon free page reporting, then there is virtio-mem (still also glued MAX_ORDER) and we have CMA (still also glued to MAX_ORDER). Most probably

Re: [RFC PATCH 1/7] mm: sparse: set/clear subsection bitmap when pages are onlined/offlined.

2021-05-06 Thread David Hildenbrand
But glimpsing at patch #2, I'd rather stop right away digging deeper into this series :) What is the issue of patch 2, which makes pageblock_order a variable all the time? BTW, patch 2 fixes a bug by exporting pageblock_order, since when HUGETLB_PAGE_SIZE_VARIABLE is set, virtio-mem will not

UBSAN: array-index-out-of-bounds in arch/powerpc/kernel/legacy_serial.c:359:56

2021-05-06 Thread Paul Menzel
[corrected subject] Am 06.05.21 um 21:31 schrieb Paul Menzel: Dear Linux folks, On the POWER8 system IBM S822LC, Linux 5.13+, built with USSAN, logs the warning below. ``` [    0.030091] [    0.030295]

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Matthew Wilcox
On Thu, May 06, 2021 at 09:10:52PM +0200, David Hildenbrand wrote: > I have to admit that I am not really a friend of that. I still think our > target goal should be to have gigantic THP *in addition to* ordinary THP. > Use gigantic THP where enabled and possible, and just use ordinary THP >

Re: [RFC PATCH 0/7] Memory hotplug/hotremove at subsection size

2021-05-06 Thread Zi Yan
On 6 May 2021, at 12:28, David Hildenbrand wrote: > On 06.05.21 17:50, Zi Yan wrote: >> On 6 May 2021, at 11:40, David Hildenbrand wrote: >> >> The last patch increases SECTION_SIZE_BITS to demonstrate the use of >> memory >> hotplug/hotremove subsection, but is not intended to be

Re: [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1

2021-05-06 Thread Christian Zigotzky
I have started bisecting again. Link: https://forum.hyperion-entertainment.com/viewtopic.php?p=53106#p53106 > On 6. May 2021, at 10:09, Christophe Leroy > wrote: > > Hi, > >> Le 06/05/2021 à 09:56, Christian Zigotzky a écrit : >> Hi Christophe, >> Ok, so let's summarise from my side. >>

Re: [PATCH 3/3] i2c: mpc: implement erratum A-004447 workaround

2021-05-06 Thread Chris Packham
On 6/05/21 8:03 pm, Andy Shevchenko wrote: On Thursday, May 6, 2021, Chris Packham mailto:chris.pack...@alliedtelesis.co.nz>> wrote: The P2040/P2041 has an erratum where the normal i2c recovery mechanism does not work. Implement the alternative recovery mechanism documented in the P2040 Chip