[PATCH v10 3/3] dax/kmem: allow kmem to add memory with memmap_on_memory

2023-11-06 Thread Vishal Verma
Large amounts of memory managed by the kmem driver may come in via CXL, and it is often desirable to have the memmap for this memory on the new memory itself. Enroll kmem-managed memory for memmap_on_memory semantics if the dax region originates via CXL. For non-CXL dax regions, retain the

[PATCH v10 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks

2023-11-06 Thread Vishal Verma
The MHP_MEMMAP_ON_MEMORY flag for hotplugged memory is restricted to 'memblock_size' chunks of memory being added. Adding a larger span of memory precludes memmap_on_memory semantics. For users of hotplug such as kmem, large amounts of memory might get added from the CXL subsystem. In some cases,

[PATCH v10 1/3] mm/memory_hotplug: replace an open-coded kmemdup() in add_memory_resource()

2023-11-06 Thread Vishal Verma
A review of the memmap_on_memory modifications to add_memory_resource() revealed an instance of an open-coded kmemdup(). Replace it with kmemdup(). Cc: Andrew Morton Cc: David Hildenbrand Cc: Michal Hocko Cc: Oscar Salvador Cc: Dan Williams Reported-by: Dan Williams Reviewed-by: David

[PATCH v10 0/3] mm: use memmap_on_memory semantics for dax/kmem

2023-11-06 Thread Vishal Verma
The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There is a chance there isn't enough regular system memory available to fit the memmap for this new memory. It's therefore desirable, if all other

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 22:06:17 -0500 Steven Rostedt wrote: > On Tue, 7 Nov 2023 09:42:58 +0900 > Masami Hiramatsu (Google) wrote: > > > Got it. So does ftrace_regs need a placeholder for direct trampoline? > > (Or, can we use a register to pass it?) > > I think we don't need to clear it for

[GIT PULL] remoteproc updates for v6.7

2023-11-06 Thread Bjorn Andersson
The following changes since commit 0bb80ecc33a8fb5a682236443c1e740d5c917d1d: Linux 6.6-rc1 (2023-09-10 16:28:41 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git tags/rproc-v6.7 for you to fetch changes up to

Re: [RFC PATCH 18/32] function_graph: Fix to initalize ftrace_ops for fgraph with ftrace_graph_func

2023-11-06 Thread Steven Rostedt
On Tue, 7 Nov 2023 10:49:24 +0900 Masami Hiramatsu (Google) wrote: > > I've changed this, because fprobe entry handler is not called via > > fgraph without this. But maybe I have to set correct gops->ops.func > > after init? > > I confirmed that this is right because it is introduced by >

[GIT PULL] rpmsg updates for v6.7

2023-11-06 Thread Bjorn Andersson
The following changes since commit 0bb80ecc33a8fb5a682236443c1e740d5c917d1d: Linux 6.6-rc1 (2023-09-10 16:28:41 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git tags/rpmsg-v6.7 for you to fetch changes up to

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Steven Rostedt
On Tue, 7 Nov 2023 09:42:58 +0900 Masami Hiramatsu (Google) wrote: > Got it. So does ftrace_regs need a placeholder for direct trampoline? > (Or, can we use a register to pass it?) > I think we don't need to clear it for return_to_handler() but if > `ftrace_regs` spec requires it, it is better

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Haitao Huang
On Mon, 06 Nov 2023 19:16:30 -0600, Haitao Huang wrote: On Mon, 06 Nov 2023 16:18:30 -0600, Huang, Kai wrote: > > +/** > > + * sgx_epc_cgroup_try_charge() - hierarchically try to charge a single > > EPC page > > + * > > + * Returns EPC cgroup or NULL on success, -errno on failure. >

Re: [RFC PATCH 18/32] function_graph: Fix to initalize ftrace_ops for fgraph with ftrace_graph_func

2023-11-06 Thread Google
On Mon, 6 Nov 2023 19:04:16 +0900 Masami Hiramatsu (Google) wrote: > On Mon, 6 Nov 2023 01:10:10 +0900 > "Masami Hiramatsu (Google)" wrote: > > > From: Masami Hiramatsu (Google) > > > > Fix to initialize the ftrace_ops of fgraph_ops with ftrace_graph_func > > instead of ftrace_stub. > >

Re: [RFC PATCH 10/32] function_graph: Have the instances use their own ftrace_ops for filtering

2023-11-06 Thread Google
On Mon, 6 Nov 2023 01:08:32 +0900 "Masami Hiramatsu (Google)" wrote: > From: Steven Rostedt (VMware) > > Allow for instances to have their own ftrace_ops part of the fgraph_ops that > makes the funtion_graph tracer filter on the set_ftrace_filter file of the > instance and not the top

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Haitao Huang
On Mon, 06 Nov 2023 16:18:30 -0600, Huang, Kai wrote: > > +/** > > + * sgx_epc_cgroup_try_charge() - hierarchically try to charge a single > > EPC page > > + * > > + * Returns EPC cgroup or NULL on success, -errno on failure. > > + */ > > +struct sgx_epc_cgroup

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 11:37:10 -0500 Steven Rostedt wrote: > On Mon, 6 Nov 2023 10:05:49 +0900 > Masami Hiramatsu (Google) wrote: > > > So for x86-64, > > > > - rdi, rsi, rcx, rdx, r8, r9, and rsp > > - rax and rdx > > - rbp > > > > (BTW, why orig_rax is cleared?) > > You mean from

Re: [PATCH] tracing: fprobe-event: Fix to check tracepoint event and return

2023-11-06 Thread Google
On Mon, 6 Nov 2023 17:28:11 -0500 Steven Rostedt wrote: > On Sat, 4 Nov 2023 01:05:34 +0900 > "Masami Hiramatsu (Google)" wrote: > > > From: Masami Hiramatsu (Google) > > > > Fix to check the tracepoint event is not valid with $retval. > > The commit 08c9306fc2e3 ("tracing/fprobe-event:

Re: [PATCH] tracing: fprobe-event: Fix to check tracepoint event and return

2023-11-06 Thread Steven Rostedt
On Sat, 4 Nov 2023 01:05:34 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Fix to check the tracepoint event is not valid with $retval. > The commit 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is > a return event by $retval") introduced automatic return

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Huang, Kai
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: > +static int __init sgx_epc_cgroup_init(void) > +{ > + struct misc_cg *cg; > + > + if (!boot_cpu_has(X86_FEATURE_SGX)) > + return 0; > + > + cg = misc_cg_root(); > + BUG_ON(!cg); > + > + return

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Huang, Kai
> > > > +/** > > > + * sgx_epc_cgroup_try_charge() - hierarchically try to charge a single > > > EPC page > > > + * > > > + * Returns EPC cgroup or NULL on success, -errno on failure. > > > + */ > > > +struct sgx_epc_cgroup *sgx_epc_cgroup_try_charge(void) > > > +{ > > > + struct sgx_epc_cgroup

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Haitao Huang
On Mon, 06 Nov 2023 06:09:45 -0600, Huang, Kai wrote: On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: From: Kristen Carlson Accardi Implement support for cgroup control of SGX Enclave Page Cache (EPC) memory using the misc cgroup controller. EPC memory is independent from normal

Re: [PATCH v9 1/3] mm/memory_hotplug: replace an open-coded kmemdup() in add_memory_resource()

2023-11-06 Thread fan
On Thu, Nov 02, 2023 at 12:27:13PM -0600, Vishal Verma wrote: > A review of the memmap_on_memory modifications to add_memory_resource() > revealed an instance of an open-coded kmemdup(). Replace it with > kmemdup(). > > Cc: Andrew Morton > Cc: David Hildenbrand > Cc: Michal Hocko > Cc: Oscar

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Steven Rostedt
On Mon, 6 Nov 2023 10:05:49 +0900 Masami Hiramatsu (Google) wrote: > So for x86-64, > > - rdi, rsi, rcx, rdx, r8, r9, and rsp > - rax and rdx > - rbp > > (BTW, why orig_rax is cleared?) You mean from ftrace_caller? That's a "hack" to determine if we need to call the direct trampoline or

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

2023-11-06 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 --- Documentation/livepatch/module-elf-format.rst | 67 +++ 1 file changed, 67 insertions(+) diff --git

[PATCH v1 4/5] livepatch: Add sample livepatch module

2023-11-06 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

[PATCH v1 3/5] kbuild/modpost: integrate klp-convert

2023-11-06 Thread Lukas Hruska
From: Josh Poimboeuf Update the modpost program 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 Hruska --- .gitignore| 1 + Makefile

[PATCH v1 2/5] livepatch: Add klp-convert tool

2023-11-06 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

[PATCH v1 1/5] livepatch: Create and include UAPI headers

2023-11-06 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 --- MAINTAINERS| 1 + include/uapi/linux/livepatch.h | 15

[PATCH v1 0/5] livepatch: klp-convert tool - Minimal version

2023-11-06 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

Re: [PATCH v6 10/12] x86/sgx: Implement EPC reclamation for cgroup

2023-11-06 Thread Haitao Huang
There is an issue WRT charging proper mem_cgroups for backing pages once per-cgroup reclamation is implemented. Please apply the fix-up patch [1] on top of this patch or the series. Thanks Haitao [1] https://lore.kernel.org/all/20231106155859.7251-1-haitao.hu...@linux.intel.com/

[PATCH] x86/sgx: Charge proper mem_cgroup for usage due to EPC reclamation by cgroups

2023-11-06 Thread Haitao Huang
Enclave Page Cache(EPC) memory can be swapped out to regular system memory, and the consumed memory should be charged to a proper mem_cgroup. Currently the selection of mem_cgroup to charge is done in sgx_encl_get_mem_cgroup(). But it only considers two contexts in which the swapping can be done:

Re: [PATCH v6 00/12] Add Cgroup support for SGX EPC memory

2023-11-06 Thread Haitao Huang
On Sun, 05 Nov 2023 21:26:44 -0600, Jarkko Sakkinen wrote: On Mon, 2023-10-30 at 11:20 -0700, 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

Re: [PATCH v3 2/3] remoteproc: qcom: pas: make region assign more generic

2023-11-06 Thread Mukesh Ojha
On 11/6/2023 1:58 PM, Neil Armstrong wrote: The current memory region assign only supports a single memory region. But new platforms introduces more regions to make the memory requirements more flexible for various use cases. Those new platforms also shares the memory region between the DSP

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Peter Zijlstra
On Mon, Nov 06, 2023 at 09:47:08PM +0900, Masami Hiramatsu wrote: > On Mon, 6 Nov 2023 11:19:32 +0100 > Peter Zijlstra wrote: > > > On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > > > On Sun, 5 Nov 2023 18:34:09 -0500 > > > Steven Rostedt wrote: > > > > > > > On Sun, 5 Nov

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Google
On Mon, 6 Nov 2023 11:19:32 +0100 Peter Zijlstra wrote: > On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > > On Sun, 5 Nov 2023 18:34:09 -0500 > > Steven Rostedt wrote: > > > > > On Sun, 5 Nov 2023 18:33:01 -0500 > > > Steven Rostedt wrote: > > > > > > > For x86_64, that

Re: [PATCH v6 04/12] x86/sgx: Implement basic EPC misc cgroup functionality

2023-11-06 Thread Huang, Kai
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: > From: Kristen Carlson Accardi > > Implement support for cgroup control of SGX Enclave Page Cache (EPC) > memory using the misc cgroup controller. EPC memory is independent > from normal system memory, e.g. must be reserved at boot from RAM

Re: [RFC PATCH 24/32] x86/ftrace: Enable HAVE_FUNCTION_GRAPH_FREGS

2023-11-06 Thread Peter Zijlstra
On Mon, Nov 06, 2023 at 09:38:50AM +0900, Masami Hiramatsu wrote: > On Sun, 5 Nov 2023 18:34:09 -0500 > Steven Rostedt wrote: > > > On Sun, 5 Nov 2023 18:33:01 -0500 > > Steven Rostedt wrote: > > > > > For x86_64, that would be: > > > > > > rdi, rsi, rdx, r8, r9, rsp > > > > I missed rcx.

Re: [RFC PATCH 18/32] function_graph: Fix to initalize ftrace_ops for fgraph with ftrace_graph_func

2023-11-06 Thread Google
On Mon, 6 Nov 2023 01:10:10 +0900 "Masami Hiramatsu (Google)" wrote: > From: Masami Hiramatsu (Google) > > Fix to initialize the ftrace_ops of fgraph_ops with ftrace_graph_func > instead of ftrace_stub. I've changed this, because fprobe entry handler is not called via fgraph without this.

[PATCH v3 3/3] remoteproc: qcom: pas: Add SM8650 remoteproc support

2023-11-06 Thread Neil Armstrong
Add DSP Peripheral Authentication Service support for the SM8650 platform. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- drivers/remoteproc/qcom_q6v5_pas.c | 50 ++ 1 file changed, 50 insertions(+) diff --git

[PATCH v3 1/3] dt-bindings: remoteproc: qcom,sm8550-pas: document the SM8650 PAS

2023-11-06 Thread Neil Armstrong
Document the DSP Peripheral Authentication Service on the SM8650 Platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong --- .../bindings/remoteproc/qcom,sm8550-pas.yaml | 44 +- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git

[PATCH v3 2/3] remoteproc: qcom: pas: make region assign more generic

2023-11-06 Thread Neil Armstrong
The current memory region assign only supports a single memory region. But new platforms introduces more regions to make the memory requirements more flexible for various use cases. Those new platforms also shares the memory region between the DSP and HLOS. To handle this, make the region assign

[PATCH v3 0/3] remoteproc: qcom: Introduce DSP support for SM8650

2023-11-06 Thread Neil Armstrong
Add the bindings and driver changes for DSP support on the SM8650 platform in order to enable the aDSP, cDSP and MPSS subsystems to boot. Compared to SM8550, where SM8650 uses the same dual firmware files, (dtb file and main firmware) the memory zones requirement has changed: - cDSP: now requires