Re: [PATCH] ALSA: pcm: Convert snd_pcm_ioctl_sync_ptr_{compat/x32} to user_access_begin/user_access_end()

2025-06-12 Thread Christophe Leroy
Le 12/06/2025 à 13:02, Takashi Iwai a écrit : On Thu, 12 Jun 2025 12:39:39 +0200, Christophe Leroy wrote: With user access protection (Called SMAP on x86 or KUAP on powerpc) each and every call to get_user() or put_user() performs heavy operations to unlock and lock kernel access to userspac

Re: [PATCH 1/4] PM: cpufreq: powernv/tracing: Move powernv_throttle trace event

2025-06-12 Thread Viresh Kumar
On 12-06-25, 10:53, Steven Rostedt wrote: > From: Steven Rostedt > > As the trace event powernv_throttle is only used by the powernv code, move > it to a separate include file and have that code directly enable it. > > Trace events can take up around 5K of memory when they are defined > regardle

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-12 Thread Alistair Popple
On Thu, Jun 12, 2025 at 03:15:31PM +0100, Lorenzo Stoakes wrote: > On Thu, May 29, 2025 at 04:32:04PM +1000, Alistair Popple wrote: > > Previously dax pages were skipped by the pagewalk code as pud_special() or > > vm_normal_page{_pmd}() would be false for DAX pages. Now that dax pages are > > refc

Re: [PATCH 0/4] PM: tracing: Don't compile in unused trace events

2025-06-12 Thread Rafael J. Wysocki
On Thu, Jun 12, 2025 at 4:52 PM Steven Rostedt wrote: > > > I have code that makes unsued events trigger a warning. I'm currently cleaning > up the kernel to remove the majority of events that are defined but not used. > When an event is defined, it can take up to 5K of text and meta data per > ev

[PATCH 3/6] mm/debug: Detect wrong arch_enter_lazy_mmu_mode() contexts

2025-06-12 Thread Alexander Gordeev
Make default arch_enter|leave|flush_lazy_mmu_mode() callbacks complain on enabled preemption to detect wrong contexts. That could help to prevent the complicated lazy MMU mode semantics misuse, such like one that was solved with commit b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy mmu

[PATCH 2/6] mm: Lock kernel page tables before entering lazy MMU mode

2025-06-12 Thread Alexander Gordeev
As a follow-up to commit 691ee97e1a9d ("mm: fix lazy mmu docs and usage") take a step forward and protect with a lock not only user, but also kernel mappings before entering the lazy MMU mode. With that the semantics of arch_enter|leave_lazy_mmu_mode() callbacks is consolidated, which allows furthe

[PATCH 6/6] powerpc/64s: Do not re-activate batched TLB flush

2025-06-12 Thread Alexander Gordeev
Since commit b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy mmu mode") a task can not be preempted while in lazy MMU mode. Therefore, the batch re-activation code is never called, so remove it. Signed-off-by: Alexander Gordeev --- arch/powerpc/include/asm/thread_info.h | 2 -- arch

[PATCH 4/6] sparc/mm: Do not disable preemption in lazy MMU mode

2025-06-12 Thread Alexander Gordeev
Commit a1d416bf9faf ("sparc/mm: disable preemption in lazy mmu mode") is not necessary anymore, since the lazy MMU mode is entered with a spinlock held and sparc does not support Real-Time. Thus, upon entering the lazy mode the preemption is already disabled. Signed-off-by: Alexander Gordeev ---

[PATCH 1/6] mm: Cleanup apply_to_pte_range() routine

2025-06-12 Thread Alexander Gordeev
Reverse 'create' vs 'mm == &init_mm' conditions and move page table mask modification out of the atomic context. This is a prerequisite for locking kernel page tables. Reviewed-by: Nicholas Piggin Signed-off-by: Alexander Gordeev --- mm/memory.c | 28 +--- 1 file changed

[PATCH 0/6] mm: Consolidate lazy MMU mode context

2025-06-12 Thread Alexander Gordeev
Hi All, Consolidate arch_enter|leave|flush_lazy_mmu_mode() context and protect with a lock not only user, but also kernel mappings before entering the lazy MMU mode. For not fully preemptible (Real-Time) kernels that simplifies semantics - while the mode is active the code should assume it is exe

[PATCH 5/6] powerpc/64s: Do not disable preemption in lazy MMU mode

2025-06-12 Thread Alexander Gordeev
Commit b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy mmu mode") is not necessary anymore, since the lazy MMU mode is entered with a spinlock held and powerpc does not support Real-Time. Thus, upon entering the lazy mode the preemption is already disabled. Signed-off-by: Alexander Gor

[RFC PATCH 1/3] ALSA: pcm: refactor copy from/to user in SNDRV_PCM_IOCTL_SYNC_PTR

2025-06-12 Thread Christophe Leroy
In an effort of optimising SNDRV_PCM_IOCTL_SYNC_PTR ioctl which is a hot path, lets first refactor the copy from and to user with macros. This is done with macros and not static inline fonctions because types differs between the different versions of snd_pcm_sync_ptr() like functions. First step

[PATCH 4/4] PM: tracing: Hide power_domain_target event under ARCH_OMAP2PLUS

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The power_domain_target event event is only called when CONFIG_OMAP2PLUS is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used. Signed-off-by:

[PATCH 0/4] PM: tracing: Don't compile in unused trace events

2025-06-12 Thread Steven Rostedt
I have code that makes unsued events trigger a warning. I'm currently cleaning up the kernel to remove the majority of events that are defined but not used. When an event is defined, it can take up to 5K of text and meta data per event. An event should not be created if it is not being used. The

[PATCH 2/4] PM: tracing: Hide psci_domain_idle events under ARM_PSCI_CPUIDLE

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The events psci_domain_idle_enter and psci_domain_idle_exit events are only called when CONFIG_ARM_PSCI_CPUIDLE is defined. As each event can take up to 5K (less for DEFINE_EVENT()) regardless if they are used or not, it's best not to define them when they are not used. Add #

[PATCH 1/4] PM: cpufreq: powernv/tracing: Move powernv_throttle trace event

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt As the trace event powernv_throttle is only used by the powernv code, move it to a separate include file and have that code directly enable it. Trace events can take up around 5K of memory when they are defined regardless if they are used or not. It wastes memory to have the

[PATCH 3/4] PM: tracing: Hide device_pm_callback events under PM_SLEEP

2025-06-12 Thread Steven Rostedt
From: Steven Rostedt The events device_pm_callback_start and device_pm_callback_end events are only called when CONFIG_PM_SLEEP is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when

Re: [PATCH 2/2] soc: renesas: pwc-rzv2m: use new GPIO line value setter callbacks

2025-06-12 Thread Geert Uytterhoeven
On Tue, 10 Jun 2025 at 14:38, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > struct gpio_chip now has callbacks for setting line values that return > an integer, allowing to indicate failures. Convert the driver to using > them. > > Signed-off-by: Bartosz Golaszewski Reviewed-by: Ge

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-12 Thread Lorenzo Stoakes
On Thu, May 29, 2025 at 04:32:04PM +1000, Alistair Popple wrote: > Previously dax pages were skipped by the pagewalk code as pud_special() or > vm_normal_page{_pmd}() would be false for DAX pages. Now that dax pages are > refcounted normally that is no longer the case, so add explicit checks to > s

Re: [PATCH 7/8] KVM: s390: Stop adding virt/kvm to the arch include path

2025-06-12 Thread Janosch Frank
On 6/11/25 2:10 AM, Sean Christopherson wrote: Don't add virt/kvm to KVM s390's include path, the headers in virt/kvm are intended to be used only by other code in virt/kvm, i.e. are "private" to the core KVM code. It's not clear that s390 *ever* included a header from virt/kvm, i.e. odds are go

[RFC PATCH 2/3] ALSA: pcm: Convert SNDRV_PCM_IOCTL_SYNC_PTR to user_access_begin/user_access_end()

2025-06-12 Thread Christophe Leroy
With user access protection (Called SMAP on x86 or KUAP on powerpc) each and every call to get_user() or put_user() performs heavy operations to unlock and lock kernel access to userspace. SNDRV_PCM_IOCTL_SYNC_PTR is a hot path which is called really often and needs to run as fast as possible. To

Re: [PATCH] soc: Use dev_fwnode()

2025-06-12 Thread Christophe Leroy
Le 12/06/2025 à 13:31, Krzysztof Kozlowski a écrit : On 11/06/2025 12:43, Jiri Slaby (SUSE) wrote: irq_domain_create_simple() takes fwnode as the first argument. It can be extracted from the struct device using dev_fwnode() helper instead of using of_node with of_fwnode_handle(). So use the

[RFC PATCH 3/3] ALSA: pcm: Convert snd_pcm_sync_ptr() to user_access_begin/user_access_end()

2025-06-12 Thread Christophe Leroy
Now that snd_pcm_sync_ptr_get_user() and snd_pcm_sync_ptr_put_user() are converted to user_access_begin/user_access_end(), snd_pcm_sync_ptr_get_user() is more efficient than a raw get_user() followed by a copy_from_user(). And because copy_{to/from}_user() are generic functions focussed on transfer

Re: [PATCH] soc: Use dev_fwnode()

2025-06-12 Thread Krzysztof Kozlowski
On 11/06/2025 12:43, Jiri Slaby (SUSE) wrote: > irq_domain_create_simple() takes fwnode as the first argument. It can be > extracted from the struct device using dev_fwnode() helper instead of > using of_node with of_fwnode_handle(). > > So use the dev_fwnode() helper. > > Signed-off-by: Jiri Sla

Re: [PATCH] ALSA: pcm: Convert snd_pcm_ioctl_sync_ptr_{compat/x32} to user_access_begin/user_access_end()

2025-06-12 Thread Takashi Iwai
On Thu, 12 Jun 2025 12:39:39 +0200, Christophe Leroy wrote: > > With user access protection (Called SMAP on x86 or KUAP on powerpc) > each and every call to get_user() or put_user() performs heavy > operations to unlock and lock kernel access to userspace. > > SNDRV_PCM_IOCTL_SYNC_PTR ioctl is a

[PATCH] ALSA: pcm: Convert snd_pcm_ioctl_sync_ptr_{compat/x32} to user_access_begin/user_access_end()

2025-06-12 Thread Christophe Leroy
With user access protection (Called SMAP on x86 or KUAP on powerpc) each and every call to get_user() or put_user() performs heavy operations to unlock and lock kernel access to userspace. SNDRV_PCM_IOCTL_SYNC_PTR ioctl is a hot path that needs to be optimised. To do that, perform user accesses by

Re: [PATCH v2] ALSA: pcm: Convert multiple {get/put}_user to user_access_begin/user_access_end()

2025-06-12 Thread Christophe Leroy
Le 09/06/2025 à 13:00, Takashi Iwai a écrit : On Mon, 09 Jun 2025 12:02:00 +0200, Christophe Leroy wrote: Le 09/06/2025 à 10:10, Takashi Iwai a écrit : On Mon, 09 Jun 2025 10:00:38 +0200, Christophe Leroy wrote: With user access protection (Called SMAP on x86 or KUAP on powerpc) each an

Re: [PATCH v4 3/3] PCI/AER: Report fatal errors of RCiEP and EP if link recoverd

2025-06-12 Thread Manivannan Sadhasivam
On Sun, Mar 02, 2025 at 07:43:41PM -0800, Sathyanarayanan Kuppuswamy wrote: > > On 2/16/25 6:42 PM, Shuai Xue wrote: > > The AER driver has historically avoided reading the configuration space of > > an endpoint or RCiEP that reported a fatal error, considering the link to > > that device unreliab

Re: [PATCH v4 2/3] PCI/DPC: Run recovery on device that detected the error

2025-06-12 Thread Manivannan Sadhasivam
On Mon, Feb 17, 2025 at 10:42:17AM +0800, Shuai Xue wrote: > The current implementation of pcie_do_recovery() assumes that the > recovery process is executed on the device that detected the error. s/on/for > However, the DPC driver currently passes the error port that experienced > the DPC event

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-12 Thread Alistair Popple
On Thu, Jun 12, 2025 at 05:02:13PM +1000, Alistair Popple wrote: > On Thu, Jun 05, 2025 at 09:21:28AM -0700, Dan Williams wrote: > > David Hildenbrand wrote: > > > On 05.06.25 09:46, Christoph Hellwig wrote: > > > > On Wed, Jun 04, 2025 at 06:59:09PM -0700, Dan Williams wrote: > > > >> +/* return n

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-12 Thread Alistair Popple
On Thu, Jun 05, 2025 at 09:21:28AM -0700, Dan Williams wrote: > David Hildenbrand wrote: > > On 05.06.25 09:46, Christoph Hellwig wrote: > > > On Wed, Jun 04, 2025 at 06:59:09PM -0700, Dan Williams wrote: > > >> +/* return normal pages backed by the page allocator */ > > >> +static inline struct pa