Re: [PATCH v2 04/19] gendwarfksyms: Add support for type pointers

2024-08-27 Thread Masahiro Yamada
On Fri, Aug 16, 2024 at 2:39 AM Sami Tolvanen wrote: > > The compiler may choose not to emit type information in DWARF for > external symbols. Clang, for example, does this for symbols not > defined in the current TU. > > To provide a way to work around this issue, add support for > __gendwarfksym

Re: [PATCH] vdpa/mlx5: Fix invalid mr resource destroy

2024-08-27 Thread Si-Wei Liu
On 8/27/2024 9:08 AM, Dragos Tatulea wrote: Certain error paths from mlx5_vdpa_dev_add() can end up releasing mr resources which never got initialized in the first place. This patch adds the missing check in mlx5_vdpa_destroy_mr_resources() to block releasing non-initialized mr resources. Re

Re: [PATCH] vdpa/mlx5: Use random MAC address when no nic vport MAC set

2024-08-27 Thread Si-Wei Liu
On 8/27/2024 9:02 AM, Dragos Tatulea wrote: When the vdpa device is configured without a specific MAC address, the vport MAC address is used. However, this address can be 0 which prevents the driver from properly configuring the MPFS and breaks steering. The solution is to simply generate a r

Re: [PATCH v3] uprobes: turn trace_uprobe's nhit counter to be per-CPU one

2024-08-27 Thread Google
On Tue, 13 Aug 2024 13:34:09 -0700 Andrii Nakryiko wrote: > trace_uprobe->nhit counter is not incremented atomically, so its value > is questionable in when uprobe is hit on multiple CPUs simultaneously. > > Also, doing this shared counter increment across many CPUs causes heavy > cache line bou

Re: [PATCH v3] uprobes: turn trace_uprobe's nhit counter to be per-CPU one

2024-08-27 Thread Google
On Tue, 13 Aug 2024 13:34:09 -0700 Andrii Nakryiko wrote: > trace_uprobe->nhit counter is not incremented atomically, so its value > is questionable in when uprobe is hit on multiple CPUs simultaneously. > > Also, doing this shared counter increment across many CPUs causes heavy > cache line bou

Re: [PATCH v2] rust: add `module_params` macro

2024-08-27 Thread Andreas Hindborg
"Trevor Gross" writes: > On Tue, Aug 27, 2024 at 10:00 AM Andreas Hindborg wrote: >> >> "Trevor Gross" writes: >> >> > On Mon, Aug 19, 2024 at 8:35 AM Andreas Hindborg wrote: >> >> >> >> From: Andreas Hindborg >> >> >> >> This patch includes changes required for Rust kernel modules to utilize

Re: [syzbot] [mm?] possible deadlock in __mmap_lock_do_trace_start_locking

2024-08-27 Thread syzbot
syzbot suspects this issue was fixed by commit: commit 7d6be67cfdd4a53cea7147313ca13c531e3a470f Author: Tetsuo Handa Date: Fri Jun 21 01:08:41 2024 + mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1412f6979

[PATCH 2/2] remoteproc: qcom: pas: Add QCS8300 remoteproc support

2024-08-27 Thread Jingyi Wang
Add support for PIL loading on ADSP, CDSP and GPDSP on QCS8300 platform. Co-developed-by: Xin Liu Signed-off-by: Xin Liu Signed-off-by: Jingyi Wang --- drivers/remoteproc/qcom_q6v5_pas.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/drivers/remoteproc/qcom

[PATCH 1/2] dt-bindings: remoteproc: qcom,sa8775p-pas: Document QCS8300 remoteproc

2024-08-27 Thread Jingyi Wang
Document the components used to boot the ADSP, CDSP and GPDSP on the QCS8300 SoC. Co-developed-by: Xin Liu Signed-off-by: Xin Liu Signed-off-by: Jingyi Wang --- .../bindings/remoteproc/qcom,sa8775p-pas.yaml | 22 +++ 1 file changed, 22 insertions(+) diff --git a/Documentation/

[PATCH 0/2] remoteproc: qcom: Introduce DSP support for QCS8300

2024-08-27 Thread Jingyi Wang
Add the bindings and driver changes for DSP support on the QCS8300 platform in order to enable the ADSP, CDSP and GPDSP remoteproc to boot. Signed-off-by: Jingyi Wang --- Jingyi Wang (2): dt-bindings: remoteproc: qcom,sa8775p-pas: Document QCS8300 remoteproc remoteproc: qcom: pas: Add QCS8300

[PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-08-27 Thread 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 function stack. However, we can not excatly know which function of which patch is now en

[PATCH v4 1/2] Introduce klp_ops into klp_func structure

2024-08-27 Thread Wardenjohn
Before introduce feature "using". Klp transition will need an easier way to get klp_ops from klp_func. This patch make changes as follows: 1. Move klp_ops into klp_func structure. Rewrite the logic of klp_find_ops and other logic to get klp_ops of a function. 2. Move definition of struct klp_ops

[PATCH v4 0/2] livepatch: Add using attribute to klp_func for using function

2024-08-27 Thread Wardenjohn
This patch introduce one sysfs attribute of "using" to klp_func. For example, if there are serval patches make changes to function "meminfo_proc_show", the attribute "enabled" of all the patch is 1. With this attribute, we can easily know the version enabling belongs to which patch. Changes v1 =>

Re: [PATCH] vdpa/mlx5: Fix invalid mr resource destroy

2024-08-27 Thread Jason Wang
On Wed, Aug 28, 2024 at 12:08 AM Dragos Tatulea wrote: > > Certain error paths from mlx5_vdpa_dev_add() can end up releasing mr > resources which never got initialized in the first place. > > This patch adds the missing check in mlx5_vdpa_destroy_mr_resources() > to block releasing non-initialized

Re: [RFC] Why is set_config not supported in mlx5_vnet?

2024-08-27 Thread Jason Wang
On Wed, Aug 28, 2024 at 12:55 AM Dragos Tatulea wrote: > > > > On 27.08.24 04:03, Jason Wang wrote: > > On Tue, Aug 27, 2024 at 12:11 AM Dragos Tatulea wrote: > >> > >> > >> On 26.08.24 16:24, Andrew Lunn wrote: > >>> On Mon, Aug 26, 2024 at 11:06:09AM +0200, Dragos Tatulea wrote: > > >

Re: [PATCH] vdpa/mlx5: Use random MAC address when no nic vport MAC set

2024-08-27 Thread Jason Wang
On Wed, Aug 28, 2024 at 12:03 AM Dragos Tatulea wrote: > > When the vdpa device is configured without a specific MAC > address, the vport MAC address is used. However, this > address can be 0 which prevents the driver from properly > configuring the MPFS and breaks steering. > > The solution is to

Re: [PATCH v16 05/16] x86/sgx: Implement basic EPC misc cgroup functionality

2024-08-27 Thread Huang, Kai
On 28/08/2024 11:11 am, Huang, Kai wrote: +static void sgx_cgroup_misc_init(struct misc_cg *cg, struct sgx_cgroup *sgx_cg) +{ +    cg->res[MISC_CG_RES_SGX_EPC].priv = sgx_cg; +    sgx_cg->cg = cg; +} + [...] +int __init sgx_cgroup_init(void) +{ +    sgx_cgroup_misc_init(misc_cg_root(), &s

Re: [PATCH v16 08/16] x86/sgx: Encapsulate uses of the global LRU

2024-08-27 Thread Huang, Kai
On 27/08/2024 11:13 pm, Huang, Kai wrote: +static inline bool sgx_can_reclaim_global(void) +{ + /* +* Now all EPC pages are still tracked in the @sgx_global_lru, so only +* check @sgx_global_lru. +* +* When EPC pages are tracked in the actual per-cgroup

Re: [PATCH v16 13/16] x86/sgx: implement direct reclamation for cgroups

2024-08-27 Thread Huang, Kai
On 21/08/2024 1:54 pm, Haitao Huang wrote: sgx_reclaim_direct() was introduced to preemptively reclaim some pages as the best effort to avoid on-demand reclamation that can stall forward progress in some situations, e.g., allocating pages to load previously reclaimed page to perform EDMM opera

Re: [PATCH v16 10/16] x86/sgx: Implement async reclamation for cgroup

2024-08-27 Thread Huang, Kai
On 27/08/2024 10:22 pm, Huang, Kai wrote: On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote: +/** + * Only called during init to unwind what's done in sgx_cgroup_init() + */ +void __init sgx_cgroup_deinit(void) +{ + destroy_workqueue(sgx_cg_wq); +} + Ditto: arch/x86/kernel/cpu/sg

Re: [PATCH v16 09/16] x86/sgx: Add basic EPC reclamation flow for cgroup

2024-08-27 Thread Huang, Kai
2) For on-demand synchronous reclamation, sgx_cgroup_try_charge() needs to invoke the per-cgroup reclamation until the cgroup usage become "become" -> "becomes" +/* + * Return the next descendant in a preorder walk, given a root, @root and a + * cgroup, @cg, to start the walk from. R

Re: [PATCH v16 12/16] x86/sgx: Revise global reclamation for EPC cgroups

2024-08-27 Thread Huang, Kai
On 27/08/2024 11:32 pm, Huang, Kai wrote: On Tue, 2024-08-20 at 18:54 -0700, Haitao Huang wrote: With EPC cgroups, the global reclamation function, sgx_reclaim_pages_global(), can no longer apply to the global LRU as pages are now in per-cgroup LRUs. Create a wrapper, sgx_cgroup_reclaim_glob

Re: [PATCH v16 16/16] selftests/sgx: Add scripts for EPC cgroup testing

2024-08-27 Thread Huang, Kai
On 21/08/2024 1:54 pm, Haitao Huang wrote: With different cgroups, the script starts one or multiple concurrent SGX selftests (test_sgx), each to run the unclobbered_vdso_oversubscribed test case, which loads an enclave of EPC size equal to the EPC capacity available on the platform. The scrip

Re: [PATCH v16 14/16] x86/sgx: Turn on per-cgroup EPC reclamation

2024-08-27 Thread Huang, Kai
On 21/08/2024 1:54 pm, Haitao Huang wrote: From: Kristen Carlson Accardi Previous patches have implemented all infrastructure needed for per-cgroup EPC page tracking and reclaiming. But all reclaimable EPC pages are still tracked in the global LRU as sgx_epc_page_lru() always returns referen

Re: [PATCH v16 05/16] x86/sgx: Implement basic EPC misc cgroup functionality

2024-08-27 Thread Huang, Kai
+static void sgx_cgroup_misc_init(struct misc_cg *cg, struct sgx_cgroup *sgx_cg) +{ + cg->res[MISC_CG_RES_SGX_EPC].priv = sgx_cg; + sgx_cg->cg = cg; +} + [...] +int __init sgx_cgroup_init(void) +{ + sgx_cgroup_misc_init(misc_cg_root(), &sgx_cg_root); + + return 0; +} >

Re: [PATCH v4] remoteproc: xlnx: add sram support

2024-08-27 Thread Tanmay Shah
On 8/26/24 11:22 AM, Mathieu Poirier wrote: > Good morning, > > First and foremost the overall structure of your code has improved immensely > and > I commend you for that. > Thanks! I hope to get better. > On Mon, Aug 19, 2024 at 10:09:38AM -0700, Tanmay Shah wrote: >> AMD-Xilinx zynqmp pl

Re: [PATCH v2 03/19] gendwarfksyms: Add address matching

2024-08-27 Thread Sami Tolvanen
Hi Petr, On Tue, Aug 27, 2024 at 12:40 PM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > +static inline u32 symbol_addr_hash(const struct symbol_addr *addr) > > +{ > > + return jhash(addr, sizeof(struct symbol_addr), 0); > > I would be careful and avoid including the padding

Re: [PATCH] vdpa/mlx5: Fix invalid mr resource destroy

2024-08-27 Thread Nelson, Shannon
On 8/27/2024 9:08 AM, Dragos Tatulea wrote: Certain error paths from mlx5_vdpa_dev_add() can end up releasing mr resources which never got initialized in the first place. This patch adds the missing check in mlx5_vdpa_destroy_mr_resources() to block releasing non-initialized mr resources. Refe

Re: [PATCH] vdpa/mlx5: Use random MAC address when no nic vport MAC set

2024-08-27 Thread Nelson, Shannon
On 8/27/2024 9:02 AM, Dragos Tatulea wrote: When the vdpa device is configured without a specific MAC address, the vport MAC address is used. However, this address can be 0 which prevents the driver from properly configuring the MPFS and breaks steering. The solution is to simply generate a ran

Re: [PATCH v2] rust: add `module_params` macro

2024-08-27 Thread Trevor Gross
On Tue, Aug 27, 2024 at 10:00 AM Andreas Hindborg wrote: > > "Trevor Gross" writes: > > > On Mon, Aug 19, 2024 at 8:35 AM Andreas Hindborg wrote: > >> > >> From: Andreas Hindborg > >> > >> This patch includes changes required for Rust kernel modules to utilize > >> module parameters. This code

Re: [PATCH v2 02/19] gendwarfksyms: Add symbol list handling

2024-08-27 Thread Sami Tolvanen
Hi Petr, On Tue, Aug 27, 2024 at 2:16 AM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > +static bool is_export_symbol(struct state *state, Dwarf_Die *die) > > +{ > > + Dwarf_Die *source = die; > > + Dwarf_Die origin; > > + > > + state->sym = NULL; > > Nit: This assig

Re: [GIT PULL] livepatching selftest fixup for 6.11-rc6

2024-08-27 Thread pr-tracker-bot
The pull request you sent on Tue, 27 Aug 2024 12:32:08 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching > tags/livepatching-for-6.11-rc6 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6 Thank you!

Re: [PATCH] tracing: Replace strncpy() with strscpy() when copying comm

2024-08-27 Thread Justin Stitt
Hi, On Wed, Jul 31, 2024 at 03:50:58PM GMT, Jinjie Ruan wrote: > Replace the depreciated[1] strncpy() calls with strscpy() > when copying comm. > > Link: https://github.com/KSPP/linux/issues/90 [1] > Signed-off-by: Jinjie Ruan Reviewed-by: Justin Stitt > --- > kernel/trace/trace.c

Re: [PATCH] x86/sgx: Fix a W=1 build warning in function comment

2024-08-27 Thread Jarkko Sakkinen
On Sun Aug 25, 2024 at 11:06 AM EEST, Kai Huang wrote: > Building the SGX code with W=1 generates below warning: > > arch/x86/kernel/cpu/sgx/main.c:741: warning: Function parameter or struct > member 'low' not described in 'sgx_calc_section_metric' > arch/x86/kernel/cpu/sgx/main.c:741: warning

Re: [PATCH v5 3/3] x86/sgx: Resolve EREMOVE page vs EAUG page data race

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 1:02 PM EEST, Dmitrii Kuvaiskii wrote: > Two enclave threads may try to add and remove the same enclave page > simultaneously (e.g., if the SGX runtime supports both lazy allocation > and MADV_DONTNEED semantics). Consider some enclave page added to the > enclave. User space

Re: [PATCH v5 2/3] x86/sgx: Resolve EAUG race where losing thread returns SIGBUS

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 1:02 PM EEST, Dmitrii Kuvaiskii wrote: > Imagine an mmap()'d file. Two threads touch the same address at the same > time and fault. Both allocate a physical page and race to install a PTE > for that page. Only one will win the race. The loser frees its page, but > still conti

Re: [PATCH v5 1/3] x86/sgx: Split SGX_ENCL_PAGE_BEING_RECLAIMED into two flags

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 1:02 PM EEST, Dmitrii Kuvaiskii wrote: > The page reclaimer thread sets SGX_ENC_PAGE_BEING_RECLAIMED flag when > the enclave page is being reclaimed (moved to the backing store). This > flag however has two logical meanings: > > 1. Don't attempt to load the enclave page (the

Re: [PATCH v16 00/16] Add Cgroup support for SGX EPC memory

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:53 AM EEST, Haitao Huang wrote: > SGX Enclave Page Cache (EPC) memory allocations are separate from normal > RAM allocations, and are managed solely by the SGX subsystem. The existing > cgroup memory controller cannot be used to limit or account for SGX EPC > memory, which

Re: [RFC] vDPA: Trying to make sense of config data

2024-08-27 Thread Michael S. Tsirkin
On Fri, Aug 23, 2024 at 09:51:24AM -0500, Carlos Bilbao wrote: > Hello again,  > > Answering my own question: > > https://elixir.bootlin.com/linux/v6.10.2/source/include/uapi/linux/virtio_net.h#L92 > > Thanks, Carlos Right. kernel.org would be the official source for that header. Or if you want

Re: [PATCH v16 13/16] x86/sgx: implement direct reclamation for cgroups

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:54 AM EEST, Haitao Huang wrote: > sgx_reclaim_direct() was introduced to preemptively reclaim some pages > as the best effort to avoid on-demand reclamation that can stall forward > progress in some situations, e.g., allocating pages to load previously > reclaimed page to p

Re: [PATCH v16 12/16] x86/sgx: Revise global reclamation for EPC cgroups

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:54 AM EEST, Haitao Huang wrote: > With EPC cgroups, the global reclamation function, > sgx_reclaim_pages_global(), can no longer apply to the global LRU as > pages are now in per-cgroup LRUs. > > Create a wrapper, sgx_cgroup_reclaim_global() to invoke > sgx_cgroup_reclaim_p

Re: [PATCH v16 10/16] x86/sgx: Implement async reclamation for cgroup

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:53 AM EEST, Haitao Huang wrote: > From: Kristen Carlson Accardi > > In cases EPC pages need be allocated during a page fault and the cgroup > usage is near its limit, an asynchronous reclamation needs to be > triggered to avoid blocking the page fault handling. > > To keep

Re: [PATCH v16 09/16] x86/sgx: Add basic EPC reclamation flow for cgroup

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:53 AM EEST, Haitao Huang wrote: > Currently in the EPC page allocation, the kernel simply fails the > allocation when the current EPC cgroup fails to charge due to its usage > reaching limit. This is not ideal. When that happens, a better way is > to reclaim EPC page(s) f

Re: [PATCH v16 08/16] x86/sgx: Encapsulate uses of the global LRU

2024-08-27 Thread Jarkko Sakkinen
On Wed Aug 21, 2024 at 4:53 AM EEST, Haitao Huang wrote: > To support the per-cgroup reclamation, each cgroup will have its own > "per-cgroup LRU" and EPC pages will be in its owner cgroup's LRU instead > of the global LRU. Abstract the code that is directly working with the > global LRU into funct

Re: [RFC] Why is set_config not supported in mlx5_vnet?

2024-08-27 Thread Carlos Bilbao
Hello, On 8/26/24 9:07 PM, Jason Wang wrote: > On Tue, Aug 27, 2024 at 3:23 AM Carlos Bilbao > wrote: >> Hello, >> >> On 8/26/24 10:53 AM, Dragos Tatulea wrote: >>> On 26.08.24 16:26, Carlos Bilbao wrote: Hello Dragos, On 8/26/24 4:06 AM, Dragos Tatulea wrote: > On 23.08.24 18

Re: [RFC] Why is set_config not supported in mlx5_vnet?

2024-08-27 Thread Dragos Tatulea
On 27.08.24 04:03, Jason Wang wrote: > On Tue, Aug 27, 2024 at 12:11 AM Dragos Tatulea wrote: >> >> >> On 26.08.24 16:24, Andrew Lunn wrote: >>> On Mon, Aug 26, 2024 at 11:06:09AM +0200, Dragos Tatulea wrote: On 23.08.24 18:54, Carlos Bilbao wrote: > Hello, > > I'm de

Re: [PATCH v2 01/19] tools: Add gendwarfksyms

2024-08-27 Thread Sami Tolvanen
Hi Greg, On Fri, Aug 16, 2024 at 12:14 AM Greg Kroah-Hartman wrote: > > On Thu, Aug 15, 2024 at 05:39:05PM +, Sami Tolvanen wrote: > > --- /dev/null > > +++ b/scripts/gendwarfksyms/dwarf.c > > @@ -0,0 +1,87 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > Sorry, but I have to ask, do

[PATCH] vdpa/mlx5: Fix invalid mr resource destroy

2024-08-27 Thread Dragos Tatulea
Certain error paths from mlx5_vdpa_dev_add() can end up releasing mr resources which never got initialized in the first place. This patch adds the missing check in mlx5_vdpa_destroy_mr_resources() to block releasing non-initialized mr resources. Reference trace: mlx5_core :08:00.2: mlx5_vd

[PATCH] vdpa/mlx5: Use random MAC address when no nic vport MAC set

2024-08-27 Thread Dragos Tatulea
When the vdpa device is configured without a specific MAC address, the vport MAC address is used. However, this address can be 0 which prevents the driver from properly configuring the MPFS and breaks steering. The solution is to simply generate a random MAC address when no MAC is set on the nic v

Re: [PATCH] tracing/timerlat: Check tlat_var for NULL in timerlat_fd_release

2024-08-27 Thread Tomas Glozar
po 26. 8. 2024 v 19:27 odesílatel Steven Rostedt napsal: > > Yeah, I think I finally found the real issue. I don't think we need the ref > counting. The problem is the creating and killing of the threads via the > start and stop callbacks. That's not their purpose. The purpose of stop > and start

Re: [PATCH v2] rust: add `module_params` macro

2024-08-27 Thread Andreas Hindborg
"Trevor Gross" writes: > On Mon, Aug 19, 2024 at 8:35 AM Andreas Hindborg wrote: >> >> From: Andreas Hindborg >> >> This patch includes changes required for Rust kernel modules to utilize >> module parameters. This code implements read only support for integer >> types without `sysfs` support.

[PATCH v2] tracing: Avoid possible softlockup in tracing_iter_reset()

2024-08-27 Thread Zheng Yejian
In __tracing_open(), when max latency tracers took place on the cpu, the time start of its buffer would be updated, then event entries with timestamps being earlier than start of the buffer would be skipped (see tracing_iter_reset()). Softlockup will occur if the kernel is non-preemptible and too

Re: [PATCH v2 03/19] gendwarfksyms: Add address matching

2024-08-27 Thread Petr Pavlu
On 8/15/24 19:39, Sami Tolvanen wrote: > The compiler may choose not to emit type information in DWARF for all > aliases, but it's possible for each alias to be exported separately. > To ensure we find type information for the aliases as well, read > {section, address} tuples from the symbol table

[PATCH v3 7/6 DONT_MERGE] selftests: livepatch: Test failing IBT checks crashing the module

2024-08-27 Thread Lukas Hruska
This patch is only an example of how to generate #GP by IBT. It serves only as an example for those wondering how the Linux behaves in this case. Don't merge this patch, because it causes a refcount underflow of the test module, so it's not possible to unload it. Signed-off-by: Lukas Hruska ---

[PATCH v3 6/6] selftests: livepatch: Test livepatching function using an external symbol

2024-08-27 Thread Lukas Hruska
The test proves that klp-convert works as intended and it is possible to livepatch a function that use an external symbol. Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Tested-by: Petr Mladek --- tools/testing/selftests/livepatch/Makefile| 3 +- .../testing/selftests/livepatch/func

[PATCH v3 5/6] documentation: Update on livepatch elf format

2024-08-27 Thread Lukas Hruska
Add a section to Documentation/livepatch/module-elf-format.rst describing how klp-convert works for fixing relocations. Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- Documentation/livepatch/module-elf-format.rst | 67 +++ 1 file cha

[PATCH v3 4/6] livepatch: Add sample livepatch module

2024-08-27 Thread Lukas Hruska
From: Josh Poimboeuf Add a new livepatch sample in samples/livepatch/ to make use of symbols that must be post-processed to enable load-time relocation resolution. As the new sample is to be used as an example, it is annotated with KLP_RELOC_SYMBOL macro. The livepatch sample updates the functio

[PATCH v3 2/6] livepatch: Add klp-convert tool

2024-08-27 Thread Lukas Hruska
Livepatches need to access external symbols which can't be handled by the normal relocation mechanism. It is needed for two types of symbols: + Symbols which can be local for the original livepatched function. The alternative implementation in the livepatch sees them as external symbols.

[PATCH v3 3/6] kbuild/modpost: integrate klp-convert

2024-08-27 Thread Lukas Hruska
From: Josh Poimboeuf Call klp-convert for the livepatch modules after the final linking. Also update the modpost tool so that it does not warn about unresolved symbols matching the expected format which will be then resolved by klp-convert. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hr

[PATCH v3 1/6] livepatch: Create and include UAPI headers

2024-08-27 Thread Lukas Hruska
From: Josh Poimboeuf Define klp prefixes in include/uapi/linux/livepatch.h, and use them for replacing hard-coded values in kernel/livepatch/core.c. Signed-off-by: Josh Poimboeuf Signed-off-by: Lukas Hruska Reviewed-by: Petr Mladek Reviewed-by: Marcos Paulo de Souza --- MAINTAINERS

[PATCH v3 0/6] livepatch: klp-convert tool - Minimal version

2024-08-27 Thread Lukas Hruska
Summary --- This is a significantly simplified version of the original klp-convert tool. The klp-convert code has never got a proper review and also clean ups were not easy. The last version was v7, see https://lore.kernel.org/r/20230306140824.3858543-1-joe.lawre...@redhat.com The main change

Re: [PATCH] tracing: Mitigate possible softlockup in __tracing_open()

2024-08-27 Thread Steven Rostedt
On Tue, 27 Aug 2024 09:29:55 +0800 Zheng Yejian wrote: > > This is the wrong place to put this. If the problem is with > > tracing_iter_reset(), then add it there. > > > > while (ring_buffer_iter_peek(buf_iter, &ts)) { > > if (ts >= iter->array_buffer->time_start) > >

Re: [PATCH] arm64: insn: Simulate nop and push instruction for better uprobe performance

2024-08-27 Thread Liao, Chang
Hi, Mark Would you like to discuss this patch further, or do you still believe emulating STP to push FP/LR into the stack in kernel is not a good idea? Thanks. 在 2024/8/21 15:55, Liao, Chang 写道: > Hi, Mark > > My bad for taking so long to rely, I generally agree with your suggestions to > STP

Re: [PATCH v16 12/16] x86/sgx: Revise global reclamation for EPC cgroups

2024-08-27 Thread Huang, Kai
On Tue, 2024-08-20 at 18:54 -0700, Haitao Huang wrote: > With EPC cgroups, the global reclamation function, > sgx_reclaim_pages_global(), can no longer apply to the global LRU as > pages are now in per-cgroup LRUs. > > Create a wrapper, sgx_cgroup_reclaim_global() to invoke > sgx_cgroup_reclaim_pa

Re: [PATCH v16 08/16] x86/sgx: Encapsulate uses of the global LRU

2024-08-27 Thread Huang, Kai
> +static inline bool sgx_can_reclaim_global(void) > +{ > + /* > + * Now all EPC pages are still tracked in the @sgx_global_lru, so only > + * check @sgx_global_lru. > + * > + * When EPC pages are tracked in the actual per-cgroup LRUs, > + * replace with sgx_cgroup_lru

Re: [PATCH v16 02/16] cgroup/misc: Add per resource callbacks for CSS events

2024-08-27 Thread Huang, Kai
On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote: > +/** > + * misc_cg_set_ops() - register resource specific operations. > + * @type: Type of the misc res. > + * @ops: Operations for the given type. > + * > + * The callbacks in @ops will not be invoked if the capacity of @type is 0. > + * > +

[GIT PULL] livepatching selftest fixup for 6.11-rc6

2024-08-27 Thread Petr Mladek
Hi Linus, please pull a regression fix in livepatching selftests from git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching tags/livepatching-for-6.11-rc6 === - Fix a regression in a livepatching selftest. ---

Re: [PATCH v16 03/16] cgroup/misc: Export APIs for SGX driver

2024-08-27 Thread Huang, Kai
On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote: > -static struct misc_cg *parent_misc(struct misc_cg *cgroup) > +struct misc_cg *misc_cg_root(void) >  { > - return cgroup ? css_misc(cgroup->css.parent) : NULL; > + return &root_cg; >  } > +EXPORT_SYMBOL_GPL(misc_cg_root); >   This do

Re: [PATCH v16 10/16] x86/sgx: Implement async reclamation for cgroup

2024-08-27 Thread Huang, Kai
On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote: > +/** > + * Only called during init to unwind what's done in sgx_cgroup_init() > + */ > +void __init sgx_cgroup_deinit(void) > +{ > + destroy_workqueue(sgx_cg_wq); > +} > + Ditto: arch/x86/kernel/cpu/sgx/epc_cgroup.c:412: warning: This c

Re: [PATCH v16 05/16] x86/sgx: Implement basic EPC misc cgroup functionality

2024-08-27 Thread Huang, Kai
On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote: > +/** > + * Register capacity and ops for SGX cgroup. > + * Only called at the end of sgx_init() when SGX is ready to handle the ops > + * callbacks. > + */ Got this warning when building with W=1: arch/x86/kernel/cpu/sgx/epc_cgroup.c:420: w

Re: [PATCH v2 02/19] gendwarfksyms: Add symbol list handling

2024-08-27 Thread Petr Pavlu
On 8/15/24 19:39, Sami Tolvanen wrote: > Add support for passing a list of exported symbols to gendwarfksyms > via stdin and filter out non-exported symbols from the output. > > Signed-off-by: Sami Tolvanen > --- > scripts/gendwarfksyms/Makefile| 1 + > scripts/gendwarfksyms/dwarf.c

Re: [RFC PATCH v4 12/17] powerpc64/ftrace: Move ftrace sequence out of line

2024-08-27 Thread Masahiro Yamada
On Sun, Jul 14, 2024 at 5:29 PM Naveen N Rao wrote: > > Function profile sequence on powerpc includes two instructions at the > beginning of each function: > mflrr0 > bl ftrace_caller > > The call to ftrace_caller() gets nop'ed out during kernel boot and is > patched in wh