Re: [PATCH RFC v3 03/35] mm: page_alloc: Add an arch hook to filter MIGRATE_CMA allocations

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > As an architecture might have specific requirements around the allocation > of CMA pages, add an arch hook that can disable allocations from > MIGRATE_CMA, if the allocation was otherwise allowed. > > This will be used by arm64, which will put tag

WARNING in shmem_release_dquot

2024-01-29 Thread Ubisectech Sirius
Hello. We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.8.0-rc1-gecb1b8288dc7. Attached to the email were a POC file of the issue. Stack dump: [ 246.195553][ T4096] [ cut here ] [

Re: [PATCH RFC v3 02/35] mm: page_alloc: Add an arch hook early in free_pages_prepare()

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > The arm64 MTE code uses the PG_arch_2 page flag, which it renames to > PG_mte_tagged, to track if a page has been mapped with tagging enabled. > That flag is cleared by free_pages_prepare() by doing: > > page->flags &=

[linus:master] [tracing] bb32500fb9: BUG:KASAN:slab-use-after-free_in_tracing_open_file_tr

2024-01-29 Thread kernel test robot
c fc fc fc fc fc fc [ 108.210854][ T2177] == [ 108.211632][ T2177] Disabling lock debugging due to kernel taint The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20240129/202401291521.1322c280-oliver.s...@intel.com

Re: [PATCH RFC v3 04/35] mm: page_alloc: Partially revert "mm: page_alloc: remove stale CMA guard code"

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > The patch f945116e4e19 ("mm: page_alloc: remove stale CMA guard code") > removed the CMA filter when allocating from the MIGRATE_MOVABLE pcp list > because CMA is always allowed when __GFP_MOVABLE is set. > > With the introduction of the

Re: [PATCH RFC v3 05/35] mm: cma: Don't append newline when generating CMA area name

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > cma->name is displayed in several CMA messages. When the name is generated > by the CMA code, don't append a newline to avoid breaking the text across > two lines. An example of such mis-formatted CMA output from dmesg could be added here in the

Re: [PATCH v3 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-01-29 Thread Huacai Chen
Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: > > On LoongArch system, ipi hw uses iocsr registers, there is one iocsr > register access on ipi sender and two iocsr access on ipi receiver > which is ipi interrupt handler. On VM mode all iocsr registers > accessing will trap into

Re: [PATCH v3 5/6] LoongArch: KVM: Add physical cpuid map support

2024-01-29 Thread Huacai Chen
Hi, Bibo, Without this patch I can also create a SMP VM, so what problem does this patch want to solve? Huacai On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: > > Physical cpuid is used to irq routing for irqchips such as ipi/msi/ > extioi interrupt controller. And physical cpuid is stored at

[PATCH 3/3] remoteproc: qcom_q6v5_pas: Unload lite firmware on ADSP

2024-01-29 Thread Abel Vesa
From: Sibi Sankar The UEFI loads a lite variant of the ADSP firmware to support charging use cases. The kernel needs to unload and reload it with the firmware that has full feature support for audio. This patch arbitarily shutsdown the lite firmware before loading the full firmware.

Re: [PATCH 3/3] remoteproc: qcom_q6v5_pas: Unload lite firmware on ADSP

2024-01-29 Thread Dmitry Baryshkov
On Mon, 29 Jan 2024 at 15:35, Abel Vesa wrote: > > From: Sibi Sankar > > The UEFI loads a lite variant of the ADSP firmware to support charging > use cases. The kernel needs to unload and reload it with the firmware > that has full feature support for audio. This patch arbitarily shutsdown > the

Re: [PATCH RFC v3 11/35] mm: Allow an arch to hook into folio allocation when VMA is known

2024-01-29 Thread Alexandru Elisei
Hi Peter, On Fri, Jan 26, 2024 at 12:00:36PM -0800, Peter Collingbourne wrote: > On Thu, Jan 25, 2024 at 8:43 AM Alexandru Elisei > wrote: > > > > arm64 uses VM_HIGH_ARCH_0 and VM_HIGH_ARCH_1 for enabling MTE for a VMA. > > When VM_HIGH_ARCH_0, which arm64 renames to VM_MTE, is set for a VMA,

Re: [PATCH v3 1/6] LoongArch/smp: Refine ipi ops on LoongArch platform

2024-01-29 Thread Huacai Chen
Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: > > This patch refines ipi handling on LoongArch platform, there are > three changes with this patch. > 1. Add generic get_percpu_irq api, replace some percpu irq function > such as get_ipi_irq/get_pmc_irq/get_timer_irq with

[PATCH v13 1/6] ring-buffer: Zero ring-buffer sub-buffers

2024-01-29 Thread Vincent Donnefort
In preparation for the ring-buffer memory mapping where each subbuf will be accessible to user-space, zero all the page allocations. Signed-off-by: Vincent Donnefort Reviewed-by: Masami Hiramatsu (Google) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index

[PATCH v13 2/6] ring-buffer: Introducing ring-buffer mapping functions

2024-01-29 Thread Vincent Donnefort
In preparation for allowing the user-space to map a ring-buffer, add a set of mapping functions: ring_buffer_{map,unmap}() ring_buffer_map_fault() And controls on the ring-buffer: ring_buffer_map_get_reader() /* swap reader and head */ Mapping the ring-buffer also involves: A unique

[PATCH v13 3/6] tracing: Add snapshot refcount

2024-01-29 Thread Vincent Donnefort
When a ring-buffer is memory mapped by user-space, no trace or ring-buffer swap is possible. This means the snapshot feature is mutually exclusive with the memory mapping. Having a refcount on snapshot users will help to know if a mapping is possible or not. Signed-off-by: Vincent Donnefort

[PATCH v13 4/6] tracing: Allow user-space mapping of the ring-buffer

2024-01-29 Thread Vincent Donnefort
Currently, user-space extracts data from the ring-buffer via splice, which is handy for storage or network sharing. However, due to splice limitations, it is imposible to do real-time analysis without a copy. A solution for that problem is to let the user-space map the ring-buffer directly. The

[PATCH v13 5/6] Documentation: tracing: Add ring-buffer mapping

2024-01-29 Thread Vincent Donnefort
It is now possible to mmap() a ring-buffer to stream its content. Add some documentation and a code example. Signed-off-by: Vincent Donnefort diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst index 5092d6c13af5..0b300901fd75 100644 --- a/Documentation/trace/index.rst

[PATCH v13 0/6] Introducing trace buffer mapping by user-space

2024-01-29 Thread Vincent Donnefort
The tracing ring-buffers can be stored on disk or sent to network without any copy via splice. However the later doesn't allow real time processing of the traces. A solution is to give userspace direct access to the ring-buffer pages via a mapping. An application can now become a consumer of the

Re: Re: [RFC PATCH] rpmsg: glink: Add bounds check on tx path

2024-01-29 Thread Michal Koutný
On Mon, Jan 29, 2024 at 04:18:36PM +0530, Deepak Kumar Singh wrote: > There is already a patch posted for similar problem - > https://lore.kernel.org/all/20231201110631.669085-1-quic_dee...@quicinc.com/ I was not aware, thanks for the pointer. Do you plan to update your patch to "just"

[PATCH 2/3] remoteproc: qcom_q6v5_pas: Add support for X1E80100 ADSP/CDSP

2024-01-29 Thread Abel Vesa
From: Sibi Sankar Add support for PIL loading on ADSP and CDSP on X1E80100 SoCs. Signed-off-by: Sibi Sankar Signed-off-by: Abel Vesa --- drivers/remoteproc/qcom_q6v5_pas.c | 41 ++ 1 file changed, 41 insertions(+) diff --git

[PATCH 0/3] remoteproc: qcom_q6v5_pas: Add aDSP and cDSP for X1E80100

2024-01-29 Thread Abel Vesa
Signed-off-by: Abel Vesa --- Abel Vesa (1): dt-bindings: remoteproc: qcom,sm8550-pas: document the X1E80100 aDSP & cDSP Sibi Sankar (2): remoteproc: qcom_q6v5_pas: Add support for X1E80100 ADSP/CDSP remoteproc: qcom_q6v5_pas: Unload lite firmware on ADSP

[PATCH 1/3] dt-bindings: remoteproc: qcom,sm8550-pas: document the X1E80100 aDSP & cDSP

2024-01-29 Thread Abel Vesa
Document the aDSP and cDSP Peripheral Authentication Service on the X1E80100 Platform. Signed-off-by: Abel Vesa --- Documentation/devicetree/bindings/remoteproc/qcom,sm8550-pas.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git

Re: [PATCH 2/3] remoteproc: qcom_q6v5_pas: Add support for X1E80100 ADSP/CDSP

2024-01-29 Thread Dmitry Baryshkov
On Mon, 29 Jan 2024 at 15:35, Abel Vesa wrote: > > From: Sibi Sankar > > Add support for PIL loading on ADSP and CDSP on X1E80100 SoCs. > > Signed-off-by: Sibi Sankar > Signed-off-by: Abel Vesa > --- > drivers/remoteproc/qcom_q6v5_pas.c | 41 > ++ > 1 file

Re: [PATCH RFC v3 07/35] mm: cma: Add CMA_RELEASE_{SUCCESS,FAIL} events

2024-01-29 Thread Alexandru Elisei
Hi, On Mon, Jan 29, 2024 at 03:01:24PM +0530, Anshuman Khandual wrote: > > > On 1/25/24 22:12, Alexandru Elisei wrote: > > Similar to the two events that relate to CMA allocations, add the > > CMA_RELEASE_SUCCESS and CMA_RELEASE_FAIL events that count when CMA pages > > are freed. > > How is

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Sun, 28 Jan 2024 20:36:12 -0800 Linus Torvalds wrote: > End result: the d_instantiate() needs to be done *after* the inode has > been fully filled in. > > Alternatively, you could > > (a) not drop the eventfs_mutex around the create_dir() call > > (b) take the eventfs_mutex around all

Re: [PATCH 2/4] tracing/user_events: Introduce multi-format events

2024-01-29 Thread Beau Belgrave
On Fri, Jan 26, 2024 at 03:04:45PM -0500, Steven Rostedt wrote: > On Fri, 26 Jan 2024 11:10:07 -0800 > Beau Belgrave wrote: > > > > OK, so the each different event has suffixed name. But this will > > > introduce non C-variable name. > > > > > > Steve, do you think your library can handle these

Re: [PATCH 4/4] modules: Add missing entry for __ex_table

2024-01-29 Thread Luis Chamberlain
On Wed, Nov 22, 2023 at 11:18:14PM +0100, del...@kernel.org wrote: > From: Helge Deller > > The entry for __ex_table was missing, which may make __ex_table > become 1- or 2-byte aligned in modules. > Add the entry to ensure it gets 32-bit aligned. > > Signed-off-by: Helge Deller > Cc: # v6.0+

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 12:51:59 -0800 Linus Torvalds wrote: > [0001-tracefs-remove-stale-update_gid-code.patch text/x-patch (2612 bytes)] Oh, I already applied this and even sent you a pull request with it. https://lore.kernel.org/all/20240128223151.2dad6...@rorschach.local.home/ -- Steve

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 13:45, Steven Rostedt wrote: > > 1 file changed, 50 insertions(+), 219 deletions(-) > > Thanks, much appreciated. Well, I decided I might as well give it a test-run, and there's an immediate deadlock on eventfs_mutex, because I missed removing it from

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 14:35:37 -0800 Linus Torvalds wrote: > And I hope there aren't any other stupid things I missed like that. Well the preliminary tests pass with this added to your patch: diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index cd6de322..ad11063bdd53 100644

Re: [PATCH v4 2/2] remoteproc: enhance rproc_put() for clusters

2024-01-29 Thread Tanmay Shah
On 1/26/24 11:38 AM, Bjorn Andersson wrote: > On Wed, Jan 03, 2024 at 02:11:25PM -0800, Tanmay Shah wrote: > > This patch enhances rproc_put() to support remoteproc clusters > > with multiple child nodes as in rproc_get_by_phandle(). > > > > Signed-off-by: Tarak Reddy > > Signed-off-by: Tanmay

Re: [RESEND PATCH v2] modules: wait do_free_init correctly

2024-01-29 Thread Luis Chamberlain
On Mon, Jan 29, 2024 at 10:03:04AM +0800, Changbin Du wrote: > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > do_free_init() into a global workqueue instead of call_rcu(). So now > rcu_barrier() can not ensure that do_free_init has completed. We should > wait it via

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 11:24, Linus Torvalds wrote: > > So the patch was completely broken. Here's the one that should > actually compile (although still not actually *tested*). Note that this fixes the d_instantiate() ordering wrt initializing the inode. But as I look up the call chain, I see

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-29 Thread Luis Chamberlain
On Thu, Dec 21, 2023 at 10:02:46AM +0100, Christophe Leroy wrote: > Declaring rodata_enabled and mark_rodata_ro() at all time > helps removing related #ifdefery in C files. > > Signed-off-by: Christophe Leroy Very nice cleanup, thanks!, applied and pushed Luis

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 12:51:59 -0800 Linus Torvalds wrote: > End result: what simple_lookup() does is say "oh, you didn't have the > file, so it's by definition a negative dentry", and thus all it does > is to do "d_add(dentry, NULL)". > > Anyway, removing this was painful. I initially thought

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 12:25, Steven Rostedt wrote: > > > So the fundamental bug I now find is that eventfs_root_lookup() gets a > > target dentry, and for some unfathomable reason it then does > > > > ret = simple_lookup(dir, dentry, flags); > > > > on it. Which is *completely* broken,

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 12:51:59 -0800 Linus Torvalds wrote: > [0004-tracefs-dentry-lookup-crapectomy.patch text/x-patch (11761 bytes)] I had to add: diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index cd6de322..89897d934302 100644 --- a/fs/tracefs/event_inode.c +++

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 14:42:47 -0800 Linus Torvalds wrote: > @@ -324,7 +322,7 @@ static struct dentry *lookup_file(struct dentry *dentry, > ti->flags = TRACEFS_EVENT_INODE; > ti->private = NULL; // Directories have 'ei', files > not > > -

Re: [PATCH 1/3] module: Use set_memory_rox()

2024-01-29 Thread Luis Chamberlain
On Thu, Dec 21, 2023 at 08:24:23AM +0100, Christophe Leroy wrote: > A couple of architectures seem concerned about calling set_memory_ro() > and set_memory_x() too frequently and have implemented a version of > set_memory_rox(), see commit 60463628c9e0 ("x86/mm: Implement native >

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 14:35, Linus Torvalds wrote: > > So just replace all the d_instantiate() calls there with "d_add()" > instead. I think that will fix it. I can confirm that with the mutex deadlock removed and the d_add() fix, at least things *look* superficially ok. I didn't actually do

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 09:01, Steven Rostedt wrote: > > Thanks for the analysis. I have a patch that removes the dropping of the > mutex over the create_dir/file() calls, and lockdep hasn't complained about > it. > > I was going to add that to my queue for the next merge window along with > other

Re: [PATCH v2 1/4] remoteproc: Add TEE support

2024-01-29 Thread Mathieu Poirier
On Thu, Jan 18, 2024 at 11:04:30AM +0100, Arnaud Pouliquen wrote: > From: Arnaud Pouliquen > > Add a remoteproc TEE (Trusted Execution Environment) device > that will be probed by the TEE bus. If the associated Trusted > application is supported on secure part this device offers a client >

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 09:40, Linus Torvalds wrote: > > IOW, I think the right fix is really just this: Oh, for some reason I sent out the original patch I had which didn't fix the create_dir() case. So that patch was missing the important hunk that added the ti->flags =

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 11:51:52 -0800 Linus Torvalds wrote: > On Mon, 29 Jan 2024 at 11:24, Linus Torvalds > wrote: > > > > So the patch was completely broken. Here's the one that should > > actually compile (although still not actually *tested*). > > Note that this fixes the d_instantiate()

Re: [RFC PATCH 0/7] Introduce cache_is_aliasing() to fix DAX regression

2024-01-29 Thread Dan Williams
Mathieu Desnoyers wrote: > This commit introduced in v5.13 prevents building FS_DAX on 32-bit ARM, > even on ARMv7 which does not have virtually aliased dcaches: > > commit d92576f1167c ("dax: does not work correctly with virtual aliasing > caches") > > It used to work fine before: I have

Re: [PATCH] media: dt-bindings: qcom,sc7280-venus: Allow one IOMMU entry

2024-01-29 Thread Conor Dooley
minItems: 1 > maxItems: 2 > >interconnects: > > --- > base-commit: 596764183be8ebb13352b281a442a1f1151c9b06 > change-id: 20240129-sc7280-venus-bindings-6e62a99620de > > Best regards, > -- > Luca Weiss > signature.asc Description: PGP signature

[RFC PATCH 6/7] fuse: Introduce fuse_dax_is_supported()

2024-01-29 Thread Mathieu Desnoyers
Use dax_is_supported() in addition to IS_ENABLED(CONFIG_FUSE_DAX) to validate whether CONFIG_FUSE_DAX is enabled and the architecture does not have virtually aliased caches. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data

[RFC PATCH 7/7] xfs: Use dax_is_supported()

2024-01-29 Thread Mathieu Desnoyers
Use dax_is_supported() to validate whether the architecture has virtually aliased caches at mount time. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). Fixes: d92576f1167c ("dax:

[RFC PATCH 5/7] ext4: Use dax_is_supported()

2024-01-29 Thread Mathieu Desnoyers
Use dax_is_supported() to validate whether the architecture has virtually aliased caches at mount time. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). Fixes: d92576f1167c ("dax:

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 12:44:36 -0500 Steven Rostedt wrote: > On Mon, 29 Jan 2024 09:40:06 -0800 > Linus Torvalds wrote: > > > Now, I do agree that your locking is strange, and that should be fixed > > *too*, but I think the above is the "right" fix for this particular > > issue. > > Would you

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 09:40:06 -0800 Linus Torvalds wrote: > Now, I do agree that your locking is strange, and that should be fixed > *too*, but I think the above is the "right" fix for this particular > issue. Would you be OK if I did both as a "fix"? -- Steve

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 09:40, Linus Torvalds wrote: > > eventfs_create_events_dir() seems to have the same bug with ti->flags, > btw, but got the ti->private initialization right. > > Funnily enough, create_file() got this right. I don't even understand > why create_dir() did what it did. > >

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 09:44, Steven Rostedt wrote: > > On Mon, 29 Jan 2024 09:40:06 -0800 > Linus Torvalds wrote: > > > Now, I do agree that your locking is strange, and that should be fixed > > *too*, but I think the above is the "right" fix for this particular > > issue. > > Would you be OK

[PATCH v2 1/4] selftests: add new kallsyms selftests

2024-01-29 Thread Luis Chamberlain
We lack find_symbol() selftests, so add one. This let's us stress test improvements easily on find_symbol() or optimizations. It also inherently allows us to test the limits of kallsyms on Linux today. We test a pathalogical use case for kallsyms by introducing modules which are automatically

[PATCH v2 3/4] vmlinux.lds.h: add missing alignment for symbol CRCs

2024-01-29 Thread Luis Chamberlain
Commit f3304ecd7f06 (linux/export: use inline assembler to populate symbol CRCs") fixed an issue with unexpected padding by adding asm inline assembly to directly specify the desired data layout. It however forgot to add the alignment, fix that. Reported-by: Helge Deller Fixes: f3304ecd7f06

[PATCH v2 2/4] modules: Ensure 64-bit alignment on __ksymtab_* sections

2024-01-29 Thread Luis Chamberlain
From: Helge Deller On 64-bit architectures without CONFIG_HAVE_ARCH_PREL32_RELOCATIONS (e.g. ppc64, ppc64le, parisc, s390x,...) the __KSYM_REF() macro stores 64-bit pointers into the __ksymtab* sections. Make sure that those sections will be correctly aligned at module link time, otherwise

[PATCH v2 0/3] modules: few of alignment fixes

2024-01-29 Thread Luis Chamberlain
Helge Deller had written a series of patches to fix a few misalignemnt annotations in the kernel [0]. Three of these patches were tagged as being stable candidates. Because of these annotation I suggested proof of the imapact, however we did not easily have a way to verify the value / impact of

[PATCH v2 4/4] modules: Add missing entry for __ex_table

2024-01-29 Thread Luis Chamberlain
From: Helge Deller The entry for __ex_table was missing, which may make __ex_table become 1- or 2-byte aligned in modules. Add the entry to ensure it gets 32-bit aligned. Signed-off-by: Helge Deller Signed-off-by: Luis Chamberlain --- scripts/module.lds.S | 1 + 1 file changed, 1

[RFC PATCH 1/7] Introduce cache_is_aliasing() across all architectures

2024-01-29 Thread Mathieu Desnoyers
Introduce a generic way to query whether the dcache is virtually aliased on all architectures. Its purpose is to ensure that subsystems which are incompatible with virtually aliased caches (e.g. FS_DAX) can reliably query this. For dcache aliasing, there are three scenarios dependending on the

[RFC PATCH 2/7] dax: Fix incorrect list of cache aliasing architectures

2024-01-29 Thread Mathieu Desnoyers
fs/Kconfig:FS_DAX prevents DAX from building on architectures with virtually aliased dcache with: depends on !(ARM || MIPS || SPARC) This check is too broad (e.g. recent ARMv7 don't have virtually aliased dcaches), and also misses many other architectures with virtually aliased dcache. This

[RFC PATCH 4/7] ext2: Use dax_is_supported()

2024-01-29 Thread Mathieu Desnoyers
Use dax_is_supported() to validate whether the architecture has virtually aliased caches at mount time. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). Fixes: d92576f1167c ("dax:

[RFC PATCH 0/7] Introduce cache_is_aliasing() to fix DAX regression

2024-01-29 Thread Mathieu Desnoyers
This commit introduced in v5.13 prevents building FS_DAX on 32-bit ARM, even on ARMv7 which does not have virtually aliased dcaches: commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") It used to work fine before: I have customers using dax over pmem on ARMv7, but

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 14:21, Steven Rostedt wrote: > > But crashes with just a: > > # ls /sys/kernel/tracing/events > > [ 66.423983] [ cut here ] > [ 66.426447] kernel BUG at fs/dcache.c:1876! Duh. That's a bit too much copy-and-paste by me. So what is going on is

Re: [PATCH] media: dt-bindings: qcom,sc7280-venus: Allow one IOMMU entry

2024-01-29 Thread Luca Weiss
gt; >iommus: > > +minItems: 1 > > maxItems: 2 > > > >interconnects: > > > > --- > > base-commit: 596764183be8ebb13352b281a442a1f1151c9b06 > > change-id: 20240129-sc7280-venus-bindings-6e62a99620de > > > > Best regards, > > -- > > Luca Weiss > >

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 14:49, Steven Rostedt wrote: > > Now I didn't change this last d_instantiate, because this is not called > through the lookup code. This is the root events directory and acts more > like debugfs. It's not "dynamically" added. Ahh, yes, I see, the dentry was created (as a

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 16:01:25 -0800 Linus Torvalds wrote: > I'll go see what's up with the "create it again" case - I don't > immediately see what's wrong. Interesting. I added a printk in the lookup, and just did this: # cd /sys/kernel/tracing # ls events/kprobes And it showed that it tried

[PATCH v8 06/15] x86/sgx: Abstract tracking reclaimable pages in LRU

2024-01-29 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 v8 05/15] x86/sgx: Add sgx_epc_lru_list to encapsulate LRU list

2024-01-29 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 v8 08/15] x86/sgx: Implement EPC reclamation flows for cgroup

2024-01-29 Thread Haitao Huang
From: Kristen Carlson Accardi Implement the reclamation flow for cgroup, encapsulated in the top-level function sgx_epc_cgroup_reclaim_pages(). It does a pre-order walk on its subtree, and make calls to sgx_reclaim_pages() at each node passing in the LRU of that node. It keeps track of total

[PATCH v8 04/15] x86/sgx: Implement basic EPC misc cgroup functionality

2024-01-29 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 v8 07/15] x86/sgx: Expose sgx_reclaim_pages() for cgroup

2024-01-29 Thread Haitao Huang
From: Sean Christopherson Each EPC cgroup will have an LRU structure to track reclaimable EPC pages. When a cgroup usage reaches its limit, the cgroup needs to reclaim pages from its LRU or LRUs of its descendants to make room for any new allocations. To prepare for reclamation per cgroup,

[PATCH v8 02/15] cgroup/misc: Export APIs for SGX driver

2024-01-29 Thread Haitao Huang
From: Kristen Carlson Accardi The SGX EPC cgroup will reclaim EPC pages when a 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 may also

Re: [PATCH 2/4] tracing/user_events: Introduce multi-format events

2024-01-29 Thread Steven Rostedt
On Mon, 29 Jan 2024 09:29:07 -0800 Beau Belgrave wrote: > Thanks, yeah ideally we wouldn't use special characters. > > I'm not picky about this. However, I did want something that clearly > allowed a glob pattern to find all versions of a given register name of > user_events by user programs

Re: [RFC PATCH 7/7] xfs: Use dax_is_supported()

2024-01-29 Thread Dave Chinner
On Mon, Jan 29, 2024 at 04:06:31PM -0500, Mathieu Desnoyers wrote: > Use dax_is_supported() to validate whether the architecture has > virtually aliased caches at mount time. > > This is relevant for architectures which require a dynamic check > to validate whether they have virtually aliased

Re: [PATCH RFC v3 09/35] mm: cma: Introduce cma_remove_mem()

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > Memory is added to CMA with cma_declare_contiguous_nid() and > cma_init_reserved_mem(). This memory is then put on the MIGRATE_CMA list in > cma_init_reserved_areas(), where the page allocator can make use of it. cma_declare_contiguous_nid() reserves

Re: [PATCH RFC v3 08/35] mm: cma: Introduce cma_alloc_range()

2024-01-29 Thread Anshuman Khandual
On 1/25/24 22:12, Alexandru Elisei wrote: > Today, cma_alloc() is used to allocate a contiguous memory region. The > function allows the caller to specify the number of pages to allocate, but > not the starting address. cma_alloc() will walk over the entire CMA region > trying to allocate the

[PATCH v8 15/15] selftests/sgx: Add scripts for EPC cgroup testing

2024-01-29 Thread Haitao Huang
The scripts rely on cgroup-tools package from libcgroup [1]. 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: ./watch_misc_for_tests.sh current With different cgroups, the script starts one

[PATCH v8 14/15] Docs/x86/sgx: Add description for cgroup support

2024-01-29 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

Re: [PATCH net-next 2/2] tun: AF_XDP Rx zero-copy support

2024-01-29 Thread Jason Wang
On Mon, Jan 29, 2024 at 7:10 PM wangyunjian wrote: > > > -Original Message- > > From: Jason Wang [mailto:jasow...@redhat.com] > > Sent: Monday, January 29, 2024 11:05 AM > > To: wangyunjian > > Cc: m...@redhat.com; willemdebruijn.ker...@gmail.com; k...@kernel.org; > >

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 16:35, Steven Rostedt wrote: > > # echo 'p:sched schedule' >> /sys/kernel/tracing/kprobe_events > # ls -l events/kprobes/ > ls: cannot access 'events/kprobes/': No such file or directory > > Where it should now exist but doesn't. But the lookup code never triggered. > >

[PATCH v8 00/15] Add Cgroup support for SGX EPC memory

2024-01-29 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

[PATCH v8 01/15] cgroup/misc: Add per resource callbacks for CSS events

2024-01-29 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

Re: [PATCH 0/4] tracing/user_events: Introduce multi-format events

2024-01-29 Thread Google
Hi Beau, On Tue, 23 Jan 2024 22:08:40 + Beau Belgrave wrote: > Currently user_events supports 1 event with the same name and must have > the exact same format when referenced by multiple programs. This opens > an opportunity for malicous or poorly thought through programs to > create events

[PATCH v8 03/15] cgroup/misc: Add SGX EPC resource type

2024-01-29 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 --- V6: - Split the original patch into

Re: [PATCH v3 1/6] LoongArch/smp: Refine ipi ops on LoongArch platform

2024-01-29 Thread maobibo
On 2024/1/29 下午8:38, Huacai Chen wrote: Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: This patch refines ipi handling on LoongArch platform, there are three changes with this patch. 1. Add generic get_percpu_irq api, replace some percpu irq function such as

Re: [PATCH RFC v3 23/35] arm64: mte: Try to reserve tag storage in arch_alloc_page()

2024-01-29 Thread Peter Collingbourne
On Thu, Jan 25, 2024 at 8:45 AM Alexandru Elisei wrote: > > Reserve tag storage for a page that is being allocated as tagged. This > is a best effort approach, and failing to reserve tag storage is > allowed. > > When all the associated tagged pages have been freed, return the tag > storage pages

Re: [RESEND PATCH v2] modules: wait do_free_init correctly

2024-01-29 Thread Changbin Du
On Mon, Jan 29, 2024 at 09:53:58AM -0800, Luis Chamberlain wrote: > On Mon, Jan 29, 2024 at 10:03:04AM +0800, Changbin Du wrote: > > The commit 1a7b7d922081 ("modules: Use vmalloc special flag") moves > > do_free_init() into a global workqueue instead of call_rcu(). So now > > rcu_barrier() can

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Linus Torvalds
On Mon, 29 Jan 2024 at 17:50, Linus Torvalds wrote: > > So what I propose is that > > - ei->dentry and ei->d_children[] need to die. Really. They are > buggy. There is no way to save them. There never was. > > - but we *can* introduce a new 'ei->events_dir' pointer that is > *only* set by

Re: [PATCH RFC v3 01/35] mm: page_alloc: Add gfp_flags parameter to arch_alloc_page()

2024-01-29 Thread Anshuman Khandual
On 1/29/24 17:11, Alexandru Elisei wrote: > Hi, > > On Mon, Jan 29, 2024 at 11:18:59AM +0530, Anshuman Khandual wrote: >> On 1/25/24 22:12, Alexandru Elisei wrote: >>> Extend the usefulness of arch_alloc_page() by adding the gfp_flags >>> parameter. >> Although the change here is harmless in

Re: [PATCH RFC v3 04/35] mm: page_alloc: Partially revert "mm: page_alloc: remove stale CMA guard code"

2024-01-29 Thread Anshuman Khandual
On 1/29/24 17:16, Alexandru Elisei wrote: > Hi, > > On Mon, Jan 29, 2024 at 02:31:23PM +0530, Anshuman Khandual wrote: >> >> >> On 1/25/24 22:12, Alexandru Elisei wrote: >>> The patch f945116e4e19 ("mm: page_alloc: remove stale CMA guard code") >>> removed the CMA filter when allocating from

Re: [RFC PATCH 2/2] x86/kprobes: boost more instructions from grp2/3/4/5

2024-01-29 Thread Google
On Sun, 28 Jan 2024 15:30:50 -0600 Jinghao Jia wrote: > > > On 1/27/24 20:22, Masami Hiramatsu (Google) wrote: > > On Fri, 26 Jan 2024 22:41:24 -0600 > > Jinghao Jia wrote: > > > >> With the instruction decoder, we are now able to decode and recognize > >> instructions with opcode

Re: [RFC PATCH 1/2] x86/kprobes: Prohibit kprobing on INT and UD

2024-01-29 Thread Google
On Sun, 28 Jan 2024 15:25:59 -0600 Jinghao Jia wrote: > >> /* Check if paddr is at an instruction boundary */ > >> static int can_probe(unsigned long paddr) > >> { > >> @@ -294,6 +310,16 @@ static int can_probe(unsigned long paddr) > >> #endif > >>addr += insn.length; > >>} >

Re: [PATCH v3 6/6] LoongArch: Add pv ipi support on LoongArch system

2024-01-29 Thread maobibo
On 2024/1/29 下午9:10, Huacai Chen wrote: Hi, Bibo, On Mon, Jan 22, 2024 at 6:03 PM Bibo Mao wrote: On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi sender and two iocsr access on ipi receiver which is ipi interrupt handler. On VM mode all iocsr

Re: [PATCH v3 5/6] LoongArch: KVM: Add physical cpuid map support

2024-01-29 Thread maobibo
On 2024/1/29 下午9:11, Huacai Chen wrote: Hi, Bibo, Without this patch I can also create a SMP VM, so what problem does this patch want to solve? With ipi irqchip, physical cpuid is used for dest cpu rather than logical cpuid. And if ipi device is emulated in qemu side, there is

Re: [PATCH RFC v3 06/35] mm: cma: Make CMA_ALLOC_SUCCESS/FAIL count the number of pages

2024-01-29 Thread Anshuman Khandual
On 1/29/24 17:21, Alexandru Elisei wrote: > Hi, > > On Mon, Jan 29, 2024 at 02:54:20PM +0530, Anshuman Khandual wrote: >> >> >> On 1/25/24 22:12, Alexandru Elisei wrote: >>> The CMA_ALLOC_SUCCESS, respectively CMA_ALLOC_FAIL, are increased by one >>> after each cma_alloc() function call. This

Re: [linus:master] [eventfs] 852e46e239: BUG:unable_to_handle_page_fault_for_address

2024-01-29 Thread Al Viro
On Sun, Jan 28, 2024 at 08:36:12PM -0800, Linus Torvalds wrote: [snip] apologies for being MIA on that, will post tomorrow morning once I get some sleep...

[PATCH v8 10/15] x86/sgx: Add EPC reclamation in cgroup try_charge()

2024-01-29 Thread Haitao Huang
From: Kristen Carlson Accardi When the EPC usage of a cgroup is near its limit, the cgroup needs to reclaim pages used in the same cgroup to make room for new allocations. This is analogous to the behavior that the global reclaimer is triggered when the global usage is close to total available

[PATCH v8 09/15] x86/sgx: Charge mem_cgroup for per-cgroup reclamation

2024-01-29 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:

[PATCH v8 11/15] x86/sgx: Abstract check for global reclaimable pages

2024-01-29 Thread Haitao Huang
From: Kristen Carlson Accardi To determine if any page available for reclamation at the global level, only checking for emptiness of the global LRU is not adequate when pages are tracked in multiple LRUs, one per cgroup. For this purpose, create a new helper, sgx_can_reclaim(), currently only

[PATCH v8 12/15] x86/sgx: Expose sgx_epc_cgroup_reclaim_pages() for global reclaimer

2024-01-29 Thread Haitao Huang
From: Kristen Carlson Accardi When cgroup is enabled, all reclaimable pages will be tracked in cgroup LRUs. The global reclaimer needs to start reclamation from the root cgroup. Expose the top level cgroup reclamation function so the global reclaimer can reuse it. Co-developed-by: Sean

  1   2   >