Re: [PATCH v2 02/10] drm/simpledrm: Inline device-init helpers

2022-07-27 Thread Thomas Zimmermann
Hi Am 25.07.22 um 17:01 schrieb Javier Martinez Canillas: Hello Thomas, On 7/20/22 16:27, Thomas Zimmermann wrote: Inline the helpers for initializing the hardware FB, the memory management and the modesetting into the device-creation function. No functional changes. Could you please elabor

Re: [PATCH v2 04/10] drm/simpledrm: Compute framebuffer stride if not set

2022-07-27 Thread Thomas Zimmermann
Hi Am 25.07.22 um 17:13 schrieb Javier Martinez Canillas: Hello Geert, On 7/21/22 16:46, Geert Uytterhoeven wrote: Hi Thomas, On Wed, Jul 20, 2022 at 4:27 PM Thomas Zimmermann wrote: Compute the framebuffer's scanline stride length if not given by the simplefb data. Signed-off-by: Thomas Z

Re: [PATCH v2 05/10] drm/simpledrm: Convert to atomic helpers

2022-07-27 Thread Thomas Zimmermann
Hi Am 25.07.22 um 17:46 schrieb Javier Martinez Canillas: On 7/20/22 16:27, Thomas Zimmermann wrote: Replace the simple-KMS helpers with the regular atomic helpers. The regular helpers are better architectured and therefore allow for easier code sharing among drivers. No functional changes.

Re: [PATCH v2 06/10] drm/simpledrm: Move some functionality into fwfb helper library

2022-07-27 Thread Thomas Zimmermann
Hi Am 25.07.22 um 18:23 schrieb Javier Martinez Canillas: On 7/20/22 16:27, Thomas Zimmermann wrote: Move some of simpledrm's functionality into a helper library. Other drivers for firmware-provided framebuffers will also need functions to handle fixed modes and color formats, or update the bac

Re: [PATCH v2 09/10] drm/ofdrm: Add per-model device function

2022-07-27 Thread Thomas Zimmermann
Hi Am 26.07.22 um 21:22 schrieb Javier Martinez Canillas: Hello Michal, On 7/26/22 16:40, Michal Suchánek wrote: Hello, On Tue, Jul 26, 2022 at 03:38:37PM +0200, Javier Martinez Canillas wrote: On 7/20/22 16:27, Thomas Zimmermann wrote: Add a per-model device-function structure in preparati

Re: [PATCH v2 10/10] drm/ofdrm: Support color management

2022-07-27 Thread Thomas Zimmermann
Hi Am 26.07.22 um 15:49 schrieb Javier Martinez Canillas: On 7/20/22 16:27, Thomas Zimmermann wrote: Support the CRTC's color-management property and implement each model's palette support. The OF hardware has different methods of setting the palette. The respective code has been taken from fb

[linux-next] Build failure kernel/watchdog [powerpc]

2022-07-27 Thread Sachin Sant
Linux-next (5.19.0-rc8-next-20220726) fails to build on powerpc with following error: kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration static inline void lockup_detector_reconfigure(void) ^~~~

[PATCH] watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

2022-07-27 Thread Laurent Dufour
Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR is not set: kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration static inline void lockup_detector_reconfigure(void) ^

Re: [PATCH v2 02/10] drm/simpledrm: Inline device-init helpers

2022-07-27 Thread Javier Martinez Canillas
Hello Thomas, On 7/27/22 09:50, Thomas Zimmermann wrote: > Hi > > Am 25.07.22 um 17:01 schrieb Javier Martinez Canillas: >> Hello Thomas, >> >> On 7/20/22 16:27, Thomas Zimmermann wrote: >>> Inline the helpers for initializing the hardware FB, the memory >>> management and the modesetting into th

Re: [PATCH v3] PCI/ERR: Use pcie_aer_is_native() to judge whether OS owns AER

2022-07-27 Thread Zhuo Chen
On 7/26/22 1:35 PM, Zhuo Chen wrote: On 7/26/22 9:02 PM, Sathyanarayanan Kuppuswamy wrote: On 7/26/22 8:53 PM, Zhuo Chen wrote: Use pcie_aer_is_native() in place of "host->native_aer || pcie_ports_native" to judge whether OS has native control of AER in pcie_do_recovery(). Replace "dev->

Re: [PATCH v2 06/10] drm/simpledrm: Move some functionality into fwfb helper library

2022-07-27 Thread Javier Martinez Canillas
On 7/27/22 10:24, Thomas Zimmermann wrote: > Hi > > Am 25.07.22 um 18:23 schrieb Javier Martinez Canillas: >> On 7/20/22 16:27, Thomas Zimmermann wrote: >>> Move some of simpledrm's functionality into a helper library. Other >>> drivers for firmware-provided framebuffers will also need functions >

Re: [PATCH v2 10/10] drm/ofdrm: Support color management

2022-07-27 Thread Javier Martinez Canillas
On 7/27/22 10:41, Thomas Zimmermann wrote: [...] >> >>> +static void __iomem *ofdrm_mach64_cmap_ioremap(struct ofdrm_device *odev, >>> + struct device_node *of_node, >>> + u64 fb_base) >>> +{ >>> + struct drm_devi

Re: [PATCH] watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

2022-07-27 Thread Sachin Sant
> The definition of lockup_detector_reconfigure should be exported even in > that case, and __lockup_detector_reconfigure should remain static. > > Fixes: 24a1260705b7 ("watchdog: export lockup_detector_reconfigure") > Reported-by: Sachin Sant > Signed-off-by: Laurent Dufour > --- > kernel/wat

Re: [PATCH] watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

2022-07-27 Thread Michael Ellerman
Laurent Dufour writes: > Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR > is not set: > > kernel/watchdog.c:597:20: error: static declaration of > 'lockup_detector_reconfigure' follows non-static declaration > static inline void lockup_detector_reconfigure(void) >

linux-next: build warnings after merge of the powerpc tree

2022-07-27 Thread Stephen Rothwell
Hi all, After merging the powerpc tree, today's linux-next build (htmldocs) produces these warnings: Documentation/powerpc/elf_hwcaps.rst:82: WARNING: Unexpected indentation. Documentation/powerpc/elf_hwcaps.rst:100: WARNING: Unexpected indentation. Documentation/powerpc/elf_hwcaps.rst:117: WARNI

Re: [PATCH] powerpc/64s: Disable stack variable initialisation for prom_init

2022-07-27 Thread Michael Ellerman
On Mon, 18 Jul 2022 23:44:18 +1000, Michael Ellerman wrote: > With GCC 12 allmodconfig prom_init fails to build: > > Error: External symbol 'memset' referenced from prom_init.c > make[2]: *** [arch/powerpc/kernel/Makefile:204: > arch/powerpc/kernel/prom_init_check] Error 1 > > The allmodconf

Re: [PATCH v2 1/2] powerpc/pci: Add config option for using OF 'reg' for PCI domain

2022-07-27 Thread Michael Ellerman
Pali Rohár writes: > Since commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on > device-tree properties"), powerpc kernel always fallback to PCI domain > assignment from OF / Device Tree 'reg' property of the PCI controller. > > In most cases 'reg' property is not zero and therefor

Re: [PATCH] watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

2022-07-27 Thread Laurent Dufour
Le 27/07/2022 à 13:38, Michael Ellerman a écrit : > Laurent Dufour writes: >> Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR >> is not set: >> >> kernel/watchdog.c:597:20: error: static declaration of >> 'lockup_detector_reconfigure' follows non-static declaration >> s

[PATCH v6 3/3] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-07-27 Thread Michael Ellerman
From: "Jason A. Donenfeld" The preferred nomenclature is pnv_, not powernv_, but rng.c used powernv_ for some reason, which isn't consistent with the rest. A recent commit added a few pnv_ functions to rng.c, making the file a bit of a mishmash. This commit just replaces the rest of them. Tested

[PATCH v6 2/3] powerpc/powernv/kvm: Use darn for H_RANDOM on Power9

2022-07-27 Thread Michael Ellerman
From: "Jason A. Donenfeld" The existing logic in KVM to support guests calling H_RANDOM only works on Power8, because it looks for an RNG in the device tree, but on Power9 we just use darn. In addition the existing code needs to work in real mode, so we have the special cased powernv_get_random_

[PATCH v6 1/3] powerpc/powernv: Avoid crashing if rng is NULL

2022-07-27 Thread Michael Ellerman
On a bare-metal Power8 system that doesn't have an "ibm,power-rng", a malicious QEMU and guest that ignore the absence of the KVM_CAP_PPC_HWRNG flag, and calls H_RANDOM anyway, will dereference a NULL pointer. In practice all Power8 machines have an "ibm,power-rng", but let's not rely on that, add

Re: [PATCH -next v3 2/2] powerpc: add support for syscall stack randomization

2022-07-27 Thread Kees Cook
On Fri, Jul 01, 2022 at 04:24:35PM +0800, Xiu Jianfeng wrote: > Add support for adding a random offset to the stack while handling > syscalls. This patch uses mftb() instead of get_random_int() for better > performance. > > In order to avoid unconditional stack canaries on syscall entry (due to >

Re: [PATCH] watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

2022-07-27 Thread Michael Ellerman
Laurent Dufour writes: > Le 27/07/2022 à 13:38, Michael Ellerman a écrit : >> Laurent Dufour writes: >>> Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR >>> is not set: >>> >>> kernel/watchdog.c:597:20: error: static declaration of >>> 'lockup_detector_reconfigure' foll

[PATCH 2/3] Documentation: use different label names for each arch's elf_hwcaps.rst

2022-07-27 Thread Bagas Sanjaya
Sphinx reported duplicate label warning: WARNING: duplicate label elf_hwcaps_index, other instance in Documentation/arm64/elf_hwcaps.rst The warning is caused by elf_hwcaps_index label name is already used for arm64 documentation, whileas powerpc use the same name. Disambiguate the label name f

[PATCH 0/3] Documentation: powerpc: documentation fixes for Documentation/powerpc/elf_hwcaps.rst

2022-07-27 Thread Bagas Sanjaya
After merging powerpc tree for linux-next integration testing, Stephen Rothwell reported htmldocs warnings at [1]. Fix these with self-explanatory fixes in the shortlog below. [1]: https://lore.kernel.org/linuxppc-dev/20220727220050.549db...@canb.auug.org.au/ Bagas Sanjaya (3): Documentation:

[PATCH 3/3] Documentation: powerpc: add elf_hwcaps to table of contents

2022-07-27 Thread Bagas Sanjaya
elf_hwcaps documentation is missing from table of contents at index.rst, hence triggers Sphinx warning: Documentation/powerpc/elf_hwcaps.rst: WARNING: document isn't included in any toctree Add the documentation to the index to fix the warning. Link: https://lore.kernel.org/linuxppc-dev/202207

[PATCH 1/3] Documentation: powerpc: fix indentation warnings

2022-07-27 Thread Bagas Sanjaya
Sphinx reported unexpected indentation warnings: Documentation/powerpc/elf_hwcaps.rst:82: WARNING: Unexpected indentation. Documentation/powerpc/elf_hwcaps.rst:100: WARNING: Unexpected indentation. Documentation/powerpc/elf_hwcaps.rst:117: WARNING: Unexpected indentation. Documentation/powerpc/elf

[PATCH 00/17] powerpc: alternate queued spinlock implementation

2022-07-27 Thread Nicholas Piggin
This replaces the generic queued spinlock code (like s390 does) with our own implementation. There is an extra shim patch 1a here to get the series to apply. So far the microbenchmarks look okay, haven't really had time to write up a good set of results. I hope to get some significant bigger workl

[PATCH 01/17] powerpc/qspinlock: powerpc qspinlock implementation

2022-07-27 Thread Nicholas Piggin
Add a powerpc specific implementation of queued spinlocks. This is the build framework with a very simple (non-queued) spinlock implementation to begin with. Later changes add queueing, and other features and optimisations one-at-a-time. It is done this way to more easily see how the queued spinloc

[PATCH 1a/17] powerpc/qspinlock: Prepare qspinlock code

2022-07-27 Thread Nicholas Piggin
I have a bunch of parallel patches that clean up the generic queued spinlock code, but the powerpc implementation does not use or depend on any of that except patch collision. I've based the powerpc series on top of that work, but it's annoying to post or carry around all those patches as well. Thi

[PATCH 02/17] powerpc/qspinlock: add mcs queueing for contended waiters

2022-07-27 Thread Nicholas Piggin
This forms the basis of the qspinlock slow path. Like generic qspinlocks and unlike the vanilla MCS algorithm, the lock owner does not participate in the queue, only waiters. The first waiter spins on the lock word, then when the lock is released it takes ownership and unqueues the next waiter. Th

[PATCH 03/17] powerpc/qspinlock: use a half-word store to unlock to avoid larx/stcx.

2022-07-27 Thread Nicholas Piggin
The first 16 bits of the lock are only modified by the owner, and other modifications always use atomic operations on the entire 32 bits, so unlocks can use plain stores on the 16 bits. This is the same kind of optimisation done by core qspinlock code. --- arch/powerpc/include/asm/qspinlock.h

[PATCH 04/17] powerpc/qspinlock: convert atomic operations to assembly

2022-07-27 Thread Nicholas Piggin
This uses more optimal ll/sc style access patterns (rather than cmpxchg), and also sets the EH=1 lock hint on those operations which acquire ownership of the lock. --- arch/powerpc/include/asm/qspinlock.h | 25 +-- arch/powerpc/include/asm/qspinlock_types.h | 6 +- arch/powerpc/lib/qspi

[PATCH 05/17] powerpc/qspinlock: allow new waiters to steal the lock before queueing

2022-07-27 Thread Nicholas Piggin
Allow new waiters a number of spins on the lock word before queueing, which particularly helps paravirt performance when physical CPUs are oversubscribed. --- arch/powerpc/lib/qspinlock.c | 152 --- 1 file changed, 141 insertions(+), 11 deletions(-) diff --git a/ar

[PATCH 06/17] powerpc/qspinlock: theft prevention to control latency

2022-07-27 Thread Nicholas Piggin
Give the queue head the ability to stop stealers. After a number of spins without sucessfully acquiring the lock, the queue head employs this, which will assure it is the next owner. --- arch/powerpc/include/asm/qspinlock_types.h | 10 +++- arch/powerpc/lib/qspinlock.c | 56 +

[PATCH 07/17] powerpc/qspinlock: store owner CPU in lock word

2022-07-27 Thread Nicholas Piggin
Store the owner CPU number in the lock word so it may be yielded to, as powerpc's paravirtualised simple spinlocks do. --- arch/powerpc/include/asm/qspinlock.h | 8 +++- arch/powerpc/include/asm/qspinlock_types.h | 10 ++ arch/powerpc/lib/qspinlock.c | 6 +++--- 3

[PATCH 08/17] powerpc/qspinlock: paravirt yield to lock owner

2022-07-27 Thread Nicholas Piggin
Waiters spinning on the lock word should yield to the lock owner if the vCPU is preempted. This improves performance when the hypervisor has oversubscribed physical CPUs. --- arch/powerpc/lib/qspinlock.c | 97 ++-- 1 file changed, 83 insertions(+), 14 deletions(-)

[PATCH 09/17] powerpc/qspinlock: implement option to yield to previous node

2022-07-27 Thread Nicholas Piggin
Queued waiters which are not at the head of the queue don't spin on the lock word but their qnode lock word, waiting for the previous queued CPU to release them. Add an option which allows these waiters to yield to the previous CPU if its vCPU is preempted. Disable this option by default for now,

[PATCH 10/17] powerpc/qspinlock: allow stealing when head of queue yields

2022-07-27 Thread Nicholas Piggin
If the head of queue is preventing stealing but it finds the owner vCPU is preempted, it will yield its cycles to the owner which could cause it to become preempted. Add an option to re-allow stealers before yielding, and disallow them again after returning from the yield. Disable this option by d

[PATCH 11/17] powerpc/qspinlock: allow propagation of yield CPU down the queue

2022-07-27 Thread Nicholas Piggin
Having all CPUs poll the lock word for the owner CPU that should be yielded to defeats most of the purpose of using MCS queueing for scalability. Yet it may be desirable for queued waiters to to yield to a preempted owner. s390 addreses this problem by having queued waiters sample the lock word to

[PATCH 12/17] powerpc/qspinlock: add ability to prod new queue head CPU

2022-07-27 Thread Nicholas Piggin
After the head of the queue acquires the lock, it releases the next waiter in the queue to become the new head. Add an option to prod the new head if its vCPU was preempted. This may only have an effect if queue waiters are yielding. Disable this option by default for now, i.e., no logical change.

[PATCH 13/17] powerpc/qspinlock: trylock and initial lock attempt may steal

2022-07-27 Thread Nicholas Piggin
This gives trylock slightly more strength, and it also gives most of the benefit of passing 'val' back through the slowpath without the complexity. --- arch/powerpc/include/asm/qspinlock.h | 39 +++- arch/powerpc/lib/qspinlock.c | 9 +++ 2 files changed, 47 ins

[PATCH 14/17] powerpc/qspinlock: use spin_begin/end API

2022-07-27 Thread Nicholas Piggin
Use the spin_begin/spin_cpu_relax/spin_end APIs in qspinlock, which helps to prevent threads issuing a lot of expensive priority nops which may not have much effect due to immediately executing low then medium priority. --- arch/powerpc/lib/qspinlock.c | 35 +++ 1 f

[PATCH 15/17] powerpc/qspinlock: reduce remote node steal spins

2022-07-27 Thread Nicholas Piggin
Allow for a reduction in the number of times a CPU from a different node than the owner can attempt to steal the lock before queueing. This could bias the transfer behaviour of the lock across the machine and reduce NUMA crossings. --- arch/powerpc/lib/qspinlock.c | 34

[PATCH 16/17] powerpc/qspinlock: allow indefinite spinning on a preempted owner

2022-07-27 Thread Nicholas Piggin
Provide an option that holds off queueing indefinitely while the lock owner is preempted. This could reduce queueing latencies for very overcommitted vcpu situations. This is disabled by default. --- arch/powerpc/lib/qspinlock.c | 91 +++- 1 file changed, 79 insert

[PATCH 17/17] powerpc/qspinlock: provide accounting and options for sleepy locks

2022-07-27 Thread Nicholas Piggin
Finding the owner or a queued waiter on a lock with a preempted vcpu is indicative of an oversubscribed guest causing the lock to get into trouble. Provide some options to detect this situation and have new CPUs avoid queueing for a longer time (more steal iterations) to minimise the problems cause