Re: [GIT PULL] virtio: fixes, features

2022-10-13 Thread Arnd Bergmann
On Thu, Oct 13, 2022, at 12:08 AM, Michael S. Tsirkin wrote: > On Wed, Oct 12, 2022 at 11:06:54PM +0200, Arnd Bergmann wrote: >> On Wed, Oct 12, 2022, at 7:22 PM, Linus Torvalds wrote: >> > >> > The NO_IRQ thing is mainly actually defined by a few drivers that just >> > never got converted to the

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-13 Thread Javier Martinez Canillas
Hello, On 10/12/22 16:27, Michal Suchánek wrote: [...] >> >> If you are using the framebuffer code from vga.c, I would guess that >> that you can run a big-endian kernel with qemu-system-ppc64, >> or a little-endian kernel with qemu-system-ppc64le and get the >> correct colors, while running a

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-13 Thread Christian Zigotzky
Edit: fixed typos. > On 13. Oct 2022, at 11:42, Christian Zigotzky wrote: > > Hi Christophe, > > Thanks a lot for your answer. OK, now, I know, that I don’t need to test it. > After the boot of the latest git kernel, my system was extremely damaged. > Some config files have a size of

[PATCH] powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context

2022-10-13 Thread Nicholas Piggin
It's possible for an interrupt returning to an irqs-disabled context to lose a pending soft-masked irq because it branches to part of the exit code for irqs-enabled contexts, which is meant to clear only the PACA_IRQS_HARD_DIS flag from PACAIRQHAPPENED by zeroing the byte. This just looks like a

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-13 Thread Christian Zigotzky
Hi Andrew, Does this patch also affect 64-bit kernels? We use often 32-bit userlands with 64-bit kernels. Cheers, Christian > On 12. Oct 2022, at 09:56, Andrew Donnellan wrote: > > On Wed, 2022-10-12 at 08:51 +0200, Christian Zigotzky wrote: >> Hi All, >> >> I use the Nemo board with a

[PATCH] powerpc/pseries: Fix CONFIG_DTL=n build

2022-10-13 Thread Nicholas Piggin
The recently moved dtl code must be compiled-in if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y even if CONFIG_DTL=n. Reported-by: Guenter Roeck Fixes: 6ba5aa541aaa0 ("powerpc/pseries: Move dtl scanning and steal time accounting to pseries platform") Signed-off-by: Nicholas Piggin ---

Re: [PATCH v2] perf: Rewrite core context handling

2022-10-13 Thread Ravi Bangoria
On 13-Oct-22 2:17 AM, Peter Zijlstra wrote: > On Wed, Oct 12, 2022 at 02:16:29PM +0200, Peter Zijlstra wrote: > >> That's the intent yeah. But due to not always holding ctx->mutex over >> put_pmu_ctx() this might be moot. I'm almost through auditing epc usage >> and I think ctx->lock is

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-13 Thread Christian Zigotzky
Hi Christophe, Thanks a lot for your answer. OK, now, I know, that I don’t need to test it. After the boot of the latest git kernel, my system was extremely damaged. Some config files has a size of several gigabytes for example the resolv.conf. I tried to repair this Debian system but without

Re: Issues with the first PowerPC updates for the kernel 6.1

2022-10-13 Thread Christophe Leroy
Le 13/10/2022 à 09:03, Christian Zigotzky a écrit : > Hi Andrew, > > Does this patch also affect 64-bit kernels? > > We use often 32-bit userlands with 64-bit kernels. As far as I understand, it was already correct for 32-bit userlands with 64 bit kernels, aka compat. The patch applies the

Re: [PATCH v2] perf: Rewrite core context handling

2022-10-13 Thread Peter Zijlstra
On Thu, Oct 13, 2022 at 03:37:23PM +0530, Ravi Bangoria wrote: > > - refcount_t refcount; > > + refcount_t refcount; /* event <-> ctx */ > > Ok. We need to remove all those // XXX get/put_ctx() from code > which we added to make refcount a pmu_ctx

Re: [PATCH v6 5/7] treewide: use get_random_u32() when possible

2022-10-13 Thread Florian Westphal
Rolf Eike Beer wrote: > Florian, can you comment and maybe fix it? Can't comment, do not remember -- this was 5 years ago. > Or you wanted to move the variable before the loop and keep the random state > between the loops and only reseed when all '1' bits have been consumed. Probably. No

Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers

2022-10-13 Thread Ville Syrjälä
On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote: > Hi > > Am 12.10.22 um 15:12 schrieb Arnd Bergmann: > > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote: > >> > >> Could well be. But ofdrm intents to replace offb and this test has > >> worked well in offb for almost

[PATCH 2/3] powerpc/64s: Fix hash__change_memory_range preemption warning

2022-10-13 Thread Nicholas Piggin
stop_machine_cpuslocked takes a mutex so it must be called in a preemptible context, so it can't simply be fixed by disabling preemption. This is not a bug, because CPU hotplug is locked, so this processor will call in to the stop machine function. So raw_smp_processor_id() could be used. This

Re: [PATCH 1/3] powerpc/64s: Disable preemption in hash lazy mmu mode

2022-10-13 Thread Christophe Leroy
Le 13/10/2022 à 17:16, Nicholas Piggin a écrit : > apply_to_page_range on kernel pages does not disable preemption, which > is a requirement for hash's lazy mmu mode, which keeps track of the > TLBs to flush with a per-cpu array. > > Reported-by: Guenter Roeck > Signed-off-by: Nicholas Piggin

Re: [PATCH] powerpc/pseries: Fix CONFIG_DTL=n build

2022-10-13 Thread Guenter Roeck
On Thu, Oct 13, 2022 at 05:31:31PM +1000, Nicholas Piggin wrote: > The recently moved dtl code must be compiled-in if > CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y even if CONFIG_DTL=n. > > Reported-by: Guenter Roeck > Fixes: 6ba5aa541aaa0 ("powerpc/pseries: Move dtl scanning and steal time >

[PATCH 1/3] powerpc/64s: Disable preemption in hash lazy mmu mode

2022-10-13 Thread Nicholas Piggin
apply_to_page_range on kernel pages does not disable preemption, which is a requirement for hash's lazy mmu mode, which keeps track of the TLBs to flush with a per-cpu array. Reported-by: Guenter Roeck Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/book3s/64/tlbflush-hash.h | 6

[PATCH 3/3] powerpc: fix reschedule bug in KUAP-unlocked user copy

2022-10-13 Thread Nicholas Piggin
schedule must not be explicitly called while KUAP is unlocked, because the AMR register will not be saved across the context switch on 64s (preemption is allowed because that is driven by interrupts which do save the AMR). exit_vmx_usercopy() runs inside an unlocked user access region, and it

[linux-next:master] BUILD REGRESSION 56e8142dda103af35e1a47e560517dce355ac001

2022-10-13 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 56e8142dda103af35e1a47e560517dce355ac001 Add linux-next specific files for 20221013 Error/Warning reports: https://lore.kernel.org/linux-mm/202210090954.ptr6m6rj-...@intel.com https

Re: [PATCH v6 5/7] treewide: use get_random_u32() when possible

2022-10-13 Thread Jason A. Donenfeld
On Thu, Oct 13, 2022 at 01:40:40PM +0200, Rolf Eike Beer wrote: > Am Donnerstag, 13. Oktober 2022, 12:16:35 CEST schrieb Florian Westphal: > > Rolf Eike Beer wrote: > > > Florian, can you comment and maybe fix it? > > > > Can't comment, do not remember -- this was 5 years ago. > > > > > Or you

Re: [PATCH] powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context

2022-10-13 Thread Guenter Roeck
On Thu, Oct 13, 2022 at 04:44:18PM +1000, Nicholas Piggin wrote: > It's possible for an interrupt returning to an irqs-disabled context to > lose a pending soft-masked irq because it branches to part of the exit > code for irqs-enabled contexts, which is meant to clear only the >

Re: [PATCH v2] x86: Fix /proc/cpuinfo cpumask warning

2022-10-13 Thread Andrew Jones
Adding more people and lists to CC in order to point this patch out, because, based on a quick grep of cpuinfo seq operations, I think at least openrisc, powerpc, and s390 also need an equivalent patch (and I've already sent a patch for riscv). While the test is simple (see next paragraph) I'm

Re: [GIT PULL] virtio: fixes, features

2022-10-13 Thread Linus Torvalds
On Wed, Oct 12, 2022 at 11:29 PM Arnd Bergmann wrote: > > On Thu, Oct 13, 2022, at 12:08 AM, Michael S. Tsirkin wrote: > > > > Do these two boxes even have pci? > > Footbridge/netwinder has PCI and PC-style ISA on-board devices > (floppy, ps2 mouse/keyboard, parport, soundblaster, ...), RiscPC >

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-13 Thread Guenter Roeck
On Thu, Oct 13, 2022 at 03:14:08PM +1000, Nicholas Piggin wrote: > > > > > > BUG: using smp_processor_id() in preemptible [] code: swapper/0/1 > > > caller is .__flush_tlb_pending+0x40/0xf0 > > > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.0.0-28380-gde492c83cae0-dirty > > > #4 > > >

Re: [PATCH 3/3] powerpc: fix reschedule bug in KUAP-unlocked user copy

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 01:16:47AM +1000, Nicholas Piggin wrote: > schedule must not be explicitly called while KUAP is unlocked, because > the AMR register will not be saved across the context switch on 64s > (preemption is allowed because that is driven by interrupts which do > save the AMR). >

Re: [PATCH 1/3] powerpc/64s: Disable preemption in hash lazy mmu mode

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 01:16:45AM +1000, Nicholas Piggin wrote: > apply_to_page_range on kernel pages does not disable preemption, which > is a requirement for hash's lazy mmu mode, which keeps track of the > TLBs to flush with a per-cpu array. > > Reported-by: Guenter Roeck > Signed-off-by:

Re: [PATCH 3/3] powerpc: fix reschedule bug in KUAP-unlocked user copy

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 01:16:47AM +1000, Nicholas Piggin wrote: > schedule must not be explicitly called while KUAP is unlocked, because > the AMR register will not be saved across the context switch on 64s > (preemption is allowed because that is driven by interrupts which do > save the AMR). >

Re: [PATCH 2/3] powerpc/64s: Fix hash__change_memory_range preemption warning

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 01:16:46AM +1000, Nicholas Piggin wrote: > stop_machine_cpuslocked takes a mutex so it must be called in a > preemptible context, so it can't simply be fixed by disabling > preemption. > > This is not a bug, because CPU hotplug is locked, so this processor will > call in

Re: [PATCH 3/3] powerpc/64s: make linear_map_hash_lock a raw spinlock

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 09:07:10AM +1000, Nicholas Piggin wrote: > This lock is taken while the raw kfence_freelist_lock is held, so it > must also be a raw spinlock, as reported by lockdep when raw lock > nesting checking is enabled. > > Signed-off-by: Nicholas Piggin Tested-by: Guenter Roeck

[PATCH 2/3] powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe

2022-10-13 Thread Nicholas Piggin
With kfence enabled, there are several cases where HPTE and TLBIE locks are called from softirq context, for example: WARNING: inconsistent lock state 6.0.0-11845-g0cbbc95b12ac #1 Tainted: G N inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W}

[PATCH 1/3] powerpc/64s: Add lockdep for HPTE lock

2022-10-13 Thread Nicholas Piggin
Add lockdep annotation for the HPTE bit-spinlock. Modern systems don't take the tlbie lock, so this shows up some of the same lockdep warnings that were being reported by the ppc970. And they're not taken in exactly the same places so this is nice to have in its own right. Signed-off-by: Nicholas

[PATCH 3/3] powerpc/64s: make linear_map_hash_lock a raw spinlock

2022-10-13 Thread Nicholas Piggin
This lock is taken while the raw kfence_freelist_lock is held, so it must also be a raw spinlock, as reported by lockdep when raw lock nesting checking is enabled. Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/book3s64/hash_utils.c | 12 ++-- 1 file changed, 6 insertions(+), 6

Re: [PATCH 1/3] powerpc/64s: Add lockdep for HPTE lock

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 09:07:08AM +1000, Nicholas Piggin wrote: > Add lockdep annotation for the HPTE bit-spinlock. Modern systems don't > take the tlbie lock, so this shows up some of the same lockdep warnings > that were being reported by the ppc970. And they're not taken in exactly > the same

Re: [PATCH 2/3] powerpc/64s: make HPTE lock and native_tlbie_lock irq-safe

2022-10-13 Thread Guenter Roeck
On Fri, Oct 14, 2022 at 09:07:09AM +1000, Nicholas Piggin wrote: > With kfence enabled, there are several cases where HPTE and TLBIE locks > are called from softirq context, for example: > > WARNING: inconsistent lock state > 6.0.0-11845-g0cbbc95b12ac #1 Tainted: G N >

[PATCH v2 2/2] powerpc/64/interrupt: Prevent NMI PMI causing a dangerous warning

2022-10-13 Thread Nicholas Piggin
NMI PMIs really should not return using the normal interrupt_return function. If such a PMI hits in code returning to user with the context switched to user mode, this warning can fire. This was enough to cause crashes when reproducing on 64s, because another perf interrupt would hit while

[PATCH v2 0/2] powerpc: misc interrupt and context tracking

2022-10-13 Thread Nicholas Piggin
These are several fixes for regressions and crash bugs. Since v1 I cut down the fixes to a minimum. Thanks, Nick Nicholas Piggin (2): KVM: PPC: BookS PR-KVM and BookE do not support context tracking powerpc/64/interrupt: Prevent NMI PMI causing a dangerous warning

[PATCH v2 1/2] KVM: PPC: BookS PR-KVM and BookE do not support context tracking

2022-10-13 Thread Nicholas Piggin
The context tracking code in PR-KVM and BookE implementations is not complete, and can cause host crashes if context tracking is enabled. Make these implementations depend on !CONTEXT_TRACKING_USER. Signed-off-by: Nicholas Piggin --- arch/powerpc/kvm/Kconfig | 4 1 file changed, 4

[powerpc:fixes] BUILD SUCCESS 90d5ce82e143b42b2fdfb95401a89f86b71cedb7

2022-10-13 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes branch HEAD: 90d5ce82e143b42b2fdfb95401a89f86b71cedb7 powerpc/pseries: Fix CONFIG_DTL=n build elapsed time: 878m configs tested: 72 configs skipped: 111 The following configs have been built successfully.