Re: [PATCH v4 2/7] xtensa: kcsan: Remove kcsan stubs for atomic builtins

2023-02-07 Thread Max Filippov
On Tue, Feb 7, 2023 at 7:22 PM Rohan McLure wrote: > > A prior patch implemented stubs in place of the __atomic_* builtins in > generic code, as it is useful for other 32-bit architectures such as > 32-bit powerpc. > > Remove the kcsan-stubs.c translation unit and instead use > the generic

Re: [PATCH v4 1/7] kcsan: Add atomic builtin stubs for 32-bit systems

2023-02-07 Thread Max Filippov
On Tue, Feb 7, 2023 at 7:22 PM Rohan McLure wrote: > > KCSAN instruments calls to atomic builtins, and will in turn call these > builtins itself. As such, architectures supporting KCSAN must have > compiler support for these atomic primitives. > > Since 32-bit systems are unlikely to have 64-bit

Re: [PATCH] tools/perf/tests: Add system wide check for perf bench workload in all metric test

2023-02-07 Thread kajoljain
On 2/6/23 10:10, Athira Rajeev wrote: > > >> On 02-Feb-2023, at 10:14 PM, Kajol Jain wrote: >> >> Testcase stat_all_metrics.sh fails in powerpc: >> >> 92: perf all metrics test : FAILED! >> >> Logs with verbose: >> >> [command]# ./perf test 92 -vv >> 92: perf all metrics test

[PATCH v4 7/7] powerpc: kcsan: Add KCSAN Support

2023-02-07 Thread Rohan McLure
Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options. KCSAN requires compiler builtins __atomic_* 64-bit values, and so only report support on PPC64. See documentation in Documentation/dev-tools/kcsan.rst

[PATCH v4 6/7] powerpc: kcsan: Prevent recursive instrumentation with IRQ save/restores

2023-02-07 Thread Rohan McLure
Instrumented memory accesses provided by KCSAN will access core-local memories (which will save and restore IRQs) as well as restoring IRQs directly. Avoid recursive instrumentation by applying __no_kcsan annotation to IRQ restore routines. Signed-off-by: Rohan McLure ---

[PATCH v4 5/7] powerpc: kcsan: Memory barriers semantics

2023-02-07 Thread Rohan McLure
Annotate memory barriers *mb() with calls to kcsan_mb(), signaling to compilers supporting KCSAN that the respective memory barrier has been issued. Rename memory barrier *mb() to __*mb() to opt in for asm-generic/barrier.h to generate the respective *mb() macro. Signed-off-by: Rohan McLure ---

[PATCH v4 4/7] powerpc: kcsan: Exclude udelay to prevent recursive instrumentation

2023-02-07 Thread Rohan McLure
In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts. Stalls are implemented by injecting a call to udelay in instrumented code. To prevent

[PATCH v4 3/7] powerpc: kcsan: Add exclusions from instrumentation

2023-02-07 Thread Rohan McLure
Exclude various incompatible compilation units from KCSAN instrumentation. Signed-off-by: Rohan McLure --- arch/powerpc/kernel/Makefile | 10 ++ arch/powerpc/kernel/trace/Makefile | 1 + arch/powerpc/kernel/vdso/Makefile | 1 + arch/powerpc/lib/Makefile | 2 ++

[PATCH v4 2/7] xtensa: kcsan: Remove kcsan stubs for atomic builtins

2023-02-07 Thread Rohan McLure
A prior patch implemented stubs in place of the __atomic_* builtins in generic code, as it is useful for other 32-bit architectures such as 32-bit powerpc. Remove the kcsan-stubs.c translation unit and instead use the generic implementation. Signed-off-by: Rohan McLure --- V4: New patch ---

[PATCH v4 1/7] kcsan: Add atomic builtin stubs for 32-bit systems

2023-02-07 Thread Rohan McLure
KCSAN instruments calls to atomic builtins, and will in turn call these builtins itself. As such, architectures supporting KCSAN must have compiler support for these atomic primitives. Since 32-bit systems are unlikely to have 64-bit compiler builtins, provide a stub for each missing builtin, and

[PATCH v4 0/7] powerpc: Add KCSAN Support

2023-02-07 Thread Rohan McLure
Add Kernel Concurrency Sanitiser support for PPC64. Doing so involves exclusion of a number of compilation units from instrumentation, as was done with KASAN. KCSAN uses watchpoints on memory accesses to enforce the semantics of the Linux kernel memory model, notifying the user of observed data

Re: [PATCH 3/3] ALSA: core: Make snd_card_free() return void

2023-02-07 Thread Geoff Levand
Hi Uwe, On 2/7/23 11:19, Uwe Kleine-König wrote: > The function returns 0 unconditionally. Make it return void instead and > simplify all callers accordingly. > > Signed-off-by: Uwe Kleine-König > --- > include/sound/core.h | 2 +- > sound/core/init.c | 6 ++ >

Re: [PATCH v4 5/7] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-02-07 Thread Hyeonggon Yoo
On Thu, Jan 26, 2023 at 11:37:50AM -0800, Suren Baghdasaryan wrote: > Replace indirect modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. > > Signed-off-by: Suren Baghdasaryan > Acked-by: Michal Hocko >

Re: [PATCH v4 2/7] mm: introduce vma->vm_flags wrapper functions

2023-02-07 Thread Hyeonggon Yoo
On Thu, Jan 26, 2023 at 11:37:47AM -0800, Suren Baghdasaryan wrote: > vm_flags are among VMA attributes which affect decisions like VMA merging > and splitting. Therefore all vm_flags modifications are performed after > taking exclusive mmap_lock to prevent vm_flags updates racing with such >

Re: [PATCH 1/1] mm: introduce vm_flags_reset_once to replace WRITE_ONCE vm_flags updates

2023-02-07 Thread Hyeonggon Yoo
On Tue, Jan 31, 2023 at 04:01:16PM -0800, Suren Baghdasaryan wrote: > Provide vm_flags_reset_once() and replace the vm_flags updates which used > WRITE_ONCE() to prevent compiler optimizations. > > Fixes: 0cce31a0aa0e ("mm: replace vma->vm_flags direct modifications with > modifier calls") >

Re: [PATCH v3 04/12] gpiolib: remove gpio_set_debounce

2023-02-07 Thread Dmitry Torokhov
On Tue, Feb 07, 2023 at 04:29:44PM +0200, Andy Shevchenko wrote: > @@ -1010,14 +1009,21 @@ static int ads7846_setup_pendown(struct spi_device > *spi, > } > > ts->gpio_pendown = pdata->gpio_pendown; > - > - if (pdata->gpio_pendown_debounce) > -

Re: [PATCH v3 01/12] gpiolib: remove empty asm/gpio.h files

2023-02-07 Thread Vincenzo Palazzo
> From: Arnd Bergmann > > The arm and sh versions of this file are identical to the generic > versions and can just be removed. > > The drivers that actually use the sh3 specific version also include > cpu/gpio.h directly, with the exception of magicpanelr2, which is > easily fixed. This leaves

Re: [PATCH v3 04/12] gpiolib: remove gpio_set_debounce

2023-02-07 Thread Andy Shevchenko
On Tue, Feb 07, 2023 at 01:32:01PM -0800, Dmitry Torokhov wrote: > On Tue, Feb 07, 2023 at 04:29:44PM +0200, Andy Shevchenko wrote: > > @@ -1010,14 +1009,21 @@ static int ads7846_setup_pendown(struct spi_device > > *spi, > > } > > > > ts->gpio_pendown =

Re: [PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Andy Shevchenko
On Tue, Feb 07, 2023 at 03:55:23PM +0100, Linus Walleij wrote: > On Tue, Feb 7, 2023 at 3:29 PM Andy Shevchenko > wrote: > > > From: Arnd Bergmann > > > > Almost all gpio drivers include linux/gpio/driver.h, and other > > files should not rely on includes from this header. > > > > Remove the

Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-07 Thread Gavin Shan
On 2/7/23 9:09 PM, Thomas Huth wrote: On 07/02/2023 01.09, Gavin Shan wrote: Hi Thomas, On 2/3/23 8:42 PM, Thomas Huth wrote: This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth ---  

Re: API for setting multiple PTEs at once

2023-02-07 Thread Matthew Wilcox
On Thu, Feb 02, 2023 at 09:14:23PM +, Matthew Wilcox wrote: > For those of you not subscribed, linux-mm is currently discussing > how best to handle page faults on large folios. I simply made it work > when adding large folio support. Now Yin Fengwei is working on > making it fast. OK,

Re: [PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Lee Jones
On Tue, 07 Feb 2023, Andy Shevchenko wrote: > From: Arnd Bergmann > > Almost all gpio drivers include linux/gpio/driver.h, and other > files should not rely on includes from this header. > > Remove the indirect include from here and include the correct > headers directly from where they are

Re: [PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Linus Walleij
On Tue, Feb 7, 2023 at 3:29 PM Andy Shevchenko wrote: > From: Arnd Bergmann > > Almost all gpio drivers include linux/gpio/driver.h, and other > files should not rely on includes from this header. > > Remove the indirect include from here and include the correct > headers directly from where

[PATCH v3 12/12] gpiolib: Clean up headers

2023-02-07 Thread Andy Shevchenko
There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - group generic headers and subsystem headers - sort each group alphabetically Signed-off-by: Andy Shevchenko ---

[PATCH v3 10/12] gpiolib: Deduplicate forward declarations in consumer.h

2023-02-07 Thread Andy Shevchenko
The struct fwnode_handle pointer is used in both branches of ifdeffery, no need to have a copy of the same in each of them, just make it global. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git

[PATCH v3 11/12] gpiolib: Group forward declarations in consumer.h

2023-02-07 Thread Andy Shevchenko
For better maintenance group the forward declarations together. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index a7eb8aa1e54c..5432e5d5fbfb

[PATCH v3 09/12] gpiolib: Drop unused forward declaration from driver.h

2023-02-07 Thread Andy Shevchenko
There is no struct device_node pointers anywhere in the header, drop unused forward declaration. Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index

[PATCH v3 08/12] gpio: aggregator: Add missing header(s)

2023-02-07 Thread Andy Shevchenko
Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-aggregator.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH v3 07/12] gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann This is a rarely used feature that has nothing to do with the client-side of_gpio.h. Split it out with a separate header file and Kconfig option so it can be removed on its own timeline aside from removing the of_gpio consumer interfaces. Reviewed-by: Andy Shevchenko

[PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann Almost all gpio drivers include linux/gpio/driver.h, and other files should not rely on includes from this header. Remove the indirect include from here and include the correct headers directly from where they are used. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd

[PATCH v3 05/12] gpiolib: remove legacy gpio_export

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann There are only a handful of users of gpio_export() and related functions. As these are just wrappers around the modern gpiod_export() helper, remove the wrappers and open-code the gpio_to_desc in all callers to shrink the legacy API. Reviewed-by: Andy Shevchenko

[PATCH v3 04/12] gpiolib: remove gpio_set_debounce

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann gpio_set_debounce() only has a single user, which is trivially converted to gpiod_set_debounce(). Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko --- Documentation/driver-api/gpio/legacy.rst | 2

[PATCH v3 03/12] gpiolib: remove asm-generic/gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann The asm-generic/gpio.h file is now always included when using gpiolib, so just move its contents into linux/gpio.h with a few minor simplifications. Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko ---

[PATCH v3 01/12] gpiolib: remove empty asm/gpio.h files

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann The arm and sh versions of this file are identical to the generic versions and can just be removed. The drivers that actually use the sh3 specific version also include cpu/gpio.h directly, with the exception of magicpanelr2, which is easily fixed. This leaves coldfire as the

[PATCH v3 00/12] gpiolib cleanups

2023-02-07 Thread Andy Shevchenko
These are some older patches Arnd did last year, rebased to linux-next-20230207. On top there are Andy's patches regarding similar topic. The main goal is to remove some of the legacy bits of the gpiolib interfaces, where the corner cases are easily avoided or replaced with gpio descriptor based

[PATCH v3 02/12] gpiolib: coldfire: remove custom asm/gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann Now that coldfire is the only user of a custom asm/gpio.h, it seems better to remove this as well, and have the same interface everywhere. For the gpio_get_value()/gpio_set_value()/gpio_to_irq(), gpio_cansleep() functions, the custom version is only a micro-optimization to

[PATCH 3/3] ALSA: core: Make snd_card_free() return void

2023-02-07 Thread Uwe Kleine-König
The function returns 0 unconditionally. Make it return void instead and simplify all callers accordingly. Signed-off-by: Uwe Kleine-König --- include/sound/core.h | 2 +- sound/core/init.c | 6 ++ sound/pci/hda/hda_tegra.c | 6 ++ sound/ppc/snd_ps3.c | 4 +--- 4 files

[PATCH 0/3] ALSA: core: Make some functions return void

2023-02-07 Thread Uwe Kleine-König
Hello, while checking in which cases hda_tegra_remove() can return a non-zero value, I found that actually cannot happen. This series makes the involved functions return void to make this obvious. This is a preparation for making platform_driver::remove return void, too. Best regards Uwe Uwe

Re: [PATCH v3 1/7] kernel/fork: convert vma assignment to a memcpy

2023-02-07 Thread Marco Elver
On Tue, 7 Feb 2023 at 18:24, Suren Baghdasaryan wrote: > > On Tue, Feb 7, 2023 at 9:16 AM Marco Elver wrote: > > > > On Thu, Jan 26, 2023 at 09:27AM -0800, Paul E. McKenney wrote: > > > On Wed, Jan 25, 2023 at 05:34:49PM -0800, Andrew Morton wrote: > > > > On Wed, 25 Jan 2023 16:50:01 -0800

[PATCH v1.1 22/22] sched/idle: Mark arch_cpu_idle_dead() __noreturn

2023-02-07 Thread Josh Poimboeuf
Before commit 076cbf5d2163 ("x86/xen: don't let xen_pv_play_dead() return"), in Xen, when a previously offlined CPU was brought back online, it unexpectedly resumed execution where it left off in the middle of the idle loop. There were some hacks to make that work, but the behavior was surprising

Re: [PATCH v3 1/7] kernel/fork: convert vma assignment to a memcpy

2023-02-07 Thread Suren Baghdasaryan
On Tue, Feb 7, 2023 at 9:16 AM Marco Elver wrote: > > On Thu, Jan 26, 2023 at 09:27AM -0800, Paul E. McKenney wrote: > > On Wed, Jan 25, 2023 at 05:34:49PM -0800, Andrew Morton wrote: > > > On Wed, 25 Jan 2023 16:50:01 -0800 Suren Baghdasaryan > > > wrote: > > > > > > > On Wed, Jan 25, 2023 at

Re: [PATCH v3 1/7] kernel/fork: convert vma assignment to a memcpy

2023-02-07 Thread Marco Elver
On Thu, Jan 26, 2023 at 09:27AM -0800, Paul E. McKenney wrote: > On Wed, Jan 25, 2023 at 05:34:49PM -0800, Andrew Morton wrote: > > On Wed, 25 Jan 2023 16:50:01 -0800 Suren Baghdasaryan > > wrote: > > > > > On Wed, Jan 25, 2023 at 4:22 PM Andrew Morton > > > wrote: > > > > > > > > On Wed, 25

Re: [PATCH 2/7] KVM: x86: Improve return type handling in kvm_vm_ioctl_get_nr_mmu_pages()

2023-02-07 Thread Sean Christopherson
On Tue, Feb 07, 2023, Thomas Huth wrote: > On 03/02/2023 18.48, Sean Christopherson wrote: > > On Fri, Feb 03, 2023, Thomas Huth wrote: > > > kvm_vm_ioctl_get_nr_mmu_pages() tries to return a "unsigned long" value, > > > but its caller only stores ther return value in an "int" - which is also > >

RE: [External] : RE: [EXT] [PATCH v2 1/1] PCI: layerscape: Add EP mode support for ls1028a

2023-02-07 Thread Frank Li
> Subject: Re: [External] : RE: [EXT] [PATCH v2 1/1] PCI: layerscape: Add EP > mode support for ls1028a > > Caution: EXT Email > > { .compatible = "fsl,ls1046a-pcie-ep", .data = _ep_drvdata }, > + { .compatible = "fsl,ls1028a-pcie-ep", .data = _ep_drvdata }, > {

Re: [PATCH 5/7] KVM: s390: Use "int" as return type for kvm_s390_get/set_skeys()

2023-02-07 Thread Claudio Imbrenda
On Fri, 3 Feb 2023 10:42:28 +0100 Thomas Huth wrote: > These two functions only return normal integers, so it does not > make sense to declare the return type as "long" here. > > Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda > --- > arch/s390/kvm/kvm-s390.c | 4 ++-- > 1 file

Re: [PATCH] powerpc: Fix device node refcounting

2023-02-07 Thread Nathan Lynch
(cc'ing a few possibly interested people) Brian King writes: > While testing fixes to the hvcs hotplug code, kmemleak was reporting > potential memory leaks. This was tracked down to the struct device_node > object associated with the hvcs device. Looking at the leaked > object in crash showed

Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

2023-02-07 Thread Mark Brown
On Tue, 07 Feb 2023 17:04:24 +0800, Shengjiu Wang wrote: > The version information is at the bit31 ~ bit16 in the VERID > register, so need to right shift 16bit to get it, otherwise > the result of comparison "sai->verid.version >= 0x0301" is > wrong. > > Applied to

Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

2023-02-07 Thread Iuliana Prodan
On 2/7/2023 11:04 AM, Shengjiu Wang wrote: The version information is at the bit31 ~ bit16 in the VERID register, so need to right shift 16bit to get it, otherwise the result of comparison "sai->verid.version >= 0x0301" is wrong. Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead

Re: [PATCH] ASoC: fsl_sai: fix getting version from VERID

2023-02-07 Thread Fabio Estevam
On Tue, Feb 7, 2023 at 6:30 AM Shengjiu Wang wrote: > > The version information is at the bit31 ~ bit16 in the VERID > register, so need to right shift 16bit to get it, otherwise > the result of comparison "sai->verid.version >= 0x0301" is > wrong. > > Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store

Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-07 Thread Thomas Huth
On 07/02/2023 01.09, Gavin Shan wrote: Hi Thomas, On 2/3/23 8:42 PM, Thomas Huth wrote: This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth ---   arch/arm64/include/asm/kvm_host.h | 4 ++--  

[PATCH] ASoC: fsl_sai: fix getting version from VERID

2023-02-07 Thread Shengjiu Wang
The version information is at the bit31 ~ bit16 in the VERID register, so need to right shift 16bit to get it, otherwise the result of comparison "sai->verid.version >= 0x0301" is wrong. Fixes: 99c1e74f25d4 ("ASoC: fsl_sai: store full version instead of major/minor") Signed-off-by: Shengjiu Wang

Re: [PATCH 2/7] KVM: x86: Improve return type handling in kvm_vm_ioctl_get_nr_mmu_pages()

2023-02-07 Thread Thomas Huth
On 03/02/2023 18.48, Sean Christopherson wrote: On Fri, Feb 03, 2023, Thomas Huth wrote: kvm_vm_ioctl_get_nr_mmu_pages() tries to return a "unsigned long" value, but its caller only stores ther return value in an "int" - which is also what all the other kvm_vm_ioctl_*() functions are returning.