Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler

2023-12-13 Thread Vincent Guittot
On Thu, 14 Dec 2023 at 06:43, Viresh Kumar wrote: > > On 12-12-23, 15:27, Vincent Guittot wrote: > > @@ -2618,6 +2663,9 @@ static int cpufreq_set_policy(struct cpufreq_policy > > *policy, > > policy->max = __resolve_freq(policy, policy->max, CPUFREQ_RELATION_H); > >

[PATCH v5 3/4] mm/memory_hotplug: export mhp_supports_memmap_on_memory()

2023-12-13 Thread Vishal Verma
In preparation for adding sysfs ABI to toggle memmap_on_memory semantics for drivers adding memory, export the mhp_supports_memmap_on_memory() helper. This allows drivers to check if memmap_on_memory support is available before trying to request it, and display an appropriate message if it isn't

[PATCH v5 4/4] dax: add a sysfs knob to control memmap_on_memory behavior

2023-12-13 Thread Vishal Verma
Add a sysfs knob for dax devices to control the memmap_on_memory setting if the dax device were to be hotplugged as system memory. The default memmap_on_memory setting for dax devices originating via pmem or hmem is set to 'false' - i.e. no memmap_on_memory semantics, to preserve legacy behavior.

[PATCH v5 2/4] dax/bus: Use guard(device) in sysfs attribute helpers

2023-12-13 Thread Vishal Verma
Use the guard(device) macro to lock a 'struct device', and unlock it automatically when going out of scope using Scope Based Resource Management semantics. A lot of the sysfs attribute writes in drivers/dax/bus.c benefit from a cleanup using these, so change these where applicable. Cc: Joao

[PATCH v5 1/4] Documentatiion/ABI: Add ABI documentation for sys-bus-dax

2023-12-13 Thread Vishal Verma
Add the missing sysfs ABI documentation for the device DAX subsystem. Various ABI attributes under this have been present since v5.1, and more have been added over time. In preparation for adding a new attribute, add this file with the historical details. Cc: Dan Williams Signed-off-by: Vishal

[PATCH v5 0/4] Add DAX ABI for memmap_on_memory

2023-12-13 Thread Vishal Verma
The DAX drivers were missing sysfs ABI documentation entirely. Add this missing documentation for the sysfs ABI for DAX regions and Dax devices in patch 1. Switch to guard(device) semantics for Scope Based Resource Management for device_{lock,unlock} flows in drivers/dax/bus.c in patch 2. Export

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-13 Thread dinghao . liu
> > It's a little strange that we do not check super immediately after > > allocation. > > How about this: > > > > static int discover_arenas(struct btt *btt) > > { > > int ret = 0; > > struct arena_info *arena; > > - struct btt_sb *super; > > size_t remaining =

Re: [PATCH 2/2] ARM: dts: qcom: msm8926-motorola-peregrine: Add initial device tree

2023-12-13 Thread Krzysztof Kozlowski
On 13/12/2023 21:33, André Apitzsch wrote: > This dts adds support for Motorola Moto G 4G released in 2013. > > Add a device tree with initial support for: > > - GPIO keys > - Hall sensor > - SDHCI > - Vibrator > > Signed-off-by: André Apitzsch > --- > arch/arm/boot/dts/qcom/Makefile

Re: [PATCH 1/2] dt-bindings: arm: qcom: Add Motorola Moto G 4G

2023-12-13 Thread Krzysztof Kozlowski
On 13/12/2023 21:33, André Apitzsch wrote: > Document the compatible for the MSM8926-based Motorola Moto G 4G smartphone. > > Signed-off-by: André Apitzsch > --- Acked-by: Krzysztof Kozlowski Best regards, Krzysztof

Re: Re: Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2023-12-13 Thread Michael S. Tsirkin
On Wed, Dec 13, 2023 at 09:55:23AM -0500, Michael S. Tsirkin wrote: > On Wed, Dec 13, 2023 at 01:45:35PM +0100, Tobias Huschle wrote: > > On Wed, Dec 13, 2023 at 07:00:53AM -0500, Michael S. Tsirkin wrote: > > > On Wed, Dec 13, 2023 at 11:37:23AM +0100, Tobias Huschle wrote: > > > > On Tue, Dec

Re: [PATCH] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Linus Torvalds
On Wed, 13 Dec 2023 at 18:45, Steven Rostedt wrote: > > tl;dr; The ring-buffer timestamp requires a 64-bit cmpxchg to keep the > timestamps in sync (only in the slow paths). I was told that 64-bit cmpxchg > can be extremely slow on 32-bit architectures. So I created a rb_time_t > that on 64-bit

Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler

2023-12-13 Thread Viresh Kumar
On 12-12-23, 15:27, Vincent Guittot wrote: > @@ -2618,6 +2663,9 @@ static int cpufreq_set_policy(struct cpufreq_policy > *policy, > policy->max = __resolve_freq(policy, policy->max, CPUFREQ_RELATION_H); > trace_cpu_frequency_limits(policy); > > + cpus = policy->related_cpus; > +

Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler

2023-12-13 Thread Viresh Kumar
On 13-12-23, 16:41, Tim Chen wrote: > Seems like the pressure value computed from the first CPU applies to all CPU. > Will this be valid for non-homogeneous CPUs that could have different > max_freq and max_capacity? The will be part of different cpufreq policies and so it will work fine. --

[PATCH v4] trace/kprobe: Display the actual notrace function when rejecting a probe

2023-12-13 Thread Naveen N Rao
Trying to probe update_sd_lb_stats() using perf results in the below message in the kernel log: trace_kprobe: Could not probe notrace function _text This is because 'perf probe' specifies the kprobe location as an offset from '_text': $ sudo perf probe -D update_sd_lb_stats

Re: [PATCH v3] trace/kprobe: Display the actual notrace function when rejecting a probe

2023-12-13 Thread Naveen N Rao
On Thu, Dec 14, 2023 at 08:02:10AM +0900, Masami Hiramatsu wrote: > On Wed, 13 Dec 2023 20:09:14 +0530 > Naveen N Rao wrote: > > > Trying to probe update_sd_lb_stats() using perf results in the below > > message in the kernel log: > > trace_kprobe: Could not probe notrace function _text > > >

[PATCH v2] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Each event has a 27 bit timestamp delta that is used to hold the delta from the last event. If the time between events is greater than 2^27, then a timestamp is added that holds a 59 bit absolute timestamp. Until a389d86f7fd09 ("ring-buffer: Have nested events

Re: [PATCH] virtio_balloon: stay awake while adjusting balloon

2023-12-13 Thread David Stevens
On Wed, Dec 13, 2023 at 5:44 PM David Hildenbrand wrote: > > On 11.12.23 12:43, David Stevens wrote: > > From: David Stevens > > > > Hi David, > > > Add a wakeup event for when the balloon is inflating or deflating. > > Userspace can enable this wakeup event to prevent the system from > >

Re: [PATCH v6 1/3] scsi: ufs: qcom: dt-bindings: Add SC7280 compatible string

2023-12-13 Thread Martin K. Petersen
Luca, > Document the compatible string for the UFS found on SC7280. Applied to 6.8/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering

BUG: unable to handle kernel paging request in bpf_probe_read_compat_str

2023-12-13 Thread xingwei lee
Hello I found a bug in net/bpf in the lastest upstream linux and comfired in the lastest net tree and lastest net bpf titled BUG: unable to handle kernel paging request in bpf_probe_read_compat_str If you fix this issue, please add the following tag to the commit: Reported-by: xingwei Lee

Re: [PATCH] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Mathieu Desnoyers
On 2023-12-13 21:11, Steven Rostedt wrote: From: "Steven Rostedt (Google)" Each event has a 27 bit timestamp delta that is used to hold the delta from the last event. If the time between events is greater than 2^27, then a timestamp is added that holds a 59 bit absolute timestamp. Until

Re: [PATCH] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Steven Rostedt
On Wed, 13 Dec 2023 21:11:26 -0500 Steven Rostedt wrote: > @@ -3720,6 +3517,7 @@ rb_reserve_next_event(struct trace_buffer *buffer, > struct rb_event_info info; > int nr_loops = 0; > int add_ts_default; > + static int once; > > /* ring buffer does cmpxchg, make sure

Re: [PATCH] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Steven Rostedt
Linus, Looking for some advice on this. tl;dr; The ring-buffer timestamp requires a 64-bit cmpxchg to keep the timestamps in sync (only in the slow paths). I was told that 64-bit cmpxchg can be extremely slow on 32-bit architectures. So I created a rb_time_t that on 64-bit was a normal

Re: [PATCH v2] vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

2023-12-13 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Mon, 11 Dec 2023 19:23:17 +0300 you wrote: > We need to do signed arithmetic if we expect condition > `if (bytes < 0)` to be possible > > Found by Linux Verification Center (linuxtesting.org) with SVACE > > Fixes:

[PATCH] ring-buffer: Remove 32bit timestamp logic

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Each event has a 27 bit timestamp delta that is used to hold the delta from the last event. If the time between events is greater than 2^27, then a timestamp is added that holds a 59 bit absolute timestamp. Until a389d86f7fd09 ("ring-buffer: Have nested events

[PATCH v3] tracing: Fix uaf issue when open the hist or hist_debug file

2023-12-13 Thread Zheng Yejian
KASAN report following issue. The root cause is when opening 'hist' file of an instance and accessing 'trace_event_file' in hist_show(), but 'trace_event_file' has been freed due to the instance being removed. 'hist_debug' file has the same problem. To fix it, call tracing_{open,release}_file_tr()

Re: [PATCH 1/4] cpufreq: Add a cpufreq pressure feedback for the scheduler

2023-12-13 Thread Tim Chen
On Tue, 2023-12-12 at 15:27 +0100, Vincent Guittot wrote: > Provide to the scheduler a feedback about the temporary max available > capacity. Unlike arch_update_thermal_pressure, this doesn't need to be > filtered as the pressure will happen for dozens ms or more. > > Signed-off-by: Vincent

Re: [PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-13 Thread Verma, Vishal L
On Wed, 2023-12-13 at 15:02 -0800, Dan Williams wrote: > At present there are ~200 usages of device_lock() in the kernel. Some of > those usages lead to "goto unlock;" patterns which have proven to be > error prone. Define a "device" guard() definition to allow for those to "Define a definition"

Re: [PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-13 Thread Ira Weiny
Dan Williams wrote: > At present there are ~200 usages of device_lock() in the kernel. Some of > those usages lead to "goto unlock;" patterns which have proven to be > error prone. Define a "device" guard() definition to allow for those to > be cleaned up and prevent new ones from appearing. > >

[PATCH v3 34/34] kmsan: Enable on s390

2023-12-13 Thread Ilya Leoshkevich
Now that everything else is in place, enable KMSAN in Kconfig. Signed-off-by: Ilya Leoshkevich --- arch/s390/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 3bec98d20283..160ad2220c53 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig

[PATCH v3 20/34] s390: Use a larger stack for KMSAN

2023-12-13 Thread Ilya Leoshkevich
Adjust the stack size for the KMSAN-enabled kernel like it was done for the KASAN-enabled one in commit 7fef92ccadd7 ("s390/kasan: double the stack size"). Both tools have similar requirements. Reviewed-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich ---

[PATCH v3 05/34] kmsan: Fix is_bad_asm_addr() on arches with overlapping address spaces

2023-12-13 Thread Ilya Leoshkevich
Comparing pointers with TASK_SIZE does not make sense when kernel and userspace overlap. Skip the comparison when this is the case. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/instrumentation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v3 21/34] s390/boot: Add the KMSAN runtime stub

2023-12-13 Thread Ilya Leoshkevich
It should be possible to have inline functions in the s390 header files, which call kmsan_unpoison_memory(). The problem is that these header files might be included by the decompressor, which does not contain KMSAN runtime, causing linker errors. Not compiling these calls if __SANITIZE_MEMORY__

[PATCH v3 28/34] s390/mm: Define KMSAN metadata for vmalloc and modules

2023-12-13 Thread Ilya Leoshkevich
The pages for the KMSAN metadata associated with most kernel mappings are taken from memblock by the common code. However, vmalloc and module metadata needs to be defined by the architectures. Be a little bit more careful than x86: allocate exactly MODULES_LEN for the module shadow and origins,

[PATCH v3 13/34] kmsan: Use ALIGN_DOWN() in kmsan_get_metadata()

2023-12-13 Thread Ilya Leoshkevich
Improve the readability by replacing the custom aligning logic with ALIGN_DOWN(). Unlike other places where a similar sequence is used, there is no size parameter that needs to be adjusted, so the standard macro fits. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich ---

[PATCH v3 31/34] s390/uaccess: Add KMSAN support to put_user() and get_user()

2023-12-13 Thread Ilya Leoshkevich
put_user() uses inline assembly with precise constraints, so Clang is in principle capable of instrumenting it automatically. Unfortunately, one of the constraints contains a dereferenced user pointer, and Clang does not currently distinguish user and kernel pointers. Therefore KMSAN attempts to

[PATCH v3 33/34] s390: Implement the architecture-specific kmsan functions

2023-12-13 Thread Ilya Leoshkevich
arch_kmsan_get_meta_or_null() finds the lowcore shadow by querying the prefix and calling kmsan_get_metadata() again. kmsan_virt_addr_valid() delegates to virt_addr_valid(). Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/kmsan.h | 43 +++ 1 file

[PATCH v3 27/34] s390/irqflags: Do not instrument arch_local_irq_*() with KMSAN

2023-12-13 Thread Ilya Leoshkevich
KMSAN generates the following false positives on s390x: [6.063666] DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled()) [ ...] [6.577050] Call Trace: [6.619637] [<0690d2de>] check_flags+0x1fe/0x210 [6.665411] ([<0690d2da>] check_flags+0x1fa/0x210) [

[PATCH v3 32/34] s390/unwind: Disable KMSAN checks

2023-12-13 Thread Ilya Leoshkevich
The unwind code can read uninitialized frames. Furthermore, even in the good case, KMSAN does not emit shadow for backchains. Therefore disable it for the unwinding functions. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/unwind_bc.c | 4 1 file

[PATCH v3 12/34] kmsan: Support SLAB_POISON

2023-12-13 Thread Ilya Leoshkevich
Avoid false KMSAN negatives with SLUB_DEBUG by allowing kmsan_slab_free() to poison the freed memory, and by preventing init_object() from unpoisoning new allocations by using __memset(). There are two alternatives to this approach. First, init_object() can be marked with __no_sanitize_memory.

[PATCH v3 30/34] s390/traps: Unpoison the kernel_stack_overflow()'s pt_regs

2023-12-13 Thread Ilya Leoshkevich
This is normally done by the generic entry code, but the kernel_stack_overflow() flow bypasses it. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/traps.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/s390/kernel/traps.c

[PATCH v3 24/34] s390/cpumf: Unpoison STCCTM output buffer

2023-12-13 Thread Ilya Leoshkevich
stcctm() uses the "Q" constraint for dest, therefore KMSAN does not understand that it fills multiple doublewords pointed to by dest, not just one. This results in false positives. Unpoison the whole dest manually with kmsan_unpoison_memory(). Reported-by: Alexander Gordeev Signed-off-by: Ilya

[PATCH v3 10/34] kmsan: Export panic_on_kmsan

2023-12-13 Thread Ilya Leoshkevich
When building the kmsan test as a module, modpost fails with the following error message: ERROR: modpost: "panic_on_kmsan" [mm/kmsan/kmsan_test.ko] undefined! Export panic_on_kmsan in order to improve the KMSAN usability for modules. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya

[PATCH v3 29/34] s390/string: Add KMSAN support

2023-12-13 Thread Ilya Leoshkevich
Add KMSAN support for the s390 implementations of the string functions. Do this similar to how it's already done for KASAN, except that the optimized memset{16,32,64}() functions need to be disabled: it's important for KMSAN to know that they initialized something. The way boot code is built with

[PATCH v3 09/34] kmsan: Expose kmsan_get_metadata()

2023-12-13 Thread Ilya Leoshkevich
Each s390 CPU has lowcore pages associated with it. Each CPU sees its own lowcore at virtual address 0 through a hardware mechanism called prefixing. Additionally, all lowcores are mapped to non-0 virtual addresses stored in the lowcore_ptr[] array. When lowcore is accessed through virtual

[PATCH v3 26/34] s390/ftrace: Unpoison ftrace_regs in kprobe_ftrace_handler()

2023-12-13 Thread Ilya Leoshkevich
s390 uses assembly code to initialize ftrace_regs and call kprobe_ftrace_handler(). Therefore, from the KMSAN's point of view, ftrace_regs is poisoned on kprobe_ftrace_handler() entry. This causes KMSAN warnings when running the ftrace testsuite. Fix by trusting the assembly code and always

[PATCH v3 08/34] kmsan: Remove an x86-specific #include from kmsan.h

2023-12-13 Thread Ilya Leoshkevich
Replace the x86-specific asm/pgtable_64_types.h #include with the linux/pgtable.h one, which all architectures have. While at it, sort the headers alphabetically for the sake of consistency with other KMSAN code. Fixes: f80be4571b19 ("kmsan: add KMSAN runtime core") Suggested-by: Heiko Carstens

[PATCH v3 25/34] s390/diag: Unpoison diag224() output buffer

2023-12-13 Thread Ilya Leoshkevich
Diagnose 224 stores 4k bytes, which cannot be deduced from the inline assembly constraints. This leads to KMSAN false positives. Unpoison the output buffer manually with kmsan_unpoison_memory(). Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/diag.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v3 23/34] s390/cpacf: Unpoison the results of cpacf_trng()

2023-12-13 Thread Ilya Leoshkevich
Prevent KMSAN from complaining about buffers filled by cpacf_trng() being uninitialized. Tested-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/cpacf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v3 02/34] kmsan: Make the tests compatible with kmsan.panic=1

2023-12-13 Thread Ilya Leoshkevich
It's useful to have both tests and kmsan.panic=1 during development, but right now the warnings, that the tests cause, lead to kernel panics. Temporarily set kmsan.panic=0 for the duration of the KMSAN testing. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich ---

[PATCH v3 22/34] s390/checksum: Add a KMSAN check

2023-12-13 Thread Ilya Leoshkevich
Add a KMSAN check to the CKSM inline assembly, similar to how it was done for ASAN in commit e42ac7789df6 ("s390/checksum: always use cksm instruction"). Acked-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/include/asm/checksum.h | 2 ++ 1

[PATCH v3 18/34] kmsan: Accept ranges starting with 0 on s390

2023-12-13 Thread Ilya Leoshkevich
On s390 the virtual address 0 is valid (current CPU's lowcore is mapped there), therefore KMSAN should not complain about it. Disable the respective check on s390. There doesn't seem to be a Kconfig option to describe this situation, so explicitly check for s390. Reviewed-by: Alexander Potapenko

[PATCH v3 19/34] s390: Turn off KMSAN for boot, vdso and purgatory

2023-12-13 Thread Ilya Leoshkevich
All other sanitizers are disabled for these components as well. While at it, add a comment to boot and purgatory. Reviewed-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/boot/Makefile | 2 ++ arch/s390/kernel/vdso32/Makefile | 3

[PATCH v3 17/34] lib/zlib: Unpoison DFLTCC output buffers

2023-12-13 Thread Ilya Leoshkevich
The constraints of the DFLTCC inline assembly are not precise: they do not communicate the size of the output buffers to the compiler, so it cannot automatically instrument it. Add the manual kmsan_unpoison_memory() calls for the output buffers. The logic is the same as in [1]. [1]

[PATCH v3 11/34] kmsan: Allow disabling KMSAN checks for the current task

2023-12-13 Thread Ilya Leoshkevich
Like for KASAN, it's useful to temporarily disable KMSAN checks around, e.g., redzone accesses. Introduce kmsan_disable_current() and kmsan_enable_current(), which are similar to their KASAN counterparts. Make them reentrant in order to handle memory allocations in interrupt context. Repurpose

[PATCH v3 16/34] mm: kfence: Disable KMSAN when checking the canary

2023-12-13 Thread Ilya Leoshkevich
KMSAN warns about check_canary() accessing the canary. The reason is that, even though set_canary() is properly instrumented and sets shadow, slub explicitly poisons the canary's address range afterwards. Unpoisoning the canary is not the right thing to do: only check_canary() is supposed to

[PATCH v3 07/34] kmsan: Remove a useless assignment from kmsan_vmap_pages_range_noflush()

2023-12-13 Thread Ilya Leoshkevich
The value assigned to prot is immediately overwritten on the next line with PAGE_KERNEL. The right hand side of the assignment has no side-effects. Fixes: b073d7f8aee4 ("mm: kmsan: maintain KMSAN metadata for page operations") Suggested-by: Alexander Gordeev Reviewed-by: Alexander Potapenko

[PATCH v3 15/34] mm: slub: Unpoison the memchr_inv() return value

2023-12-13 Thread Ilya Leoshkevich
Even though the KMSAN warnings generated by memchr_inv() are suppressed by metadata_access_enable(), its return value may still be poisoned. The reason is that the last iteration of memchr_inv() returns `*start != value ? start : NULL`, where *start is poisoned. Because of this, somewhat

[PATCH v3 14/34] mm: slub: Let KMSAN access metadata

2023-12-13 Thread Ilya Leoshkevich
Building the kernel with CONFIG_SLUB_DEBUG and CONFIG_KMSAN causes KMSAN to complain about touching redzones in kfree(). Fix by extending the existing KASAN-related metadata_access_enable() and metadata_access_disable() functions to KMSAN. Acked-by: Vlastimil Babka Signed-off-by: Ilya

[PATCH v3 06/34] kmsan: Fix kmsan_copy_to_user() on arches with overlapping address spaces

2023-12-13 Thread Ilya Leoshkevich
Comparing pointers with TASK_SIZE does not make sense when kernel and userspace overlap. Assume that we are handling user memory access in this case. Reported-by: Alexander Gordeev Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/hooks.c | 3 ++- 1 file changed, 2

[PATCH v3 04/34] kmsan: Increase the maximum store size to 4096

2023-12-13 Thread Ilya Leoshkevich
The inline assembly block in s390's chsc() stores that much. Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- mm/kmsan/instrumentation.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/kmsan/instrumentation.c b/mm/kmsan/instrumentation.c index

[PATCH v3 00/34] kmsan: Enable on s390

2023-12-13 Thread Ilya Leoshkevich
v2: https://lore.kernel.org/lkml/20231121220155.1217090-1-...@linux.ibm.com/ v2 -> v3: Drop kmsan_memmove_metadata() and strlcpy() patches; Remove kmsan_get_metadata() stub; Move kmsan_enable_current() and kmsan_disable_current() to include/linux/kmsan.h, explain why

[PATCH v3 01/34] ftrace: Unpoison ftrace_regs in ftrace_ops_list_func()

2023-12-13 Thread Ilya Leoshkevich
Architectures use assembly code to initialize ftrace_regs and call ftrace_ops_list_func(). Therefore, from the KMSAN's point of view, ftrace_regs is poisoned on ftrace_ops_list_func entry(). This causes KMSAN warnings when running the ftrace testsuite. Fix by trusting the architecture-specific

[PATCH v3 03/34] kmsan: Disable KMSAN when DEFERRED_STRUCT_PAGE_INIT is enabled

2023-12-13 Thread Ilya Leoshkevich
KMSAN relies on memblock returning all available pages to it (see kmsan_memblock_free_pages()). It partitions these pages into 3 categories: pages available to the buddy allocator, shadow pages and origin pages. This partitioning is static. If new pages appear after kmsan_init_runtime(), it is

[PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-13 Thread Dan Williams
At present there are ~200 usages of device_lock() in the kernel. Some of those usages lead to "goto unlock;" patterns which have proven to be error prone. Define a "device" guard() definition to allow for those to be cleaned up and prevent new ones from appearing. Link:

Re: [PATCH v3] trace/kprobe: Display the actual notrace function when rejecting a probe

2023-12-13 Thread Google
On Wed, 13 Dec 2023 20:09:14 +0530 Naveen N Rao wrote: > Trying to probe update_sd_lb_stats() using perf results in the below > message in the kernel log: > trace_kprobe: Could not probe notrace function _text > > This is because 'perf probe' specifies the kprobe location as an offset > from

Re: [PATCH] rpmsg: glink: Fix buffer overflow

2023-12-13 Thread Bjorn Andersson
On Wed, Dec 13, 2023 at 03:15:15PM +, Hardevsinh Palaniya wrote: >Hello [1]@Bjorn Andersson, Please use appropriate mail list etiquette, and avoid HTML and top-posting in your responses. > >"strscpy_pad" itself takes care of null-terminated strings. So, there >will be no leak.

[PATCH] ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ring_buffer.c | 6 ++ 1 file changed, 6

[PATCH 0/2] ARM: dts: qcom: msm8926-motorola-peregrine: Add initial device tree

2023-12-13 Thread André Apitzsch
This dts adds support for Motorola Moto G 4G released in 2013. Add a device tree with initial support for: - GPIO keys - Hall sensor - SDHCI - Vibrator Signed-off-by: André Apitzsch --- André Apitzsch (2): dt-bindings: arm: qcom: Add Motorola Moto G 4G ARM: dts: qcom:

Re: [PATCH 0/2] ARM: dts: qcom: msm8926-motorola-peregrine: Add initial device tree

2023-12-13 Thread Konrad Dybcio
On 12/13/23 21:33, André Apitzsch wrote: This dts adds support for Motorola Moto G 4G released in 2013. I have a similar one in my drawer.. not the 4g kind, titan IIRC? Wasn't this one codenamed thea? Konrad

[PATCH 1/2] dt-bindings: arm: qcom: Add Motorola Moto G 4G

2023-12-13 Thread André Apitzsch
Document the compatible for the MSM8926-based Motorola Moto G 4G smartphone. Signed-off-by: André Apitzsch --- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml

Re: [PATCH RFC v2 11/27] arm64: mte: Reserve tag storage memory

2023-12-13 Thread Rob Herring
On Wed, Dec 13, 2023 at 11:44 AM Alexandru Elisei wrote: > > On Wed, Dec 13, 2023 at 11:22:17AM -0600, Rob Herring wrote: > > On Wed, Dec 13, 2023 at 8:51 AM Alexandru Elisei > > wrote: > > > > > > Hi, > > > > > > On Wed, Dec 13, 2023 at 08:06:44AM -0600, Rob Herring wrote: > > > > On Wed, Dec

[PATCH v3 00/15] ring-buffer/tracing: Allow ring buffer to have bigger sub buffers

2023-12-13 Thread Steven Rostedt
[ This is hopefully the last version before I push this to Linux next. It's now going though the final phases of my testing. ] Note, this has been on my todo list since the ring buffer was created back in 2008. Tzvetomir last worked on this in 2021 and I need to finally get it in. His

[PATCH v3 04/15] ring-buffer: Set new size of the ring buffer sub page

2023-12-13 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" There are two approaches when changing the size of the ring buffer sub page: 1. Destroying all pages and allocating new pages with the new size. 2. Allocating new pages, copying the content of the old pages before destroying them. The first approach is

[PATCH v3 14/15] ringbuffer/selftest: Add basic selftest to test changing subbuf order

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Add a self test that will write into the trace buffer with differ trace sub buffer order sizes. Signed-off-by: Steven Rostedt (Google) --- .../ftrace/test.d/00basic/ringbuffer_order.tc | 95 +++ 1 file changed, 95 insertions(+) create mode

[PATCH v3 05/15] ring-buffer: Read and write to ring buffers with custom sub buffer size

2023-12-13 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" As the size of the ring sub buffer page can be changed dynamically, the logic that reads and writes to the buffer should be fixed to take that into account. Some internal ring buffer APIs are changed: ring_buffer_alloc_read_page()

[PATCH v3 15/15] tracing: Update subbuffer with kilobytes not page order

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Using page order for deciding what the size of the ring buffer sub buffers are is exposing a bit too much of the implementation. Although the sub buffers are only allocated in orders of pages, allow the user to specify the minimum size of each sub-buffer via

[PATCH v3 09/15] tracing: Update snapshot order along with main buffer order

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When updating the order of the sub buffers for the main buffer, make sure that if the snapshot buffer exists, that it gets its order updated as well. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 45

[PATCH v3 03/15] ring-buffer: Add interface for configuring trace sub buffer size

2023-12-13 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" The trace ring buffer sub page size can be configured, per trace instance. A new ftrace file "buffer_subbuf_order" is added to get and set the size of the ring buffer sub page for current trace instance. The size must be an order of system page size, that's

[PATCH v3 08/15] ring-buffer: Make sure the spare sub buffer used for reads has same size

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Now that the ring buffer specifies the size of its sub buffers, they all need to be the same size. When doing a read, a swap is done with a spare page. Make sure they are the same size before doing the swap, otherwise the read will fail. Signed-off-by: Steven

[PATCH v3 10/15] tracing: Stop the tracing while changing the ring buffer subbuf size

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Because the main buffer and the snapshot buffer need to be the same for some tracers, otherwise it will fail and disable all tracing, the tracers need to be stopped while updating the sub buffer sizes so that the tracers see the main and snapshot buffers with the

[PATCH v3 12/15] ring-buffer: Just update the subbuffers when changing their allocation order

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The ring_buffer_subbuf_order_set() was creating ring_buffer_per_cpu cpu_buffers with the new subbuffers with the updated order, and if they all successfully were created, then they the ring_buffer's per_cpu buffers would be freed and replaced by them. The problem

[PATCH v3 11/15] ring-buffer: Keep the same size when updating the order

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The function ring_buffer_subbuf_order_set() just updated the sub-buffers to the new size, but this also changes the size of the buffer in doing so. As the size is determined by nr_pages * subbuf_size. If the subbuf_size is increased without decreasing the

[PATCH v3 02/15] ring-buffer: Page size per ring buffer

2023-12-13 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" Currently the size of one sub buffer page is global for all buffers and it is hard coded to one system page. In order to introduce configurable ring buffer sub page size, the internal logic should be refactored to work with sub page size per ring buffer.

[PATCH v3 13/15] ring-buffer: Add documentation on the buffer_subbuf_order file

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Add to the documentation how to use the buffer_subbuf_order file to change the size and how it affects what events can be added to the ring buffer. Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/ftrace.rst | 27 +++ 1

[PATCH v3 07/15] ring-buffer: Do no swap cpu buffers if order is different

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" As all the subbuffer order (subbuffer sizes) must be the same throughout the ring buffer, check the order of the buffers that are doing a CPU buffer swap in ring_buffer_swap_cpu() to make sure they are the same. If the are not the same, then fail to do the swap,

[PATCH v3 06/15] ring-buffer: Clear pages on error in ring_buffer_subbuf_order_set() failure

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" On failure to allocate ring buffer pages, the pointer to the CPU buffer pages is freed, but the pages that were allocated previously were not. Make sure they are freed too. Fixes: TBD ("tracing: Set new size of the ring buffer sub page") Signed-off-by: Steven

[PATCH v3 01/15] ring-buffer: Refactor ring buffer implementation

2023-12-13 Thread Steven Rostedt
From: "Tzvetomir Stoyanov (VMware)" In order to introduce sub-buffer size per ring buffer, some internal refactoring is needed. As ring_buffer_print_page_header() will depend on the trace_buffer structure, it is moved after the structure definition. Link:

[PATCH] remoteproc: qcom: q6v5_mpd: Add custom coredump segments

2023-12-13 Thread Vignesh Viswanathan
IPQ9574 and IPQ5332 can have multiple reserved memory regions that needs to be collected as part of the coredump. Loop through all the regions defined under reserved-memory node in the devicetree for the remoteproc and add each as a custom segment for coredump. Also, update the ELF info for

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Michael S. Tsirkin
On Wed, Dec 13, 2023 at 08:11:57PM +0300, Arseniy Krasnov wrote: > > > On 13.12.2023 18:13, Michael S. Tsirkin wrote: > > On Wed, Dec 13, 2023 at 10:05:44AM -0500, Michael S. Tsirkin wrote: > >> On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: > >>> > >>> > >>> On 13.12.2023

Re: [PATCH RFC v2 11/27] arm64: mte: Reserve tag storage memory

2023-12-13 Thread Alexandru Elisei
On Wed, Dec 13, 2023 at 11:22:17AM -0600, Rob Herring wrote: > On Wed, Dec 13, 2023 at 8:51 AM Alexandru Elisei > wrote: > > > > Hi, > > > > On Wed, Dec 13, 2023 at 08:06:44AM -0600, Rob Herring wrote: > > > On Wed, Dec 13, 2023 at 7:05 AM Alexandru Elisei > > > wrote: > > > > > > > > Hi Rob, >

Re: [PATCH RFC v2 11/27] arm64: mte: Reserve tag storage memory

2023-12-13 Thread Rob Herring
On Wed, Dec 13, 2023 at 8:51 AM Alexandru Elisei wrote: > > Hi, > > On Wed, Dec 13, 2023 at 08:06:44AM -0600, Rob Herring wrote: > > On Wed, Dec 13, 2023 at 7:05 AM Alexandru Elisei > > wrote: > > > > > > Hi Rob, > > > > > > On Tue, Dec 12, 2023 at 12:44:06PM -0600, Rob Herring wrote: > > > > On

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Arseniy Krasnov
On 13.12.2023 18:13, Michael S. Tsirkin wrote: > On Wed, Dec 13, 2023 at 10:05:44AM -0500, Michael S. Tsirkin wrote: >> On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: >>> >>> >>> On 13.12.2023 11:43, Stefano Garzarella wrote: On Tue, Dec 12, 2023 at 08:43:07PM +0300,

Re: [PATCH v4 1/3] Documentatiion/ABI: Add ABI documentation for sys-bus-dax

2023-12-13 Thread Jonathan Cameron
On Tue, 12 Dec 2023 12:08:30 -0700 Vishal Verma wrote: > Add the missing sysfs ABI documentation for the device DAX subsystem. > Various ABI attributes under this have been present since v5.1, and more > have been added over time. In preparation for adding a new attribute, > add this file with

Re: [PATCH v4 2/3] dax/bus: Introduce guard(device) for device_{lock,unlock} flows

2023-12-13 Thread Jonathan Cameron
On Tue, 12 Dec 2023 12:08:31 -0700 Vishal Verma wrote: > Introduce a guard(device) macro to lock a 'struct device', and unlock it > automatically when going out of scope using Scope Based Resource > Management semantics. A lot of the sysfs attribute writes in > drivers/dax/bus.c benefit from a

Re: [PATCH] nvdimm-btt: simplify code with the scope based resource management

2023-12-13 Thread Dave Jiang
On 12/12/23 20:12, dinghao@zju.edu.cn wrote: >> >> On 12/10/23 03:27, Dinghao Liu wrote: >>> Use the scope based resource management (defined in >>> linux/cleanup.h) to automate resource lifetime >>> control on struct btt_sb *super in discover_arenas(). >>> >>> Signed-off-by: Dinghao Liu

[PATCH v2] tracing: Increase size of trace_marker_raw to max ring buffer entry

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" There's no reason to give an arbitrary limit to the size of a raw trace marker. Just let it be as big as the size that is allowed by the ring buffer itself. And there's also no reason to artificially break up the write to TRACE_BUF_SIZE, as that's not even used.

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Michael S. Tsirkin
On Wed, Dec 13, 2023 at 10:05:44AM -0500, Michael S. Tsirkin wrote: > On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: > > > > > > On 13.12.2023 11:43, Stefano Garzarella wrote: > > > On Tue, Dec 12, 2023 at 08:43:07PM +0300, Arseniy Krasnov wrote: > > >> > > >> > > >> On

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Michael S. Tsirkin
On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: > > > On 13.12.2023 11:43, Stefano Garzarella wrote: > > On Tue, Dec 12, 2023 at 08:43:07PM +0300, Arseniy Krasnov wrote: > >> > >> > >> On 12.12.2023 19:12, Michael S. Tsirkin wrote: > >>> On Tue, Dec 12, 2023 at 06:59:03PM +0300,

Re: [PATCH v2 12/33] kmsan: Allow disabling KMSAN checks for the current task

2023-12-13 Thread Ilya Leoshkevich
On Mon, 2023-12-11 at 12:50 +0100, Alexander Potapenko wrote: > On Tue, Nov 21, 2023 at 11:06 PM Ilya Leoshkevich > wrote: > > > > Like for KASAN, it's useful to temporarily disable KMSAN checks > > around, > > e.g., redzone accesses. Introduce kmsan_disable_current() and > >

Re: Re: Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2023-12-13 Thread Michael S. Tsirkin
On Wed, Dec 13, 2023 at 01:45:35PM +0100, Tobias Huschle wrote: > On Wed, Dec 13, 2023 at 07:00:53AM -0500, Michael S. Tsirkin wrote: > > On Wed, Dec 13, 2023 at 11:37:23AM +0100, Tobias Huschle wrote: > > > On Tue, Dec 12, 2023 at 11:15:01AM -0500, Michael S. Tsirkin wrote: > > > > On Tue, Dec

  1   2   >