RE: [PATCH v2] vmscan: add trace events for lru_gen

2023-09-21 Thread 김재원
>On Thu, 21 Sep 2023 09:12:30 -0700 > > >"T.J. Mercier" wrote: >

[syzbot] [wpan?] [input?] [usb?] memory leak in hwsim_add_one (2)

2023-09-21 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:e789286468a9 Merge tag 'x86-urgent-2023-09-17' of git://gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16db487fa8 kernel config: https://syzkaller.appspot.com/x/.config?x=943a94479fa8e863 das

[PATCH] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor

2023-09-21 Thread Matti Lehtimäki
Fix hall sensor GPIO polarity and also allow disabling the sensor. Remove unneeded interrupt. Fixes: f15623bda1dc ("ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 10.1 (SM-T530)") Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom/qcom-apq8026-samsung-matisse-wifi.dts | 4 ++-- 1 f

[PATCH 2/2] ARM: qcom: msm8974: Add rpm-master-stats node

2023-09-21 Thread Matti Lehtimäki
Add rpm-master-stats node for MSM8974 and the required RPM MSG RAM slices for memory access. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 32 1 file changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/

[PATCH 1/2] ARM: qcom: msm8226: Add rpm-master-stats node

2023-09-21 Thread Matti Lehtimäki
Add rpm-master-stats node for MSM8226 and the required RPM MSG RAM slices for memory access. Signed-off-by: Matti Lehtimäki --- arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 32 1 file changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi b/arch/

[PATCH 0/2] Add rpm-master-stats nodes for MSM8226 and MSM8974

2023-09-21 Thread Matti Lehtimäki
Add rpm-master-stats nodes and the required RPM MSG RAM slices for MSM8226 and MSM8974. Matti Lehtimäki (2): ARM: qcom: msm8226: Add rpm-master-stats node ARM: qcom: msm8974: Add rpm-master-stats node arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 32 arch/arm/boot/dts/q

Re: [PATCH v3 06/13] mm/execmem: introduce execmem_data_alloc()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:31 AM Mike Rapoport wrote: > [...] > diff --git a/include/linux/execmem.h b/include/linux/execmem.h > index 519bdfdca595..09d45ac786e9 100644 > --- a/include/linux/execmem.h > +++ b/include/linux/execmem.h > @@ -29,6 +29,7 @@ > * @EXECMEM_KPROBES: parameters for kprobe

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c > index 42215f9404af..db5561d0c233 100644 > --- a/arch/s390/kernel/module.c > +++ b/arch/s390/kernel/module.c > @@ -21,6 +21,7 @@ > #include > #include > #inclu

Re: [PATCH v3 09/13] powerpc: extend execmem_params for kprobes allocations

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:31 AM Mike Rapoport wrote: > [...] > @@ -135,5 +138,13 @@ struct execmem_params __init *execmem_arch_params(void) > > range->pgprot = prot; > > + execmem_params.ranges[EXECMEM_KPROBES].start = VMALLOC_START; > + execmem_params.ranges[EXECMEM_KPROBES].

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > + > +/** > + * enum execmem_type - types of executable memory ranges > + * > + * There are several subsystems that allocate executable memory. > + * Architectures define different restrictions on placement, > + * permissions, alignmen

Re: [PATCH v3 02/13] mm: introduce execmem_text_alloc() and execmem_free()

2023-09-21 Thread Song Liu
On Mon, Sep 18, 2023 at 12:30 AM Mike Rapoport wrote: > [...] > + > +#include > +#include > +#include > +#include > + > +static void *execmem_alloc(size_t size) > +{ > + return module_alloc(size); > +} > + > +void *execmem_text_alloc(enum execmem_type type, size_t size) > +{ > + re

[PATCH v6 00/13] selftests/sgx: Fix compilation errors

2023-09-21 Thread Jo Van Bulck
Hi, This patch series ensures that all SGX selftests succeed when compiling with optimizations (as tested with -O{0,1,2,3,s} for both gcc 11.3.0 and clang 14.0.0). The aim of the patches is to avoid reliance on undefined, compiler-specific behavior that can make the test results fragile. As far a

Re: [PATCH] remoteproc: mediatek: Refactor single core check and fix retrocompatibility

2023-09-21 Thread Mathieu Poirier
On Tue, Sep 19, 2023 at 11:23:36AM +0200, AngeloGioacchino Del Regno wrote: > In older devicetrees we had the ChromeOS EC in a node called "cros-ec" > instead of the newer "cros-ec-rpmsg", but this driver is now checking > only for the latter, breaking compatibility with those. > > Besides, we can

[PATCH v6 12/13] selftests/sgx: Discard unsupported ELF sections

2023-09-21 Thread Jo Van Bulck
Building the test enclave with -static-pie may produce a dynamic symbol table, but this is not supported for enclaves and any relocations need to happen manually (e.g., as for "encl_op_array"). Thus, opportunistically discard ".dyn*" and ".gnu.hash" which the enclave loader cannot handle. Signed-o

[PATCH v6 10/13] selftests/sgx: Ensure test enclave buffer is entirely preserved

2023-09-21 Thread Jo Van Bulck
Attach the "used" attribute to instruct the compiler to preserve the static encl_buffer, even if it appears it is not entirely referenced in the enclave code, as expected by the external tests manipulating page permissions. Link: https://lore.kernel.org/all/a2732938-f3db-a0af-3d68-a18060f66...@cs

[PATCH v6 11/13] selftests/sgx: Ensure expected location of test enclave buffer

2023-09-21 Thread Jo Van Bulck
The external tests manipulating page permissions expect encl_buffer to be placed at the start of the test enclave's .data section. As this is not guaranteed per the C standard, explicitly place encl_buffer in a separate section that is explicitly placed at the start of the .data segment in the link

[PATCH v6 08/13] selftests/sgx: Handle relocations in test enclave

2023-09-21 Thread Jo Van Bulck
Static-pie binaries normally include a startup routine to perform any ELF relocations from .rela.dyn. Since the enclave loading process is different and glibc is not included, do the necessary relocation for encl_op_array entries manually at runtime relative to the enclave base to ensure correct fu

[PATCH v6 05/13] selftests/sgx: Specify freestanding environment for enclave compilation

2023-09-21 Thread Jo Van Bulck
Use -ffreestanding to assert the enclave compilation targets a freestanding environment (i.e., without "main" or standard libraries). This fixes clang reporting "undefined reference to `memset'" after erroneously optimizing away the provided memset/memcpy implementations. Still need to instruct th

[PATCH v6 01/13] selftests/sgx: Fix uninitialized pointer dereference in error path

2023-09-21 Thread Jo Van Bulck
Ensure ctx is zero-initialized, such that the encl_measure function will not call EVP_MD_CTX_destroy with an uninitialized ctx pointer in case of an early error during key generation. Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX") Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sak

[PATCH v6 06/13] selftests/sgx: Remove redundant enclave base address save/restore

2023-09-21 Thread Jo Van Bulck
Remove redundant push/pop pair that stores and restores the enclave base address in the test enclave, as it is never used after the pop and can anyway be easily retrieved via the __encl_base symbol. Signed-off-by: Jo Van Bulck Acked-by: Kai Huang --- tools/testing/selftests/sgx/test_encl_bootst

[PATCH v6 04/13] selftests/sgx: Separate linker options

2023-09-21 Thread Jo Van Bulck
Fixes "'linker' input unused [-Wunused-command-line-argument]" errors when compiling with clang. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/Makefile | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selft

[PATCH v6 13/13] selftests/sgx: Remove incomplete ABI sanitization code in test enclave

2023-09-21 Thread Jo Van Bulck
As the selftest enclave is *not* intended for production, simplify the code by not initializing CPU configuration registers as expected by the ABI on enclave entry or cleansing caller-save registers on enclave exit. Link: https://lore.kernel.org/all/da0cfb1e-e347-f7f2-ac72-aec0ee0d8...@intel.com/

[PATCH v6 03/13] selftests/sgx: Include memory clobber for inline asm in test enclave

2023-09-21 Thread Jo Van Bulck
Add the "memory" clobber to the EMODPE and EACCEPT asm blocks to tell the compiler the assembly code accesses to the secinfo struct. This ensures the compiler treats the asm block as a memory barrier and the write to secinfo will be visible to ENCLU. Fixes: 20404a808593 ("selftests/sgx: Add test f

Re: [PATCH] remoteproc: mediatek: Refactor single core check and fix retrocompatibility

2023-09-21 Thread AngeloGioacchino Del Regno
Il 20/09/23 17:03, Laura Nao ha scritto: On 9/19/23 11:23, AngeloGioacchino Del Regno wrote: In older devicetrees we had the ChromeOS EC in a node called "cros-ec" instead of the newer "cros-ec-rpmsg", but this driver is now checking only for the latter, breaking compatibility with those. Besid

Re: [PATCH v2] vmscan: add trace events for lru_gen

2023-09-21 Thread T.J. Mercier
On Wed, Sep 20, 2023 at 11:19 PM Jaewon Kim wrote: > > As the legacy lru provides, the lru_gen needs some trace events for > debugging. > Hi Jaewon, thanks for adding this. > This commit introduces 2 trace events. > trace_mm_vmscan_lru_gen_scan > trace_mm_vmscan_lru_gen_evict > > Each event i

Re: [RFC PATCH 3/4] net: drop_monitor: use drop_reason_lookup()

2023-09-21 Thread Johannes Berg
On Thu, 2023-09-21 at 10:51 +0200, Johannes Berg wrote: > > - if (!list || > - subsys_reason >= list->n_reasons || > - !list->reasons[subsys_reason] || > - strlen(list->reasons[subsys_reason]) > NET_DM_MAX_REASON_LEN) { > - list = > rcu_dereference(drop_rea

RE: (2) [PATCH] vmscan: add trace events for lru_gen

2023-09-21 Thread 김재원
>> Great. Thank you for your comment. >> >> For the putting the struct scan_control *sc inside the trace, >> I couldn't do that because struct scan_control is defined in mm/vmscan.c. >> I think I should not move it to a seperate header file. > >Well if you ever decide to do so, one thing to do is

[PATCH] ARM: dts: qcom: sdx65-mtp: Specify PM7250B SID to use

2023-09-21 Thread Luca Weiss
-4,6 +4,10 @@ */ /dts-v1/; +/* PM7250B is configured to use SID2/3 */ +#define PM7250B_SID 2 +#define PM7250B_SID1 3 + #include "qcom-sdx65.dtsi" #include #include --- base-commit: 7fc7222d9680366edeecc219c21ca96310bdbc10 change-id: 20230921-pm7250b-sid-fixup-0c35c3c59312 Be

Re: [PATCH] remoteproc: mediatek: Refactor single core check and fix retrocompatibility

2023-09-21 Thread Chen-Yu Tsai
On Wed, Sep 20, 2023 at 11:03 PM Laura Nao wrote: > > On 9/19/23 11:23, AngeloGioacchino Del Regno wrote: > > In older devicetrees we had the ChromeOS EC in a node called "cros-ec" > > instead of the newer "cros-ec-rpmsg", but this driver is now checking > > only for the latter, breaking compatibi

[PATCH v2] vmscan: add trace events for lru_gen

2023-09-21 Thread Jaewon Kim
As the legacy lru provides, the lru_gen needs some trace events for debugging. This commit introduces 2 trace events. trace_mm_vmscan_lru_gen_scan trace_mm_vmscan_lru_gen_evict Each event is similar to the following legacy events. trace_mm_vmscan_lru_isolate, trace_mm_vmscan_lru_shrink_[i

[PATCH v6 09/13] selftests/sgx: Fix linker script asserts

2023-09-21 Thread Jo Van Bulck
DEFINED only considers symbols, not section names. Hence, replace the check for .got.plt with the _GLOBAL_OFFSET_TABLE_ symbol and remove other (non-essential) asserts. Signed-off-by: Jo Van Bulck Reviewed-by: Jarkko Sakkinen --- tools/testing/selftests/sgx/test_encl.lds | 6 +- 1 file chan

[PATCH v6 02/13] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry

2023-09-21 Thread Jo Van Bulck
Ensure sym_tab and sym_names are zero-initialized and add an early-out condition in the unlikely (erroneous) case that the enclave ELF file would not contain a symbol table. This addresses -Werror=maybe-uninitialized compiler warnings for gcc -O2. Fixes: 33c5aac3bf32 ("selftests/sgx: Test complet

[PATCH v6 07/13] selftests/sgx: Produce static-pie executable for test enclave

2023-09-21 Thread Jo Van Bulck
The current combination of -static and -fPIC creates a static executable with position-dependent addresses for global variables. Use -static-pie and -fPIE to create a proper static position independent executable that can be loaded at any address without a dynamic linker. When building the origina

[PATCH] ring-buffer: Fix bytes info in per_cpu buffer stats

2023-09-21 Thread Zheng Yejian
The 'bytes' info in file 'per_cpu/cpu/stats' means the number of bytes in cpu buffer that have not been consumed. However, currently after consuming data by reading file 'trace_pipe', the 'bytes' info was not changed as expected. # cat per_cpu/cpu0/stats entries: 0 overrun: 0 commit overru

Re: [PATCH] kallsyms: Fix kallsyms_selftest failure

2023-09-21 Thread Petr Mladek
Adding live-patching list into Cc. On Fri 2023-08-25 15:19:10, Leizhen (ThunderTown) wrote: > On 2023/8/25 11:46, Yonghong Song wrote: > > Kernel test robot reported a kallsyms_test failure when clang lto is > > enabled (thin or full) and CONFIG_KALLSYMS_SELFTEST is also enabled. > > I can reprodu

Re: [PATCH v4] scripts/link-vmlinux.sh: Add alias to duplicate symbols for kallsyms

2023-09-21 Thread Francis Laniel
Hi. Le mercredi 20 septembre 2023, 21:04:42 EEST Alessandro Carminati a écrit : > Hello Francis, > > Thanks a lot for the review. You are welcome. I also tested it and it works well: root@vm-amd64:~# grep ' name_show' /proc/kallsyms | head -6 810fa070 t name_show 810fa070 t name_

[PATCH 0/4] tracing: improve symbolic printing

2023-09-21 Thread Johannes Berg
So I was frustrated with not seeing the names of SKB dropreasons for all but the core reasons, and then while looking into this all, realized, that the current __print_symbolic() is pretty bad anyway. So I came up with a new approach, using a separate declaration of the symbols, and __print_sym()

[RFC PATCH 1/4] tracing: add __print_sym() to replace __print_symbolic()

2023-09-21 Thread Johannes Berg
From: Johannes Berg The way __print_symbolic() works is limited and inefficient in multiple ways: - you can only use it with a static list of symbols, but e.g. the SKB dropreasons are now a dynamic list - it builds the list in memory _three_ times, so it takes a lot of memory: - The p

[RFC PATCH 3/4] net: drop_monitor: use drop_reason_lookup()

2023-09-21 Thread Johannes Berg
From: Johannes Berg Now that we have drop_reason_lookup(), we can just use it for drop_monitor as well, rather than exporting the list itself. Signed-off-by: Johannes Berg --- include/net/dropreason.h | 4 net/core/drop_monitor.c | 18 +++--- net/core/skbuff.c| 6 ++

[RFC PATCH 4/4] tracing/timer: use __print_sym()

2023-09-21 Thread Johannes Berg
From: Johannes Berg Use the new __print_sym() in the timer tracing, just to show how to convert something. This adds ~80 bytes of .text for a saving of ~1.5K of data in my builds. Note the format changes from print fmt: "success=%d dependency=%s", REC->success, __print_symbolic(REC->dependency

Re: [RFC PATCH 1/4] tracing: add __print_sym() to replace __print_symbolic()

2023-09-21 Thread Johannes Berg
On Thu, 2023-09-21 at 08:51 +, Johannes Berg wrote: > > - Is it correct that we can assume RCU critical section when in >the lookup function? The SKB code currently does, but I may >not ever have actually run this code yet. Well, I could easily answer that myself, and no, it's incorr

[RFC PATCH 2/4] net: dropreason: use new __print_sym() in tracing

2023-09-21 Thread Johannes Berg
From: Johannes Berg The __print_symbolic() could only ever print the core drop reasons, since that's the way the infrastructure works. Now that we have __print_sym() with all the advantages mentioned in that commit, convert to that and get all the drop reasons from all subsystems. As we already h

Re: [PATCH v2] vmscan: add trace events for lru_gen

2023-09-21 Thread Steven Rostedt
On Thu, 21 Sep 2023 09:12:30 -0700 "T.J. Mercier" wrote: > > + TP_fast_assign( > > + __entry->nid = nid; > > + __entry->nr_reclaimed = nr_reclaimed; > > + __entry->nr_dirty = stat->nr_dirty; > > + __entry->nr_writeback = stat->nr_write

Re: [PATCH v3] riscv: Only consider swbp/ss handlers for correct privileged mode

2023-09-21 Thread patchwork-bot+linux-riscv
Hello: This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt : On Tue, 12 Sep 2023 08:56:19 +0200 you wrote: > From: Björn Töpel > > RISC-V software breakpoint trap handlers are used for {k,u}probes. > > When trapping from kernelmode, only the kernelmode handlers should be > cons