Re: [PATCH] livepatch: Add using attribute to klp_func for using func show

2024-07-19 Thread zhang warden
> is this always correct though? See the logic in klp_ftrace_handler(). If > there is a transition running, it is a little bit more complicated. > > Miroslav Hi! Miroslav. In reality, we often encounter such situation that serval patch in one system, some patch make changes to one same funct

Re: tracing: user events UAF crash report

2024-07-19 Thread Dan Carpenter
On Fri, Jul 19, 2024 at 10:47:01PM +0200, Mathias Krause wrote: > Hi Steven, Ajay, > > [ @Cc list: I found out issues with tracefs have been reported / > attempted to get fixed in the past, so you may be interested. ] > > I noticed, the user events ftrace selftest is crashing every now and > th

tracing: user events UAF crash report

2024-07-19 Thread Mathias Krause
Hi Steven, Ajay, [ @Cc list: I found out issues with tracefs have been reported / attempted to get fixed in the past, so you may be interested. ] I noticed, the user events ftrace selftest is crashing every now and then in our automated tests. Digging into, I found that the following is trigger

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-07-19 Thread pr-tracker-bot
The pull request you sent on Wed, 17 Jul 2024 05:30:34 -0400: > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/f4f92db4391285ef3a688cdad25d5c76db200a30 Thank you! -- Deet-doot-dot, I am a b

Re: [PATCH v2 00/11] perf/uprobe: Optimize uprobes

2024-07-19 Thread Andrii Nakryiko
On Mon, Jul 15, 2024 at 11:10 AM Andrii Nakryiko wrote: > > On Mon, Jul 15, 2024 at 10:10 AM Andrii Nakryiko > wrote: > > > > On Mon, Jul 15, 2024 at 7:45 AM Peter Zijlstra wrote: > > > > > > On Thu, Jul 11, 2024 at 09:57:44PM -0700, Andrii Nakryiko wrote: > > > > > > > But then I also ran it on

Re: [PATCH 17/17] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:46 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > The x86 implementation of range-to-target_node lookup (i.e. > phys_to_target_node() and memory_add_physaddr_to_nid()) relies on > numa_memblks. > > Since numa_memblks are now part of the generic cod

Re: [PATCH 12/17] mm: introduce numa_memblks

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:41 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig > options to let x86 select it in its Kconfig. > > This code will be later reused by arch_numa. > > No functional changes. >

Re: [PATCH 16/17] arch_numa: switch over to numa_memblks

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:45 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Until now arch_numa was directly translating firmware NUMA information > to memblock. > > Using numa_memblks as an intermediate step has a few advantages: > * alignment with more battle tested x86 i

Re: [PATCH 15/17] mm: make numa_memblks more self-contained

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:44 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Introduce numa_memblks_init() and move some code around to avoid several > global variables in numa_memblks. Hi Mike, Adding the effectively always on memblock_force_top_down deserves a comment on

Re: [PATCH 13/17] mm: move numa_distance and related code from x86 to numa_memblks

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:42 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Move code dealing with numa_distance array from arch/x86 to > mm/numa_memblks.c It's not really numa memblock related. Is this the best place to put it? > > This code will be later reused by arch_

Re: [PATCH 11/17] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:40 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > CPU id cannot be negative. > > Making it unsigned also aligns with declarations in > include/asm-generic/numa.h used by arm64 and riscv and allows sharing > numa emulation code with these architectu

Re: [PATCH 10/17] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:39 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > This is required to make numa emulation code architecture independent s > that it can be moved to generic code in following commits. > > Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonath

Re: [PATCH 09/17] x86/numa_emu: split __apicid_to_node update to a helper function

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:38 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > This is required to make numa emulation code architecture independent so > that it can be moved to generic code in following commits. > > Signed-off-by: Mike Rapoport (Microsoft) Not the most intu

Re: [PATCH 08/17] x86/numa_emu: simplify allocation of phys_dist

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:37 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > By the time numa_emulation() is called, all physical memory is already > mapped in the direct map and there is no need to define limits for > memblock allocation. > > Replace memblock_phys_alloc_ran

Re: [PATCH 07/17] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:36 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are > only used by numa emulation code, make them local to > arch/x86/mm/numa_emulation.c > > Signed-off-by: Mike Rapoport (Microsof

Re: [PATCH 06/17] x86/numa: simplify numa_distance allocation

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:35 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Allocation of numa_distance uses memblock_phys_alloc_range() to limit > allocation to be below the last mapped page. > > But NUMA initializaition runs after the direct map is populated and initiali

[GIT PULL] NVDIMM and DAX for 6.11

2024-07-19 Thread Ira Weiny
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.11 ... to get the 6.11 updates for the libnvdimm tree. The bulk of the changes are to clean up W=1 warnings with one small update with the use of sizeof(). These have been linux-n

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:34 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Architectures that support NUMA duplicate the code that allocates > NODE_DATA on the node-local memory with slight variations in reporting > of the addresses where the memory was allocated. > > Use

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread David Hildenbrand
On 19.07.24 17:51, Jonathan Cameron wrote: On Fri, 19 Jul 2024 17:07:35 +0200 David Hildenbrand wrote: -* Allocate node data. Try node-local memory and then any node. -* Never allocate in DMA zone. -*/ - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTE

Re: [PATCH 14/17] mm: introduce numa_emulation

2024-07-19 Thread Zi Yan
On 16 Jul 2024, at 7:13, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c > > This code will be later reused by arch_numa. > > No functional changes. > > Signed-off-by: Mike Rapoport (Microsoft) > --- > arch/x86/Kconfig

Re: [PATCH] virt: acrn: Remove unusted list 'acrn_irqfd_clients'

2024-07-19 Thread Dr. David Alan Gilbert
* Li, Fei1 (fei1...@intel.com) wrote: > > -Original Message- > > From: Dr. David Alan Gilbert > > Sent: Friday, July 19, 2024 1:44 AM > > To: Li, Fei1 > > Cc: linux-kernel@vger.kernel.org; virtualizat...@lists.linux.dev > > Subject: Re: [PATCH] virt: acrn: Remove unusted list 'acrn_irqfd_

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread Jonathan Cameron
On Fri, 19 Jul 2024 17:07:35 +0200 David Hildenbrand wrote: > >>> - * Allocate node data. Try node-local memory and then any node. > >>> - * Never allocate in DMA zone. > >>> - */ > >>> - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); > >>> - if (!nd_pa) { > >>> -

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread David Hildenbrand
On 19.07.24 17:34, Mike Rapoport wrote: On Fri, Jul 19, 2024 at 05:07:35PM +0200, David Hildenbrand wrote: -* Allocate node data. Try node-local memory and then any node. -* Never allocate in DMA zone. -*/ - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BY

Re: [PATCH 04/17] arch, mm: move definition of node_data to generic code

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:33 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Every architecture that supports NUMA defines node_data in the same way: > > struct pglist_data *node_data[MAX_NUMNODES]; > > No reason to keep multiple copies of this definition and its forw

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread Mike Rapoport
On Fri, Jul 19, 2024 at 05:07:35PM +0200, David Hildenbrand wrote: > > > > -* Allocate node data. Try node-local memory and then any node. > > > > -* Never allocate in DMA zone. > > > > -*/ > > > > - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, > > >

Re: [PATCH 03/17] MIPS: loongson64: rename __node_data to node_data

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:32 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Make definition of node_data match other architectures. > This will allow pulling declaration of node_data to the generic mm code in > the following commit. > > Signed-off-by: Mike Rapoport (Microso

Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-19 Thread David Hildenbrand
-* Allocate node data. Try node-local memory and then any node. -* Never allocate in DMA zone. -*/ - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); - if (!nd_pa) { - pr_err("Cannot find %zu bytes in any node (initial node: %d)

Re: [PATCH 02/17] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-07-19 Thread Jonathan Cameron
On Wed, 17 Jul 2024 16:32:59 +0200 David Hildenbrand wrote: > On 16.07.24 13:13, Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > sgi-ip27 is the only system that defines NODE_DATA() differently than > > the rest of NUMA machines. > > > > Add node_data array of struct pglist

[PATCH] tracing: Fix ifdef of snapshots to not prevent last_boot_info file

2024-07-19 Thread Steven Rostedt
From: Steven Rostedt The mapping of the ring buffer to memory allocated at boot up will also expose a "last_boot_info" to help tooling to read the raw data from the last boot. As instances that have their ring buffer mapped to fixed memory cannot perform snapshots, they can either have the "snaps

Re: [PATCH] tracing/ring-buffer: hide unused last_boot_fops

2024-07-19 Thread Steven Rostedt
On Fri, 19 Jul 2024 12:26:33 +0200 Arnd Bergmann wrote: > From: Arnd Bergmann > > This variable is used only in an #ifdef, which causes a W=1 warning > with some compilers: > > kernel/trace/trace.c:7570:37: error: 'last_boot_fops' defined but not used > [-Werror=unused-const-variable=] > 757

Re: [PATCH 01/17] mm: move kernel/numa.c to mm/

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:30 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > The stub functions in kernel/numa.c belong to mm/ rather than to kernel/ > > Signed-off-by: Mike Rapoport (Microsoft) Makes sense + all arch specific implementations are in arch/*/mm not arch/*/ke

Re: [PATCH 00/17] mm: introduce numa_memblks

2024-07-19 Thread Jonathan Cameron
On Tue, 16 Jul 2024 14:13:29 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Hi, > > Following the discussion about handling of CXL fixed memory windows on > arm64 [1] I decided to bite the bullet and move numa_memblks from x86 to > the generic code so they will be available

[PATCH (repost)] sched/core: defer printk() while rq lock is held

2024-07-19 Thread Tetsuo Handa
syzbot is reporting circular locking dependency inside __bpf_prog_run() when trace_sched_switch() hook is called from __schedule(), for fault injection calls printk() despite rq lock is already held. Since any debugging functionality such as lockdep, fault injection, KASAN/KCSAN/KMSAN etc. might c

Re: [PATCH] livepatch: Add using attribute to klp_func for using func show

2024-07-19 Thread Miroslav Benes
Hi, On Thu, 18 Jul 2024, zhangyongde.zyd wrote: > From: Wardenjohn > > One system may contains more than one livepatch module. We can see > which patch is enabled. If some patches applied to one system > modifing the same function, livepatch will use the function enabled > on top of the functio

[PATCH] tracing/ring-buffer: hide unused last_boot_fops

2024-07-19 Thread Arnd Bergmann
From: Arnd Bergmann This variable is used only in an #ifdef, which causes a W=1 warning with some compilers: kernel/trace/trace.c:7570:37: error: 'last_boot_fops' defined but not used [-Werror=unused-const-variable=] 7570 | static const struct file_operations last_boot_fops = { Guard this one

[RFC v11 05/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-07-19 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/core/skbuff.c

[RFC v11 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-07-19 Thread Yunsheng Lin
Currently the page_frag API is returning 'virtual address' or 'va' when allocing and expecting 'virtual address' or 'va' as input when freeing. As we are about to support new use cases that the caller need to deal with 'struct page' or need to deal with both 'va' and 'struct page'. In order to dif

[PATCH v2 1/2] remoteproc: imx_rproc: allow tx_block to be set

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan Current tx_block is set to true, but there is case that no need to wait response. Linux just needs to send data to remote processor, so let's allow tx_block could be set to false. No functional changes. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 12 ++--

Re: [PATCH v2 0/2] remoteproc: imx_rproc: support non-blocking tx for i.MX7ULP

2024-07-19 Thread Daniel Baluta
for completion. > > patch 1 is to support non-blocking tx mailbox channel > patch 2 is to switch to non-blocking tx for system poweroff or restart. > > Based on patchset: > https://lore.kernel.org/all/20240719-imx_rproc-v2-0-10d0268c7...@nxp.com/ > > Signed-off-by: Peng Fan Series looks good to me. Reviewed-by: Daniel Baluta

[PATCH v2 3/4] remoteproc: imx_rproc: initialize workqueue earlier

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan Initialize workqueue before requesting mailbox channel, otherwise if mailbox interrupt comes before workqueue ready, the imx_rproc_rx_callback will trigger issue. Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") Signed-off-by: Peng Fan --- drivers/remoteproc/i

[PATCH v2 1/4] remoteproc: imx_rproc: correct ddr alias for i.MX8M

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan The DDR Alias address should be 0x4000 according to RM, so correct it. Fixes: 4ab8f9607aad ("remoteproc: imx_rproc: support i.MX8MQ/M") Reported-by: Terry Lv Reviewed-by: Iuliana Prodan Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 in

Re: [PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc

2024-07-19 Thread Daniel Baluta
On Fri, Jul 19, 2024 at 11:27 AM Peng Fan (OSS) wrote: > > This patchset is to upstream a few patches that in NXP downstream for > quite sometime. For patches directly cherry-picked from NXP downstream, > I keep the R-b tags. > > Patch 1 is a minor fix to DDR alias. > Patch 2 was sent out before,

[PATCH v2 4/4] remoteproc: imx_rproc: merge TCML/U

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan Merge contiguous TCML/U regions into one to avoid load elf files which has large sections failure. Reviewed-by: Iuliana Prodan Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/driv

Re: [PATCH 2/6] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table

2024-07-19 Thread Iuliana Prodan
On 7/12/2024 11:34 AM, Peng Fan (OSS) wrote: From: Peng Fan If there is a resource table device tree node, use the address as the resource table address, otherwise use the address(where .resource_table section loaded) inside the Cortex-M elf file. And there is an update in NXP SDK that Resourc

Re: [PATCH 13/17] mm: move numa_distance and related code from x86 to numa_memblks

2024-07-19 Thread Mike Rapoport
On Thu, Jul 18, 2024 at 04:46:17PM -0500, Samuel Holland wrote: > On 2024-07-16 6:13 AM, Mike Rapoport wrote: > > From: "Mike Rapoport (Microsoft)" > > > > Move code dealing with numa_distance array from arch/x86 to > > mm/numa_memblks.c > > > > This code will be later reused by arch_numa. > >

RE: [PATCH 3/6] remoteproc: imx_rproc: initialize workqueue earlier

2024-07-19 Thread Peng Fan
> Subject: Re: [PATCH 3/6] remoteproc: imx_rproc: initialize workqueue > earlier > > On Fri, Jul 12, 2024 at 04:34:56PM +0800, Peng Fan (OSS) wrote: > > From: Peng Fan > > > > Initialize workqueue before requesting mailbox channel, otherwise if > > mailbox interrupt comes before workqueue ready,

RE: [PATCH 1/6] remoteproc: imx_rproc: correct ddr alias for i.MX8M

2024-07-19 Thread Peng Fan
> Subject: Re: [PATCH 1/6] remoteproc: imx_rproc: correct ddr alias for > i.MX8M > > Good morning, > > On Fri, Jul 12, 2024 at 04:34:54PM +0800, Peng Fan (OSS) wrote: > > From: Peng Fan > > > > The DDR Alias address should be 0x4000 according to RM, so > correct > > it. > > > > Fixes: 4ab8f9

[PATCH v2 2/2] remoteproc: imx_rproc: handle system off for i.MX7ULP

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan The i.MX7ULP Cortex-A7 is under control of Cortex-M4. The i.MX7ULP Linux poweroff and restart rely on rpmsg driver to send a message to Cortex-M4 firmware. Then Cortex-A7 could poweroff or restart by Cortex-M4 to configure the i.MX7ULP power controller properly. However the reboot

[PATCH v2 0/2] remoteproc: imx_rproc: support non-blocking tx for i.MX7ULP

2024-07-19 Thread Peng Fan (OSS)
tx for system poweroff or restart. Based on patchset: https://lore.kernel.org/all/20240719-imx_rproc-v2-0-10d0268c7...@nxp.com/ Signed-off-by: Peng Fan --- Changes in v2: - Separated patch 5,6 from v1 - Update commit patch 1 with adding "No functional changes" - Link to

[PATCH v2 2/4] remoteproc: imx_rproc: use imx specific hook for find_loaded_rsc_table

2024-07-19 Thread Peng Fan (OSS)
From: Peng Fan If there is a resource table device tree node, use the address as the resource table address, otherwise use the address(where .resource_table section loaded) inside the Cortex-M elf file. And there is an update in NXP SDK that Resource Domain Control(RDC) enabled to protect TCM, l

[PATCH v2 0/4] remoteproc: imx_rproc: various patches for misc

2024-07-19 Thread Peng Fan (OSS)
This patchset is to upstream a few patches that in NXP downstream for quite sometime. For patches directly cherry-picked from NXP downstream, I keep the R-b tags. Patch 1 is a minor fix to DDR alias. Patch 2 was sent out before, https://patchwork.kernel.org/project/linux-remoteproc/patch/202201110