Re: [PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Huang, Kai
> > I'll send a fixup for this patch or another version of the series if more > changes are needed. Hi Haitao, I don't like to say but in general I think you are sending too frequently. The last version was sent April, 11th (my time), so considering the weekend it has only been 3 or at most

Re: [PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Haitao Huang
Missed adding the config file: index ..e7f1db1d3eff --- /dev/null +++ b/tools/testing/selftests/sgx/config @@ -0,0 +1,4 @@ +CONFIG_CGROUPS=y +CONFIG_CGROUP_MISC=y +CONFIG_MEMCG=y +CONFIG_X86_SGX=y I'll send a fixup for this patch or another version of the series if more changes

Re: [PATCH for-next v2] tracing/kprobes: Add symbol counting check when module loads

2024-04-15 Thread Steven Rostedt
On Mon, 15 Apr 2024 18:40:23 +0900 "Masami Hiramatsu (Google)" wrote: > Check the number of probe target symbols in the target module when > the module is loaded. If the probe is not on the unique name symbols > in the module, it will be rejected at that point. > > Note that the symbol which

[PATCH] ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value

2024-04-15 Thread Steven Rostedt
The string SND_SOC_DAPM_DIR_OUT is printed in the snd_soc_dapm_path trace event instead of its value: (((REC->path_dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-") User space cannot parse this, as it has no idea what SND_SOC_DAPM_DIR_OUT is. Use TRACE_DEFINE_ENUM() to convert it to its value:

Re: TP_printk() bug with %c, and more?

2024-04-15 Thread Steven Rostedt
On Tue, 16 Apr 2024 04:08:46 +0200 Luca Ceresoli wrote: > Thanks for the insight. I'm definitely trying to fix this based on your > hint as soon as I get my hand on a board. I have a patch I forgot to send out. Let me do that now. -- Steve

Re: [PATCH v5 5/5] Documentation: Add reconnect process for VDUSE

2024-04-15 Thread Jason Wang
On Fri, Apr 12, 2024 at 9:31 PM Cindy Lu wrote: > > Add a document explaining the reconnect process, including what the > Userspace App needs to do and how it works with the kernel. > > Signed-off-by: Cindy Lu > --- > Documentation/userspace-api/vduse.rst | 41 +++ > 1

[syzbot] [bpf?] [trace?] possible deadlock in put_pwq_unlocked

2024-04-15 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16fbaf7b18 kernel config: https://syzkaller.appspot.com/x/.config?x=fe78468a74fdc3b7

Re: Re: [RFC 0/3] Improve memory statistics for virtio balloon

2024-04-15 Thread zhenwei pi
On 4/15/24 23:01, David Hildenbrand wrote: On 15.04.24 10:41, zhenwei pi wrote: Hi, When the guest runs under critial memory pressure, the guest becomss too slow, even sshd turns D state(uninterruptible) on memory allocation. We can't login this VM to do any work on trouble shooting. Guest

[PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Haitao Huang
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 script checks results against the expectation set

[PATCH v12 13/14] Docs/x86/sgx: Add description for cgroup support

2024-04-15 Thread Haitao Huang
From: Sean Christopherson Add initial documentation of how to regulate the distribution of SGX Enclave Page Cache (EPC) memory via the Miscellaneous cgroup controller. Signed-off-by: Sean Christopherson Co-developed-by: Kristen Carlson Accardi Signed-off-by: Kristen Carlson Accardi

[PATCH v12 12/14] x86/sgx: Turn on per-cgroup EPC reclamation

2024-04-15 Thread Haitao Huang
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_lru_list() returns hard coded reference to the global LRU. Change sgx_lru_list() to

[PATCH v12 11/14] x86/sgx: Abstract check for global reclaimable pages

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi For the global reclaimer to determine if any page available for reclamation at the global level, it currently only checks for emptiness of the global LRU. That will be inadequate when pages are tracked in multiple LRUs, one per cgroup. For this purpose, create a new

[PATCH v12 08/14] x86/sgx: Add basic EPC reclamation flow for cgroup

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi 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) from the current EPC cgroup

[PATCH v12 10/14] x86/sgx: Charge mem_cgroup for per-cgroup reclamation

2024-04-15 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 considers all contexts other than the ksgxd thread are user

[PATCH v12 09/14] x86/sgx: Implement async reclamation for cgroup

2024-04-15 Thread Haitao Huang
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 be triggered to avoid blocking the page fault handling. Create a workqueue, corresponding work item and function definitions for EPC

[PATCH v12 07/14] x86/sgx: Abstract tracking reclaimable pages in LRU

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi The functions, sgx_{mark,unmark}_page_reclaimable(), manage the tracking of reclaimable EPC pages: sgx_mark_page_reclaimable() adds a newly allocated page into the global LRU list while sgx_unmark_page_reclaimable() does the opposite. Abstract the hard coded global

[PATCH v12 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi 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 is a desirable feature in some

[PATCH v12 06/14] x86/sgx: Add sgx_epc_lru_list to encapsulate LRU list

2024-04-15 Thread Haitao Huang
From: Sean Christopherson Introduce a data structure to wrap the existing reclaimable list and its spinlock. Each cgroup later will have one instance of this structure to track EPC pages allocated for processes associated with the same cgroup. Just like the global SGX reclaimer (ksgxd), an EPC

[PATCH v12 04/14] cgroup/misc: Add SGX EPC resource type

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type for the misc controller. Signed-off-by: Kristen Carlson Accardi Co-developed-by: Haitao Huang Signed-off-by: Haitao Huang Reviewed-by: Jarkko Sakkinen Reviewed-by: Kai Huang Tested-by: Jarkko

[PATCH v12 02/14] cgroup/misc: Add per resource callbacks for CSS events

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi The misc cgroup controller (subsystem) currently does not perform resource type specific action for Cgroups Subsystem State (CSS) events: the 'css_alloc' event when a cgroup is created and the 'css_free' event when a cgroup is destroyed. Define callbacks for those

[PATCH v12 03/14] cgroup/misc: Export APIs for SGX driver

2024-04-15 Thread Haitao Huang
From: Kristen Carlson Accardi The SGX EPC cgroup will reclaim EPC pages when usage in a cgroup reaches its or ancestor's limit. This requires a walk from the current cgroup up to the root similar to misc_cg_try_charge(). Export misc_cg_parent() to enable this walk. The SGX driver also needs

[PATCH v12 01/14] x86/sgx: Replace boolean parameters with enums

2024-04-15 Thread Haitao Huang
Replace boolean parameters for 'reclaim' in the function sgx_alloc_epc_page() and its callers with an enum. Also opportunistically remove non-static declaration of __sgx_alloc_epc_page() and a typo Signed-off-by: Haitao Huang Suggested-by: Jarkko Sakkinen Suggested-by: Dave Hansen

[PATCH v12 00/14] Add Cgroup support for SGX EPC memory

2024-04-15 Thread Haitao Huang
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 is a desirable feature in some environments, e.g., support for

Re: TP_printk() bug with %c, and more?

2024-04-15 Thread Luca Ceresoli
Hello Steven, On Mon, 15 Apr 2024 04:44:30 -0400 Steven Rostedt wrote: > On Mon, 18 Mar 2024 16:43:07 +0100 > Luca Ceresoli wrote: > > > However the arrows are still reversed. > > This requires a kernel change. The problem is that the print fmt has: > > print fmt: "%c%s %s %s %s %s",

[PATCH] bootconfig: Fix the kerneldoc of _xbc_exit()

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Fix the kerneldoc of _xbc_exit() which is updated to have an @early argument and the function name is changed. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202404150036.kpj3hefa-...@intel.com/ Signed-off-by: Masami Hiramatsu

Re: [PATCH 1/4] dt-bindings: iio: light: stk33xx: add regulator for vdd supply

2024-04-15 Thread Jernej Škrabec
Dne nedelja, 14. april 2024 ob 19:57:13 GMT +2 je Aren Moynihan napisal(a): > Signed-off-by: Aren Moynihan Commit message cannot be empty. Best regards, Jernej > --- > Documentation/devicetree/bindings/iio/light/stk33xx.yaml | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Re: [PATCH v11 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Haitao Huang
On Mon, 15 Apr 2024 14:08:44 -0500, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 6:13 AM EEST, Haitao Huang wrote: On Sun, 14 Apr 2024 10:01:03 -0500, Jarkko Sakkinen wrote: > On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote: >> To run selftests for EPC cgroup: >> >> sudo

Re: [PATCH v11 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 8:32 PM EEST, Haitao Huang wrote: > On Sat, 13 Apr 2024 16:34:17 -0500, Jarkko Sakkinen > wrote: > > > On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote: > >> To run selftests for EPC cgroup: > >> > >> sudo ./run_epc_cg_selftests.sh > >> > >> To watch misc cgroup

Re: [PATCH v11 01/14] x86/sgx: Replace boolean parameters with enums

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 4:22 PM EEST, Huang, Kai wrote: > On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > > Replace boolean parameters for 'reclaim' in the function > > sgx_alloc_epc_page() and its callers with an enum. > > > > Also opportunistically remove non-static declaration of > >

Re: [PATCH v11 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 6:13 AM EEST, Haitao Huang wrote: > On Sun, 14 Apr 2024 10:01:03 -0500, Jarkko Sakkinen > wrote: > > > On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote: > >> To run selftests for EPC cgroup: > >> > >> sudo ./run_epc_cg_selftests.sh > >> > >> To watch misc cgroup

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Dr. David Alan Gilbert
* Alexey Dobriyan (adobri...@gmail.com) wrote: > On Sun, Apr 14, 2024 at 01:58:55PM -0700, Luis Chamberlain wrote: > > On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > > > --- a/include/linux/fs.h > > > +++ b/include/linux/fs.h > > > @@ -3616,4 +3616,12 @@ extern int

Re: [PATCH][next] dax: remove redundant assignment to variable rc

2024-04-15 Thread Dave Jiang
On 4/15/24 3:19 AM, Colin Ian King wrote: > The variable rc is being assigned an value and then is being re-assigned > a new value in the next statement. The assignment is redundant and can > be removed. > > Cleans up clang scan build warning: > drivers/dax/bus.c:1207:2: warning: Value stored

Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-15 Thread Mark Rutland
On Mon, Apr 15, 2024 at 09:52:41AM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:00:41PM +0300, Mike Rapoport wrote: > > +/** > > + * enum execmem_type - types of executable memory ranges > > + * > > + * There are several subsystems that allocate executable memory. > > + *

Re: [PATCH v11 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-15 Thread Haitao Huang
On Sat, 13 Apr 2024 16:34:17 -0500, Jarkko Sakkinen wrote: On Wed Apr 10, 2024 at 9:25 PM EEST, Haitao Huang wrote: To run selftests for EPC cgroup: sudo ./run_epc_cg_selftests.sh To watch misc cgroup 'current' changes during testing, run this in a separate terminal:

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Alexey Dobriyan
On Sun, Apr 14, 2024 at 01:58:55PM -0700, Luis Chamberlain wrote: > On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -3616,4 +3616,12 @@ extern int vfs_fadvise(struct file *file, loff_t > > offset, loff_t len, > >

Re: [PATCH v3 22/25] dt-bindings: media: imx258: Add binding for powerdown-gpio

2024-04-15 Thread Luis Garcia
On 4/3/24 12:49, Pavel Machek wrote: > Hi! > >> From: Luis Garcia >> >> Add powerdown-gpio binding as it is required for some boards > > "." at end of sentence. > >> Signed-off-by: Ondrej Jirman >> Signed-off-by: Luis Garcia > > If the patch is from Ondrej, he should be in From:, I believe.

Re: [RFC PATCH 5/7] x86/module: perpare module loading for ROX allocations of text

2024-04-15 Thread Mike Rapoport
On Mon, Apr 15, 2024 at 12:43:16PM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:05:24PM +0300, Mike Rapoport wrote: > > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c > > index 45a280f2161c..b4d6868df573 100644 > > --- a/arch/x86/kernel/alternative.c > >

Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback

2024-04-15 Thread Sean Christopherson
On Sat, Apr 13, 2024, Marc Zyngier wrote: > On Fri, 12 Apr 2024 15:54:22 +0100, Sean Christopherson > wrote: > > > > On Fri, Apr 12, 2024, Marc Zyngier wrote: > > > On Fri, 12 Apr 2024 11:44:09 +0100, Will Deacon wrote: > > > > On Fri, Apr 05, 2024 at 07:58:12AM -0400, Paolo Bonzini wrote: > >

Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-15 Thread Mike Rapoport
On Mon, Apr 15, 2024 at 12:47:50PM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > > > To populate the cache, a writable large page is allocated from vmalloc with > > VM_ALLOW_HUGE_VMAP, filled with invalid instructions and then remapped as > > ROX.

Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-15 Thread Mike Rapoport
On Mon, Apr 15, 2024 at 09:52:41AM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:00:41PM +0300, Mike Rapoport wrote: > > +/** > > + * enum execmem_type - types of executable memory ranges > > + * > > + * There are several subsystems that allocate executable memory. > > + *

Re: [PATCH v4 02/25] media: i2c: imx258: Make image geometry meet sensor requirements

2024-04-15 Thread Luis Garcia
On 4/15/24 00:25, Alexander Stein wrote: > Hi, > > Am Sonntag, 14. April 2024, 22:34:40 CEST schrieb g...@luigi311.com: >> From: Dave Stevenson >> >> The output image is defined as being 4208x3118 pixels in size. >> Y_ADD_STA register was set to 0, and Y_ADD_END to 3118, giving >> 3119 lines

Re: [PATCH v4 23/25] media: i2c: imx258: Add support for reset gpio

2024-04-15 Thread Luis Garcia
On 4/15/24 10:00, Tommaso Merciai wrote: > Hi Luis, > > On Sun, Apr 14, 2024 at 02:35:01PM -0600, g...@luigi311.com wrote: >> From: Luis Garcia >> >> It was documented in DT, but not implemented. > > Good catch :-) > >> >> Signed-off-by: Ondrej Jirman >> Signed-off-by: Luis Garcia >> --- >>

Re: [PATCH][next] dax: remove redundant assignment to variable rc

2024-04-15 Thread Alison Schofield
On Mon, Apr 15, 2024 at 11:19:28AM +0100, Colin Ian King wrote: > The variable rc is being assigned an value and then is being re-assigned > a new value in the next statement. The assignment is redundant and can > be removed. > > Cleans up clang scan build warning: > drivers/dax/bus.c:1207:2:

Re: [PATCH v4 24/25] media:i2c: imx258: Use v4l2_link_freq_to_bitmap helper

2024-04-15 Thread Luis Garcia
On 4/15/24 09:18, Tommaso Merciai wrote: > Hi Luis, > > On Sun, Apr 14, 2024 at 02:35:02PM -0600, g...@luigi311.com wrote: >> From: Luis Garcia >> >> Use the v4l2_link_freq_to_bitmap() helper to figure out which >> driver-supported link freq can be used on a given system. >> >> Signed-off-by:

Re: [PATCH v4 25/25] media: i2c: imx258: Convert to new CCI register access helpers

2024-04-15 Thread Luis Garcia
On 4/15/24 08:47, Tommaso Merciai wrote: > Hi Luis, > > On Sun, Apr 14, 2024 at 02:35:03PM -0600, g...@luigi311.com wrote: >> From: Luis Garcia >> >> Use the new comon CCI register access helpers to replace the private >> register access helpers in the imx258 driver. >> >> Signed-off-by: Luis

Re: [RFC 3/3] virtio_balloon: introduce memory scan/reclaim info

2024-04-15 Thread David Hildenbrand
On 15.04.24 10:41, zhenwei pi wrote: Expose memory scan/reclaim information to the host side via virtio balloon device. Now we have a metric to analyze the memory performance: y: counter increases n: counter does not changes h: the rate of counter change is high l: the rate of counter change

Re: [PATCH 3/4] iio: light: stk3310: log error if reading the chip id fails

2024-04-15 Thread Andy Shevchenko
On Sun, Apr 14, 2024 at 8:57 PM Aren Moynihan wrote: > > If the chip isn't powered, this call is likely to return an error. > Without a log here the driver will silently fail to probe. Common errors > are ENXIO (when the chip isn't powered) and ETIMEDOUT (when the i2c bus > isn't powered). >

Re: [RFC 2/3] virtio_balloon: introduce memory allocation stall counter

2024-04-15 Thread David Hildenbrand
On 15.04.24 10:41, zhenwei pi wrote: Memory allocation stall counter represents the performance/latency of memory allocation, expose this counter to the host side by virtio balloon device via out-of-bound way. Signed-off-by: zhenwei pi --- drivers/virtio/virtio_balloon.c | 19

Re: [RFC 1/3] virtio_balloon: introduce oom-kill invocations

2024-04-15 Thread David Hildenbrand
On 15.04.24 10:41, zhenwei pi wrote: When the guest OS runs under critical memory pressure, the guest starts to kill processes. A guest monitor agent may scan 'oom_kill' from /proc/vmstat, and reports the OOM KILL event. However, the agent may be killed and we will loss this critical event(and

Re: [RFC 0/3] Improve memory statistics for virtio balloon

2024-04-15 Thread David Hildenbrand
On 15.04.24 10:41, zhenwei pi wrote: Hi, When the guest runs under critial memory pressure, the guest becomss too slow, even sshd turns D state(uninterruptible) on memory allocation. We can't login this VM to do any work on trouble shooting. Guest kernel log via virtual TTY(on host side) only

[PATCH 6.8 114/172] fs/proc: remove redundant comments from /proc/bootconfig

2024-04-15 Thread Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know. -- From: Zhenhua Huang commit fbbdc255fbee59b4207a5398fdb4f04590681a79 upstream. commit 717c7c894d4b ("fs/proc: Add boot loader arguments as comment to /proc/bootconfig") adds bootloader argument

Re: [PATCH] openrisc: Use do_kernel_power_off()

2024-04-15 Thread Stafford Horne
On Sun, Apr 14, 2024 at 07:52:03PM +0200, Sebastian Reichel wrote: > Hi, > > On Sun, Mar 31, 2024 at 08:02:28AM +0100, Stafford Horne wrote: > > After commit 14c5678720bd ("power: reset: syscon-poweroff: Use > > devm_register_sys_off_handler(POWER_OFF)") setting up of pm_power_off > > was removed

Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-15 Thread Andy Shevchenko
On Sun, Apr 14, 2024 at 8:57 PM Aren Moynihan wrote: > > From: Ondrej Jirman > > VDD power input can be used to completely power off the chip during > system suspend. Do so if available. ... > #include > #include > #include > +#include Move it to be ordered and add a blank line to

Re: [PATCH v11 06/14] x86/sgx: Add sgx_epc_lru_list to encapsulate LRU list

2024-04-15 Thread Huang, Kai
On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > From: Sean Christopherson > > Introduce a data structure to wrap the existing reclaimable list and its > spinlock. Each cgroup later will have one instance of this structure to > track EPC pages allocated for processes associated with the

Re: [PATCH v11 04/14] cgroup/misc: Add SGX EPC resource type

2024-04-15 Thread Huang, Kai
On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > From: Kristen Carlson Accardi > > Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type > for the misc controller. > > Signed-off-by: Kristen Carlson Accardi > Co-developed-by: Haitao Huang > Signed-off-by: Haitao Huang

Re: [PATCH v11 03/14] cgroup/misc: Export APIs for SGX driver

2024-04-15 Thread Huang, Kai
On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > From: Kristen Carlson Accardi > > The SGX EPC cgroup will reclaim EPC pages when usage in a cgroup reaches > its or ancestor's limit. This requires a walk from the current cgroup up > to the root similar to misc_cg_try_charge(). Export

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

2024-04-15 Thread Huang, Kai
On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > From: Kristen Carlson Accardi > > The misc cgroup controller (subsystem) currently does not perform > resource type specific action for Cgroups Subsystem State (CSS) events: > the 'css_alloc' event when a cgroup is created and the

Re: [PATCH v11 01/14] x86/sgx: Replace boolean parameters with enums

2024-04-15 Thread Huang, Kai
On Wed, 2024-04-10 at 11:25 -0700, Haitao Huang wrote: > Replace boolean parameters for 'reclaim' in the function > sgx_alloc_epc_page() and its callers with an enum. > > Also opportunistically remove non-static declaration of > __sgx_alloc_epc_page() and a typo > > Signed-off-by: Haitao Huang

[PATCH net-next v2 07/15] mm: page_frag: add '_va' suffix to page_frag API

2024-04-15 Thread Yunsheng Lin
Currently most of the API for page_frag API is returning 'virtual address' as output or expecting 'virtual address' as input, in order to differentiate the API handling between 'virtual address' and 'struct page', add '_va' suffix to the corresponding API mirroring the page_pool_alloc_va() API of

[PATCH v9 36/36] fgraph: Skip recording calltime/rettime if it is not nneeded

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Skip recording calltime and rettime if the fgraph_ops does not need it. This is a kind of performance optimization for fprobe. Since the fprobe user does not use these entries, recording timestamp in fgraph is just a overhead (e.g. eBPF, ftrace). So introduce the

[PATCH v9 35/36] Documentation: probes: Update fprobe on function-graph tracer

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Update fprobe documentation for the new fprobe on function-graph tracer. This includes some bahvior changes and pt_regs to ftrace_regs interface change. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Update @fregs parameter explanation. ---

[PATCH v9 34/36] selftests/ftrace: Add a test case for repeating register/unregister fprobe

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) This test case repeats define and undefine the fprobe dynamic event to ensure that the fprobe does not cause any issue with such operations. Signed-off-by: Masami Hiramatsu (Google) --- .../test.d/dynevent/add_remove_fprobe_repeat.tc| 19

[PATCH v9 33/36] selftests: ftrace: Remove obsolate maxactive syntax check

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the fprobe event does not support maxactive anymore, stop testing the maxactive syntax error checking. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc |4 +--- 1 file changed, 1 insertion(+), 3

[PATCH v9 32/36] tracing/fprobe: Remove nr_maxactive from fprobe

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Remove depercated fprobe::nr_maxactive. This involves fprobe events to rejects the maxactive number. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Newly added. --- include/linux/fprobe.h |2 -- kernel/trace/trace_fprobe.c | 44

[PATCH v9 31/36] fprobe: Rewrite fprobe on function-graph tracer

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Rewrite fprobe implementation on function-graph tracer. Major API changes are: - 'nr_maxactive' field is deprecated. - This depends on CONFIG_DYNAMIC_FTRACE_WITH_ARGS or !CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS, and CONFIG_HAVE_FUNCTION_GRAPH_FREGS. So

[PATCH v9 30/36] ftrace: Add CONFIG_HAVE_FTRACE_GRAPH_FUNC

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add CONFIG_HAVE_FTRACE_GRAPH_FUNC kconfig in addition to ftrace_graph_func macro check. This is for the other feature (e.g. FPROBE) which requires to access ftrace_regs from fgraph_ops::entryfunc() can avoid compiling if the fgraph can not pass the valid

[PATCH v9 29/36] bpf: Enable kprobe_multi feature if CONFIG_FPROBE is enabled

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Enable kprobe_multi feature if CONFIG_FPROBE is enabled. The pt_regs is converted from ftrace_regs by ftrace_partial_regs(), thus some registers may always returns 0. But it should be enough for function entry (access arguments) and exit (access return value).

[PATCH v9 28/36] tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Allow fprobe events to be enabled with CONFIG_DYNAMIC_FTRACE_WITH_ARGS. With this change, fprobe events mostly use ftrace_regs instead of pt_regs. Note that if the arch doesn't enable HAVE_PT_REGS_COMPAT_FTRACE_REGS, fprobe events will not be able to be used from

[PATCH v9 27/36] tracing: Add ftrace_fill_perf_regs() for perf event

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_fill_perf_regs() which should be compatible with the perf_fetch_caller_regs(). In other words, the pt_regs returned from the ftrace_fill_perf_regs() must satisfy 'user_mode(regs) == false' and can be used for stack tracing. Signed-off-by: Masami

[PATCH v9 26/36] tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs. This is for the eBPF which needs this to keep the same pt_regs interface to access registers. Thus when replacing the pt_regs with ftrace_regs in fprobes (which is used by kprobe_multi eBPF

[PATCH v9 25/36] fprobe: Use ftrace_regs in fprobe exit handler

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Change the fprobe exit handler to use ftrace_regs structure instead of pt_regs. This also introduce HAVE_PT_REGS_TO_FTRACE_REGS_CAST which means the ftrace_regs's memory layout is equal to the pt_regs so that those are able to cast. Fprobe introduces a new

[PATCH v9 24/36] fprobe: Use ftrace_regs in fprobe entry handler

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) This allows fprobes to be available with CONFIG_DYNAMIC_FTRACE_WITH_ARGS instead of CONFIG_DYNAMIC_FTRACE_WITH_REGS, then we can enable fprobe on arm64. Signed-off-by: Masami Hiramatsu (Google) Acked-by: Florent Revest --- Changes in v6: - Keep using

[PATCH v9 23/36] function_graph: Pass ftrace_regs to retfunc

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Pass ftrace_regs to the fgraph_ops::retfunc(). If ftrace_regs is not available, it passes a NULL instead. User callback function can access some registers (including return address) via this ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in

[PATCH v9 22/36] function_graph: Replace fgraph_ret_regs with ftrace_regs

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Use ftrace_regs instead of fgraph_ret_regs for tracing return value on function_graph tracer because of simplifying the callback interface. The CONFIG_HAVE_FUNCTION_GRAPH_RETVAL is also replaced by CONFIG_HAVE_FUNCTION_GRAPH_FREGS. Signed-off-by: Masami

[PATCH v9 21/36] function_graph: Pass ftrace_regs to entryfunc

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Pass ftrace_regs to the fgraph_ops::entryfunc(). If ftrace_regs is not available, it passes a NULL instead. User callback function can access some registers (including return address) via this ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in

[PATCH v9 20/36] ftrace: Add multiple fgraph storage selftest

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add a selftest for multiple function graph tracer with storage on a same function. In this case, the shadow stack entry will be shared among those fgraph with different data storage. So this will ensure the fgraph will not mixed those storage data. Signed-off-by:

[PATCH v9 19/36] function_graph: Add selftest for passing local variables

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add boot up selftest that passes variables from a function entry to a function exit, and make sure that they do get passed around. Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Add reserved size test. -

[PATCH v9 18/36] function_graph: Implement fgraph_reserve_data() and fgraph_retrieve_data()

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Added functions that can be called by a fgraph_ops entryfunc and retfunc to store state between the entry of the function being traced to the exit of the same function. The fgraph_ops entryfunc() may call fgraph_reserve_data() to store up to 32 words onto the task's

[PATCH v9 17/36] function_graph: Move graph notrace bit to shadow stack global var

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the function graph no-trace was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt

[PATCH v9 16/36] function_graph: Move graph depth stored data to shadow stack global var

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the function graph depth was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt (VMware)

[PATCH v9 15/36] function_graph: Move set_graph_function tests to shadow stack global var

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The use of the task->trace_recursion for the logic used for the set_graph_funnction was a bit of an abuse of that variable. Now that there exists global vars that are per stack for registered graph traces, use that instead. Signed-off-by: Steven Rostedt (VMware)

[PATCH v9 14/36] function_graph: Add "task variables" per task for fgraph_ops

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add a "task variables" array on the tasks shadow ret_stack that is the size of longs for each possible registered fgraph_ops. That's a total of 16, taking up 8 * 16 = 128 bytes (out of a page size 4k). This will allow for fgraph_ops to do specific features on a per

[PATCH v9 13/36] function_graph: Use a simple LRU for fgraph_array index number

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Since the fgraph_array index is used for the bitmap on the shadow stack, it may leave some entries after a function_graph instance is removed. Thus if another instance reuses the fgraph_array index soon after releasing it, the fgraph may confuse to call the newer

[PATCH v9 12/36] function_graph: Have the instances use their own ftrace_ops for filtering

2024-04-15 Thread Masami Hiramatsu (Google)
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 instance. Note that this also requires to update ftrace_graph_func() to call new

[PATCH v9 11/36] ftrace: Allow ftrace startup flags exist without dynamic ftrace

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Some of the flags for ftrace_startup() may be exposed even when CONFIG_DYNAMIC_FTRACE is not configured in. This is fine as the difference between dynamic ftrace and static ftrace is done within the internals of ftrace itself. No need to have use cases fail to

[PATCH v9 10/36] ftrace: Allow function_graph tracer to be enabled in instances

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Now that function graph tracing can handle more than one user, allow it to be enabled in the ftrace instances. Note, the filtering of the functions is still joined by the top level set_ftrace_filter and friends, as well as the graph and nograph files.

[PATCH v9 09/36] ftrace/function_graph: Pass fgraph_ops to function graph callbacks

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Pass the fgraph_ops structure to the function graph callbacks. This will allow callbacks to add a descriptor to a fgraph_ops private field that wil be added in the future and use it for the callbacks. This will be useful when more than one callback can be registered

[PATCH v9 08/36] function_graph: Remove logic around ftrace_graph_entry and return

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) The function pointers ftrace_graph_entry and ftrace_graph_return are no longer called via the function_graph tracer. Instead, an array structure is now used that will allow for multiple users of the function_graph infrastructure. The variables are still used by the

[PATCH v9 07/36] function_graph: Allow multiple users to attach to function graph

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Allow for multiple users to attach to function graph tracer at the same time. Only 16 simultaneous users can attach to the tracer. This is because there's an array that stores the pointers to the attached fgraph_ops. When a function being traced is entered, each of

[PATCH v9 06/36] function_graph: Add an array structure that will allow multiple callbacks

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Add an array structure that will eventually allow the function graph tracer to have up to 16 simultaneous callbacks attached. It's an array of 16 fgraph_ops pointers, that is assigned when one is registered. On entry of a function the entry of the first item in the

[PATCH v9 05/36] fgraph: Use BUILD_BUG_ON() to make sure we have structures divisible by long

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) Instead of using "ALIGN()", use BUILD_BUG_ON() as the structures should always be divisible by sizeof(long). Link: http://lkml.kernel.org/r/2019052444.gi2...@hirez.programming.kicks-ass.net Suggested-by: Peter Zijlstra Signed-off-by: Steven Rostedt (VMware)

[PATCH AUTOSEL 6.6 03/12] bpf: put uprobe link's path and task in release callback

2024-04-15 Thread Sasha Levin
From: Andrii Nakryiko [ Upstream commit e9c856cabefb71d47b2eeb197f72c9c88e9b45b0 ] There is no need to delay putting either path or task to deallocation step. It can be done right after bpf_uprobe_unregister. Between release and dealloc, there could be still some running BPF programs, but they

[PATCH v9 04/36] function_graph: Convert ret_stack to a series of longs

2024-04-15 Thread Masami Hiramatsu (Google)
From: Steven Rostedt (VMware) In order to make it possible to have multiple callbacks registered with the function_graph tracer, the retstack needs to be converted from an array of ftrace_ret_stack structures to an array of longs. This will allow to store the list of callbacks on the stack for

[PATCH v9 03/36] x86: tracing: Add ftrace_regs definition in the header

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Add ftrace_regs definition for x86_64 in the ftrace header to clarify what register will be accessible from ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Add rip to be saved. Changes in v2: - Newly added. ---

[PATCH v9 02/36] tracing: Rename ftrace_regs_return_value to ftrace_regs_get_return_value

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Rename ftrace_regs_return_value to ftrace_regs_get_return_value as same as other ftrace_regs_get/set_* APIs. Signed-off-by: Masami Hiramatsu (Google) Acked-by: Mark Rutland --- Changes in v6: - Moved to top of the series. Changes in v3: - Newly added. ---

[PATCH v9 01/36] tracing: Add a comment about ftrace_regs definition

2024-04-15 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) To clarify what will be expected on ftrace_regs, add a comment to the architecture independent definition of the ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) Acked-by: Mark Rutland --- Changes in v8: - Update that the saved registers depends on the

[PATCH AUTOSEL 6.8 03/15] bpf: put uprobe link's path and task in release callback

2024-04-15 Thread Sasha Levin
From: Andrii Nakryiko [ Upstream commit e9c856cabefb71d47b2eeb197f72c9c88e9b45b0 ] There is no need to delay putting either path or task to deallocation step. It can be done right after bpf_uprobe_unregister. Between release and dealloc, there could be still some running BPF programs, but they

[PATCH v9 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-04-15 Thread Masami Hiramatsu (Google)
Hi, Here is the 9th version of the series to re-implement the fprobe on function-graph tracer. The previous version is; https://lore.kernel.org/all/170887410337.564249.6360118840946697039.stgit@devnote2/ This version is ported on the latest kernel (v6.9-rc3 + probes/for-next) and fixed some

Re: [ANNOUNCE] 5.10.213-rt105

2024-04-15 Thread Luis Claudio R. Goncalves
On Mon, Apr 15, 2024 at 09:56:27AM +0200, Pavel Machek wrote: > Hi! > > > I'm pleased to announce the 5.10.213-rt105 stable release. > > > > This release is an update to the new stable 5.10.213 version and no extra > > changes have been performed. > > Thanks for release. > > I see

Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-15 Thread Peter Zijlstra
On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > To populate the cache, a writable large page is allocated from vmalloc with > VM_ALLOW_HUGE_VMAP, filled with invalid instructions and then remapped as > ROX. > +static void execmem_invalidate(void *ptr, size_t size, bool writable)

  1   2   >