Re: [PATCH v2 1/4] KVM: Refactor stats descriptor generation macros

2023-04-05 Thread Anup Patel
On Tue, Mar 7, 2023 at 12:32 AM David Matlack wrote: > > Refactor the various KVM stats macros to reduce the amount of duplicate > macro code. This change also improves readability by spelling out > "CUMULATIVE", "INSTANT", and "PEAK" instead of the previous short-hands > which were less clear

[PATCH v2 7/7] selftests/powerpc/dscr: Restore timeout to DSCR selftests

2023-04-05 Thread Benjamin Gray
Reducing the time taken by dscr_sysfs_test.c allows restoring the default timeout, which was removed in commit 850507f30c38 ("selftests/powerpc: Turn off timeout setting for benchmarks, dscr, signal, tm") because that test took too long. Signed-off-by: Benjamin Gray ---

[PATCH v2 5/7] selftests/powerpc/dscr: Improve DSCR explicit random test case

2023-04-05 Thread Benjamin Gray
The tests currently have a single writer thread updating the system DSCR with a 1/1000 chance looped only 100 times. So only around one in 10 runs actually do anything. * Add multiple threads to the dscr_explicit_random_test case. * Use a barrier to make all the threads start work as

[PATCH v2 6/7] selftests/powerpc/dscr: Speed up DSCR sysfs tests

2023-04-05 Thread Benjamin Gray
This test case is extremely slow, taking around a minute compared to most of the other DSCR tests taking a second at most. Perf shows most time is spent by the kernel switching to each CPU it reads in /sys/devices/system/cpu. This switching is an unavoidable consequnce of reading all the

[PATCH v2 3/7] selftests/powerpc: Allow bind_to_cpu() to automatically pick CPU

2023-04-05 Thread Benjamin Gray
All current users of bind_to_cpu() don't care _which_ CPU they get, just that they are bound to a single free one. So alter the interface to 1. Accept a BIND_CPU_ANY value that tells it to automatically pick a CPU 2. Return the picked CPU And convert all these users to

[PATCH v2 1/7] selftests/powerpc/dscr: Correct typos

2023-04-05 Thread Benjamin Gray
Correct a couple of typos while working on other improvements to the DSCR tests. Signed-off-by: Benjamin Gray --- tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 4 ++-- tools/testing/selftests/powerpc/dscr/dscr_inherit_test.c | 4 ++--

[PATCH v2 2/7] selftests/powerpc: Move bind_to_cpu() to utils.h

2023-04-05 Thread Benjamin Gray
This function will be useful in the DSCR test patches later in this series, so promote it to be shared by all powerpc selftests. Signed-off-by: Benjamin Gray --- v2: * New in v2 --- tools/testing/selftests/powerpc/include/utils.h | 1 + tools/testing/selftests/powerpc/pmu/lib.c |

[PATCH v2 0/7] Update DSCR tests

2023-04-05 Thread Benjamin Gray
The randomness based DSCR tests currently have a low probability of doing any writes to the DSCR, making them inefficient in uncovering bugs. This series adds lockstep variants to these RNG tests, to ensure the happy path is always tested, and improves the randomness and size of the RNG tests.

[PATCH v2 4/7] selftests/powerpc/dscr: Add lockstep test cases to DSCR explicit tests

2023-04-05 Thread Benjamin Gray
Add new cases to the relevant tests that use explicitly synchronized threads to test the behaviour across context switches with less randomness. By locking the participants to the same CPU we guarantee a context switch occurs each time they make progress, which is a likely failure point if the

Re: [PATCH] macintosh/windfarm_smu_sat: Add missing of_node_put()

2023-04-05 Thread Michael Ellerman
On Thu, 30 Mar 2023 11:35:58 +0800, Liang He wrote: > We call of_node_get() in wf_sat_probe() after sat is created, > so we need the of_node_put() before *kfree(sat)*. > > Applied to powerpc/next. [1/1] macintosh/windfarm_smu_sat: Add missing of_node_put()

Re: [PATCH v3] powerpc: Use of_address_to_resource()

2023-04-05 Thread Michael Ellerman
On Wed, 29 Mar 2023 17:03:36 -0500, Rob Herring wrote: > Replace open coded reading of "reg" or of_get_address()/ > of_translate_address() calls with a single call to > of_address_to_resource(). > > Applied to powerpc/next. [1/1] powerpc: Use of_address_to_resource()

Re: [PATCH] powerpc: xics: Use of_address_count()

2023-04-05 Thread Michael Ellerman
On Mon, 27 Mar 2023 17:30:56 -0500, Rob Herring wrote: > icp_native_init_one_node() only needs the number of entries in "reg". > Replace the open coded "reg" parsing with of_address_count() to get the > number of "reg" entries. > > Applied to powerpc/next. [1/1] powerpc: xics: Use

Re: [PATCH] powerpc: Use of_property_read_bool() for boolean properties

2023-04-05 Thread Michael Ellerman
On Fri, 10 Mar 2023 08:46:57 -0600, Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_ functions) rather than low-level > of_get_property/of_find_property functions for reading properties. > Convert reading boolean properties to to

Re: [PATCH] powerpc: Use of_property_present() for testing DT property presence

2023-04-05 Thread Michael Ellerman
On Fri, 10 Mar 2023 08:46:56 -0600, Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_ functions) rather than low-level > of_get_property/of_find_property functions for reading properties. As > part of this, convert

Re: [PATCH] powerpc: Use of_address_to_resource()

2023-04-05 Thread Michael Ellerman
On Sun, 19 Mar 2023 11:31:53 -0500, Rob Herring wrote: > Replace open coded reading of "reg" or of_get_address()/ > of_translate_address() calls with a single call to > of_address_to_resource(). > > Applied to powerpc/next. [1/1] powerpc: Use of_address_to_resource()

Re: [PATCH] powerpc: usbgecko: Use of_iomap()

2023-04-05 Thread Michael Ellerman
On Mon, 27 Mar 2023 17:31:09 -0500, Rob Herring wrote: > Replace of_get_property()+of_translate_address()+ioremap() with a call > to of_iomap() which does all those steps. > > Applied to powerpc/next. [1/1] powerpc: usbgecko: Use of_iomap()

Re: [PATCH] powerpc: isa-bridge: Remove open coded "ranges" parsing

2023-04-05 Thread Michael Ellerman
On Mon, 27 Mar 2023 17:30:45 -0500, Rob Herring wrote: > "ranges" is a standard property with common parsing functions. Users > shouldn't be implementing their own parsing of it. Reimplement the > ISA brige "ranges" parsing using the common ranges iterator functions. > > The common routines are

Re: [PATCH] powerpc: fsl_rio: Use of_iomap()

2023-04-05 Thread Michael Ellerman
On Mon, 27 Mar 2023 17:31:02 -0500, Rob Herring wrote: > Replace of_address_to_resource()+ioremap() with a call to of_iomap() > which does both of those steps. > > Applied to powerpc/next. [1/1] powerpc: fsl_rio: Use of_iomap()

Re: [PATCH] macintosh: Use of_property_present() for testing DT property presence

2023-04-05 Thread Michael Ellerman
On Fri, 10 Mar 2023 08:47:35 -0600, Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_ functions) rather than low-level > of_get_property/of_find_property functions for reading properties. As > part of this, convert

Re: [PATCH v2] macintosh: via-pmu-led: requires ATA to be set

2023-04-05 Thread Michael Ellerman
On Wed, 22 Feb 2023 17:42:41 -0800, Randy Dunlap wrote: > LEDS_TRIGGER_DISK depends on ATA, so selecting LEDS_TRIGGER_DISK > when ATA is not set/enabled causes a Kconfig warning: > > WARNING: unmet direct dependencies detected for LEDS_TRIGGER_DISK > Depends on [n]: NEW_LEDS [=y] &&

Re: [PATCH] powerpc/atomics: Remove unused function

2023-04-05 Thread Michael Ellerman
On Fri, 24 Feb 2023 16:09:40 +0530, Nysal Jan K.A wrote: > Remove arch_atomic_try_cmpxchg_lock function as it is no longer used > since commit 9f61521c7a28 ("powerpc/qspinlock: powerpc qspinlock > implementation") > > Applied to powerpc/next. [1/1] powerpc/atomics: Remove unused function

Re: [PATCH v3] powerpc: Implement arch_within_stack_frames

2023-04-05 Thread Michael Ellerman
On Tue, 28 Feb 2023 05:43:55 +, Nicholas Miehlbradt wrote: > Walks the stack when copy_{to,from}_user address is in the stack to > ensure that the object being copied is entirely a single stack frame and > does not contain stack metadata. > > Substantially similar to the x86 implementation.

Re: [PATCH] powerpc/perf: Properly detect mpc7450 family

2023-04-05 Thread Michael Ellerman
On Mon, 27 Feb 2023 16:54:45 +0100, Christophe Leroy wrote: > Unlike PVR_POWER8, etc , PVR_7450 represents a full PVR > value and not a family value. > > To avoid confusion, do like E500 family and define the relevant > PVR_VER_ values for the 7450 family: > 0x8000 ==> 7450 > 0x8001

Re: (subset) [PATCH 0/8] RTAS changes for 6.4

2023-04-05 Thread Michael Ellerman
On Mon, 06 Mar 2023 15:33:39 -0600, Nathan Lynch wrote: > Proposed changes for the RTAS subsystem and client code. > > Fixes that are subject to backporting are at the front of the queue, > followed by documentation and cleanups, with enhancements at the end. > > Noteworthy changes: > * Change

Re: (subset) [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

2023-04-05 Thread Michael Ellerman
On Wed, 15 Mar 2023 16:20:53 -0700, Ira Weiny wrote: > Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray > callbacks") removed the calls to memcpy_page_flushcache(). > > kmap_atomic() is deprecated and used in the x86 version of > memcpy_page_flushcache(). > > Remove the

Re: [PATCH] powerpc/pseries: Add spaces around / operator

2023-04-05 Thread Michael Ellerman
On Fri, 24 Mar 2023 23:00:41 +0100, Petr Vaněk wrote: > This is follow up change after 14b5d59a261b ("powerpc/pseries: Fix > formatting to make code look more beautiful") to conform to kernel > coding style. > > Applied to powerpc/next. [1/1] powerpc/pseries: Add spaces around / operator

Re: [PATCH 0/3] Clean up PowerPC selftest stderr output

2023-04-05 Thread Michael Ellerman
On Tue, 28 Feb 2023 11:07:06 +1100, Benjamin Gray wrote: > There are several messages being logged to stderr when building the PowerPC > selftests: > > $ make -j$(nproc) O=build -C tools/testing/selftests \ > INSTALL_PATH="$PWD"/out/selftests TARGETS=powerpc install > /dev/null > >

Re: [PATCH] KVM: PPC: Mark three local functions "static"

2023-04-05 Thread Michael Ellerman
On Wed, 08 Mar 2023 15:24:37 -0800, Sean Christopherson wrote: > Tag a few functions that are local and don't have a previous prototype as > "static". > > No functional change intended. > > Applied to powerpc/topic/ppc-kvm. [1/1] KVM: PPC: Mark three local functions "static"

Re: [PATCH 0/3] powerpc/kvm: Enable HV KVM guests to use prefixed instructions to access emulated MMIO

2023-04-05 Thread Michael Ellerman
On Wed, 08 Mar 2023 17:33:43 +1100, Paul Mackerras wrote: > This series changes the powerpc KVM code so that HV KVM can fetch > prefixed instructions from the guest in those situations where there > is a need to emulate an instruction, which for HV KVM means emulating > loads and stores to

Re: [PATCH v2 0/2] KVM: PPC: Book3S HV: Injected interrupt SRR1

2023-04-05 Thread Michael Ellerman
On Thu, 30 Mar 2023 20:32:22 +1000, Nicholas Piggin wrote: > I missed this in my earlier review and testing, but I think we need > these in the prefix instruction enablement series before the final patch > that enables HFSCR[PREFIX] for guests. > > Thanks, > Nick > > [...] Applied to

Re: [PATCH v2] KVM: PPC: BookE: Fix W=1 warnings

2023-04-05 Thread Michael Ellerman
On Mon, 03 Apr 2023 14:53:14 +1000, Michael Ellerman wrote: > Fix various W=1 warnings in booke.c: > > arch/powerpc/kvm/booke.c:1008:5: error: no previous prototype for > ‘kvmppc_handle_exit’ [-Werror=missing-prototypes] >1008 | int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int

Re: [PATCH v5] KVM: PPC: Book3S HV: kvmppc_hv_entry: remove .global scope

2023-04-05 Thread Michael Ellerman
On Mon, 27 Mar 2023 07:33:20 -0400, Kautuk Consul wrote: > kvmppc_hv_entry isn't called from anywhere other than > book3s_hv_rmhandlers.S itself. Removing .global scope for > this function and annotating it with SYM_CODE_START_LOCAL > and SYM_CODE_END. > > Applied to powerpc/topic/ppc-kvm.

Re: [PATCH] powerpc/mm: Fix false detection of read faults

2023-04-05 Thread Michael Ellerman
On Fri, 10 Mar 2023 16:08:34 +1100, Russell Currey wrote: > To support detection of read faults with Radix execute-only memory, the > vma_is_accessible() check in access_error() (which checks for PROT_NONE) > was replaced with a check to see if VM_READ was missing, and if so, > returns true to

Re: [PATCH v2] powerpc/pseries/vas: Ignore VAS update for DLPAR if copy/paste is not enabled

2023-04-05 Thread Michael Ellerman
On Mon, 20 Mar 2023 19:50:08 -0700, Haren Myneni wrote: > The hypervisor supports user-mode NX from Power10. pseries_vas_dlpar_cpu() > is called from lparcfg_write() to update VAS windows for DLPAR event in > shared processor mode and the kernel gets -ENOTSUPP for HCALLs if the > user-mode NX is

Re: [PATCH v2] powerpc/64s: Fix __pte_needs_flush() false positive warning

2023-04-05 Thread Michael Ellerman
On Fri, 03 Mar 2023 09:59:47 +1100, Benjamin Gray wrote: > Userspace PROT_NONE ptes set _PAGE_PRIVILEGED, triggering a false > positive debug assertion that __pte_flags_need_flush() is not called > on a kernel mapping. > > Detect when it is a userspace PROT_NONE page by checking the required >

Re: [PATCH] powerpc: don't try to copy ppc for task with NULL pt_regs

2023-04-05 Thread Michael Ellerman
On Sun, 26 Mar 2023 16:15:57 -0600, Jens Axboe wrote: > Powerpc sets up PF_KTHREAD and PF_IO_WORKER with a NULL pt_regs, which > from my (arguably very short) checking is not commonly done for other > archs. This is fine, except when PF_IO_WORKER's have been created and > the task does something

Re: [PATCH v2] powerpc/papr_scm: Update the NUMA distance table for the target node

2023-04-05 Thread Michael Ellerman
On Tue, 04 Apr 2023 09:44:33 +0530, Aneesh Kumar K.V wrote: > platform device helper routines won't update the NUMA distance table > while creating a platform device, even if the device is present on > a NUMA node that doesn't have memory or CPU. This is especially true > for pmem devices. If the

[PATCH v8 7/7] PCI: Work around PCIe link training failures

2023-04-05 Thread Maciej W. Rozycki
Attempt to handle cases such as with a downstream port of the ASMedia ASM2824 PCIe switch where link training never completes and the link continues switching between speeds indefinitely with the data link layer never reaching the active state. It has been observed with a downstream port of

[PATCH v8 6/7] net/mlx5: Rely on `link_active_reporting'

2023-04-05 Thread Maciej W. Rozycki
Use `link_active_reporting' to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Signed-off-by: Maciej W. Rozycki --- NB this has been compile-tested only with PPC64LE and x86-64 configurations. Changes from v7: - Reorder from 5/7.

[PATCH v8 5/7] powerpc/eeh: Rely on `link_active_reporting'

2023-04-05 Thread Maciej W. Rozycki
Use `link_active_reporting' to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Signed-off-by: Maciej W. Rozycki --- NB this has been compile-tested only with a PPC64LE configuration. Changes from v7: - Reorder from 4/7. No change

[PATCH v8 4/7] PCI: Initialize `link_active_reporting' earlier

2023-04-05 Thread Maciej W. Rozycki
Determine whether Data Link Layer Link Active Reporting is available ahead of calling any fixups so that the cached value can be used there and later on. Signed-off-by: Maciej W. Rozycki --- Changes from v7: - Reorder from 3/7. Changes from v6: - Regenerate against 6.3-rc5. New change in

[PATCH v8 3/7] PCI: Execute `quirk_enable_clear_retrain_link' earlier

2023-04-05 Thread Maciej W. Rozycki
Make `quirk_enable_clear_retrain_link' `pci_fixup_early' so that any later fixups can rely on `clear_retrain_link' to have been already initialised. Signed-off-by: Maciej W. Rozycki --- Changes from v7: - Reorder from 2/7. No change from v6. No change from v5. New change in v5. ---

[PATCH v8 2/7] PCI: Export PCI link retrain timeout

2023-04-05 Thread Maciej W. Rozycki
Rename LINK_RETRAIN_TIMEOUT to PCIE_LINK_RETRAIN_TIMEOUT and make it available via "pci.h" for PCI drivers to use. Signed-off-by: Maciej W. Rozycki --- Changes from v7: - Reorder from 1/7. No change from v6. No change from v5. New change in v5. --- drivers/pci/pci.h |2 ++

[PATCH v8 1/7] PCI: pciehp: Rely on `link_active_reporting'

2023-04-05 Thread Maciej W. Rozycki
Use `link_active_reporting' to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Signed-off-by: Maciej W. Rozycki Reviewed-by: Lukas Wunner --- NB this has been compile-tested only with PPC64LE and x86-64 configurations. Changes

[PATCH v8 0/7] pci: Work around ASMedia ASM2824 PCIe link training failures

2023-04-05 Thread Maciej W. Rozycki
Hi, This is v8 of the change to work around a PCIe link training phenomenon where a pair of devices both capable of operating at a link speed above 2.5GT/s seems unable to negotiate the link speed and continues training indefinitely with the Link Training bit switching on and off repeatedly

Re: [kvm-unit-tests v3 10/13] powerpc: Add support for more interrupts including HV interrupts

2023-04-05 Thread Joel Stanley
Hi Nick, On Mon, 27 Mar 2023 at 12:55, Nicholas Piggin wrote: > > Interrupt vectors were not being populated for all architected > interrupt types, which could lead to crashes rather than a message for > unhandled interrupts. > > 0x20 sized vectors require some reworking of the code to fit. This

RE: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary

2023-04-05 Thread David Laight
From: Linuxppc-dev Arnd Bergmann > Sent: 05 April 2023 21:32 > > On Wed, Apr 5, 2023, at 22:00, H. Peter Anvin wrote: > > On April 5, 2023 8:12:38 AM PDT, Niklas Schnelle > > wrote: > >>On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: > >>> We introduce a new HAS_IOPORT Kconfig option

Re: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary

2023-04-05 Thread Arnd Bergmann
On Wed, Apr 5, 2023, at 22:00, H. Peter Anvin wrote: > On April 5, 2023 8:12:38 AM PDT, Niklas Schnelle > wrote: >>On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: >>> We introduce a new HAS_IOPORT Kconfig option to indicate support for I/O >>> Port access. In a future patch

Re: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary

2023-04-05 Thread Arnd Bergmann
On Wed, Apr 5, 2023, at 17:12, Niklas Schnelle wrote: > On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: > > Gentle ping. As far as I can tell this hasn't been picked to any tree > sp far but also hasn't seen complains so I'm wondering if I should send > a new version of the combined

Re: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary

2023-04-05 Thread H. Peter Anvin
On April 5, 2023 8:12:38 AM PDT, Niklas Schnelle wrote: >On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: >> We introduce a new HAS_IOPORT Kconfig option to indicate support for I/O >> Port access. In a future patch HAS_IOPORT=n will disable compilation of >> the I/O accessor functions

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-05 Thread Bjorn Helgaas
On Wed, Apr 05, 2023 at 11:28:27AM +0300, Andy Shevchenko wrote: > On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > > Provide two new helper macros to iterate over PCI device resources and > > > convert users. >

Re: [PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-04-05 Thread Bjorn Helgaas
On Wed, Apr 05, 2023 at 02:50:47PM +0300, Andy Shevchenko wrote: > On Thu, Mar 30, 2023 at 07:24:32PM +0300, Andy Shevchenko wrote: > > Refactor pci_bus_for_each_resource() in the same way as it's done in > > pci_dev_for_each_resource() case. This will allow to hide iterator > > inside the loop,

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Peter Zijlstra
On Wed, Apr 05, 2023 at 04:43:14PM -0300, Marcelo Tosatti wrote: > Two points: > > 1) For a virtualized system, the overhead is not only of executing the > IPI but: > > VM-exit > run VM-exit code in host > handle IPI > run VM-entry code in host > VM-entry I

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Peter Zijlstra
On Wed, Apr 05, 2023 at 04:45:32PM -0300, Marcelo Tosatti wrote: > On Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: > > On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > > > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > > > + int

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Marcelo Tosatti
On Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: > On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > > + int state = atomic_read(>state); > > > + /* will return true only for cpus in

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Marcelo Tosatti
On Wed, Apr 05, 2023 at 12:43:58PM +0200, Frederic Weisbecker wrote: > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > @@ -191,6 +192,20 @@ static void tlb_remove_table_smp_sync(void *arg) > > /* Simply deliver the interrupt */ > > } > > > > + > > +#ifdef

Re: [PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
On Wed, Apr 5, 2023 at 6:37 PM Dave Hansen wrote: > > On 4/5/23 07:17, Uros Bizjak wrote: > > Add generic and target specific support for local{,64}_try_cmpxchg > > and wire up support for all targets that use local_t infrastructure. > > I feel like I'm missing some context. > > What are the

Re: [PATCH 01/18] fbdev: Prepare generic architecture helpers

2023-04-05 Thread Thomas Zimmermann
Hi Am 05.04.23 um 17:53 schrieb Arnd Bergmann: On Wed, Apr 5, 2023, at 17:05, Thomas Zimmermann wrote: Generic implementations of fb_pgprotect() and fb_is_primary_device() have been in the source code for a long time. Prepare the header file to make use of them. Improve the code by using an

Re: [PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-05 Thread Dave Hansen
On 4/5/23 07:17, Uros Bizjak wrote: > Add generic and target specific support for local{,64}_try_cmpxchg > and wire up support for all targets that use local_t infrastructure. I feel like I'm missing some context. What are the actual end user visible effects of this series? Is there a

Re: [PATCH 01/18] fbdev: Prepare generic architecture helpers

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 05:53:03PM +0200, Arnd Bergmann wrote: > On Wed, Apr 5, 2023, at 17:05, Thomas Zimmermann wrote: > > Generic implementations of fb_pgprotect() and fb_is_primary_device() > > have been in the source code for a long time. Prepare the header file > > to make use of them. > > >

Re: [PATCH 01/18] fbdev: Prepare generic architecture helpers

2023-04-05 Thread Arnd Bergmann
On Wed, Apr 5, 2023, at 17:05, Thomas Zimmermann wrote: > Generic implementations of fb_pgprotect() and fb_is_primary_device() > have been in the source code for a long time. Prepare the header file > to make use of them. > > Improve the code by using an inline function for fb_pgprotect() and > by

Re: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary

2023-04-05 Thread Niklas Schnelle
On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: > We introduce a new HAS_IOPORT Kconfig option to indicate support for I/O > Port access. In a future patch HAS_IOPORT=n will disable compilation of > the I/O accessor functions inb()/outb() and friends on architectures > which can not

[PATCH 18/18] arch/x86: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Include and set the required preprocessor tokens correctly. x86 now implements its own set of fb helpers, but still follows the overall pattern. Signed-off-by: Thomas Zimmermann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" ---

[PATCH 16/18] arch/sparc: Implement fb_is_primary_device() in source file

2023-04-05 Thread Thomas Zimmermann
Other architectures implment fb_is_primary_device() in a source file. Do the same on sparc. No functional changes, but allows to remove several include statement from . Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" --- arch/sparc/Makefile | 1 + arch/sparc/include/asm/fb.h |

[PATCH 17/18] arch/sparc: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_pgprotect() with the generic one from on 32-bit builds. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "David S. Miller" --- arch/sparc/include/asm/fb.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH 14/18] arch/powerpc: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy --- arch/powerpc/include/asm/fb.h | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-)

[PATCH 09/18] video: Remove trailing whitespaces

2023-04-05 Thread Thomas Zimmermann
Fix trailing whitespaces. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/video/console/sticon.c | 4 +- drivers/video/console/sticore.c | 102 ++--- drivers/video/fbdev/sticore.h | 14 +-- drivers/video/fbdev/stifb.c | 156

[PATCH 08/18] arch/mips: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Thomas Bogendoerfer --- arch/mips/include/asm/fb.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/mips/include/asm/fb.h

[PATCH 04/18] arch/arm64: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/fb.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH 02/18] arch/arc: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Vineet Gupta --- arch/arc/include/asm/fb.h | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arc/include/asm/fb.h

[PATCH 12/18] arch/parisc: Implement fb_is_primary_device() under arch/parisc

2023-04-05 Thread Thomas Zimmermann
Move PARISC's implementation of fb_is_primary_device() into the architecture directory. This the place of the declaration and where other architectures implement this function. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller ---

[PATCH 05/18] arch/ia64: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann --- arch/ia64/include/asm/fb.h | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/ia64/include/asm/fb.h

[PATCH 06/18] arch/loongarch: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Huacai Chen Cc: WANG Xuerui --- arch/loongarch/include/asm/fb.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH 15/18] arch/sh: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz --- arch/sh/include/asm/fb.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-)

[PATCH 13/18] arch/parisc: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from on systems without CONFIG_STI_CORE. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller --- arch/parisc/include/asm/fb.h | 15 --- 1 file changed, 8

[PATCH 11/18] arch/parisc: Remove trailing whitespaces

2023-04-05 Thread Thomas Zimmermann
Fix trailing whitespaces. No functional changes. Signed-off-by: Thomas Zimmermann Cc: "James E.J. Bottomley" Cc: Helge Deller --- arch/parisc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index

[PATCH 07/18] arch/m68k: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Also use the generic helper for fb_pgprotect() on systems without MMU. Signed-off-by: Thomas Zimmermann Cc: Geert Uytterhoeven --- arch/m68k/include/asm/fb.h | 10 +++--- 1 file changed, 3

[PATCH 10/18] video: Move HP PARISC STI core code to shared location

2023-04-05 Thread Thomas Zimmermann
STI core files have been located in console and fbdev code. Move the source code and header to the directories for video helpers. Also update the config and build rules such that the code depends on the config symbol CONFIG_STI_CORE, which STI console and STI framebuffer select automatically.

[PATCH 00/18] arch: Consolidate

2023-04-05 Thread Thomas Zimmermann
Various architectures provide with helpers for fbdev framebuffer devices. Share the contained code where possible. There is already , which implements generic (as in 'empty') functions of the fbdev helpers. The header was added in commit aafe4dbed0bf ("asm-generic: add generic versions of common

[PATCH 01/18] fbdev: Prepare generic architecture helpers

2023-04-05 Thread Thomas Zimmermann
Generic implementations of fb_pgprotect() and fb_is_primary_device() have been in the source code for a long time. Prepare the header file to make use of them. Improve the code by using an inline function for fb_pgprotect() and by removing include statements. Symbols are protected by

[PATCH 03/18] arch/arm: Implement with generic helpers

2023-04-05 Thread Thomas Zimmermann
Replace the architecture's fb_is_primary_device() with the generic one from . No functional changes. Signed-off-by: Thomas Zimmermann Cc: Russell King --- arch/arm/include/asm/fb.h | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/fb.h

[PATCH v2 5/5] events: Illustrate the transition to local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
This patch illustrates the transition to local{,64}_try_cmpxchg. It is not intended to be merged as-is. Signed-off-by: Uros Bizjak --- arch/x86/events/core.c | 9 - kernel/events/ring_buffer.c | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH v2 4/5] locking/x86: Define arch_try_cmpxchg_local

2023-04-05 Thread Uros Bizjak
Define target specific arch_try_cmpxchg_local. This definition overrides the generic arch_try_cmpxchg_local fallback definition and enables target-specific implementation of try_cmpxchg_local. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin"

[PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg and local_cmpxchg using typed C wrappers that call their _local counterpart and provide additional checking of their input arguments. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Huacai Chen Cc: WANG Xuerui Cc: Jiaxun

[PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Add generic and target specific support for local{,64}_try_cmpxchg and wire up support for all targets that use local_t infrastructure. The patch enables x86 targets to emit special instruction for local_try_cmpxchg and also local64_try_cmpxchg for x86_64. The last patch changes

[PATCH v2 2/5] locking/generic: Wire up local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Implement generic support for local{,64}_try_cmpxchg. Redirect to the atomic_ family of functions when the target does not provide its own local.h definitions. For 64-bit targets, implement local64_try_cmpxchg and local64_cmpxchg using typed C wrappers that call local_ family of functions and

[PATCH v2 1/5] locking/atomic: Add generic try_cmpxchg{,64}_local support

2023-04-05 Thread Uros Bizjak
Add generic support for try_cmpxchg{,64}_local and their falbacks. These provides the generic try_cmpxchg_local family of functions from the arch_ prefixed version, also adding explicit instrumentation. Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Valentin Schneider
On 05/04/23 14:05, Frederic Weisbecker wrote: > static void smp_call_function_many_cond(const struct cpumask *mask, > smp_call_func_t func, void *info, > @@ -946,10 +948,13 @@ static void smp_call_function_many_cond(const struct > cpumask *mask, > #endif >

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Frederic Weisbecker
On Wed, Apr 05, 2023 at 02:05:13PM +0200, Frederic Weisbecker wrote: > On Wed, Apr 05, 2023 at 01:41:48PM +0200, Peter Zijlstra wrote: > 1) It has the advantage to check context tracking _after_ the llist_add(), so >it really can't be misused ordering-wise. > > 2) The IPI callback is always

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Frederic Weisbecker
On Wed, Apr 05, 2023 at 01:41:48PM +0200, Peter Zijlstra wrote: > On Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: > > On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > > > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > > > + int

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread David Hildenbrand
On 05.04.23 13:41, Peter Zijlstra wrote: On Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: + int state = atomic_read(>state); + /*

Re: [PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:32PM +0300, Andy Shevchenko wrote: > Refactor pci_bus_for_each_resource() in the same way as it's done in > pci_dev_for_each_resource() case. This will allow to hide iterator > inside the loop, where it's not used otherwise. > > No functional changes intended.

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Peter Zijlstra
On Wed, Apr 05, 2023 at 01:10:07PM +0200, Frederic Weisbecker wrote: > On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > > + int state = atomic_read(>state); > > > + /* will return true only for cpus in

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Frederic Weisbecker
On Wed, Apr 05, 2023 at 12:44:04PM +0200, Frederic Weisbecker wrote: > On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > > + int state = atomic_read(>state); > > + /* will return true only for cpus in kernel space */ > > + return state & CT_STATE_MASK == CONTEXT_KERNEL; > > +}

Re: [PATCH] powerpc/64: Always build with 128-bit long double

2023-04-05 Thread Segher Boessenkool
Hi! On Wed, Apr 05, 2023 at 03:32:21PM +1000, Michael Ellerman wrote: > Segher Boessenkool writes: > > On Tue, Apr 04, 2023 at 08:28:47PM +1000, Michael Ellerman wrote: > >> The amdgpu driver builds some of its code with hard-float enabled, > >> whereas the rest of the kernel is built with

Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode

2023-04-05 Thread Frederic Weisbecker
On Tue, Apr 04, 2023 at 04:42:24PM +0300, Yair Podemsky wrote: > @@ -191,6 +192,20 @@ static void tlb_remove_table_smp_sync(void *arg) > /* Simply deliver the interrupt */ > } > > + > +#ifdef CONFIG_CONTEXT_TRACKING > +static bool cpu_in_kernel(int cpu, void *info) > +{ > + struct

[powerpc:next] BUILD SUCCESS b0bbe5a2915201e3231e788d716d39dc54493b03

2023-04-05 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: b0bbe5a2915201e3231e788d716d39dc54493b03 powerpc/atomics: Remove unused function elapsed time: 1250m configs tested: 332 configs skipped: 28 The following configs have been built successfully.

Re: [PATCH v8 7/7] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:34PM +0300, Andy Shevchenko wrote: ... > @@ -960,12 +960,9 @@ static int nonstatic_autoadd_resources(struct > pcmcia_socket *s) >*/ > if (s->cb_dev->bus->number == 0) > return -EINVAL; > - > - for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM;

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-05 Thread Andy Shevchenko
On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > Provide two new helper macros to iterate over PCI device resources and > > convert users. > > > > Looking at it, refactor existing pci_bus_for_each_resource() and