Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-26 Thread Daniel Verkamp
On Mon, Mar 25, 2024 at 2:11 AM David Hildenbrand wrote: > > On 25.03.24 07:08, Xuan Zhuo wrote: > > On Fri, 22 Mar 2024 22:02:27 +0100, David Hildenbrand > > wrote: > >> On 22.03.24 20:16, Daniel Verkamp wrote: > >>> On Thu, Mar 21, 2024 at 3:16 AM Xuan Zhuo > >>> wrote: > > Current

Re: [PATCH 1/1] arch/um: fix forward declaration for vmalloc

2024-03-26 Thread SeongJae Park
On Tue, 26 Mar 2024 00:37:50 -0700 Suren Baghdasaryan wrote: > Patch [1] replaced vmalloc() function with a new definition but it did > not adjust the forward declaration used in UML architecture. Change it > to act as before. > Note that this prevents the vmalloc() allocations in __wrap_malloc()

Re: [PATCH v3 0/9] um: Minor fixes and cleanups

2024-03-26 Thread Tiwei Bie
On 3/26/24 10:16 PM, Lucas De Marchi wrote: > On Tue, Mar 26, 2024 at 08:27:25PM +0800, Tiwei Bie wrote: >> Hi, >> >> Gentle ping.. Please take a look at this series if possible. The changes >> in this series are very straightforward, so it shouldn't require much effort >> to review. But they cover

Re: [PATCH 2/7] of: Create of_root if no dtb provided by firmware

2024-03-26 Thread Saurabh Singh Sengar
On Fri, Feb 16, 2024 at 05:05:51PM -0800, Frank Rowand wrote: > When enabling CONFIG_OF on a platform where 'of_root' is not populated > by firmware, we end up without a root node. In order to apply overlays > and create subnodes of the root node, we need one. Create this root node > by unflattenin

Re: [PATCH v3 8/9] um: Fix -Wmissing-prototypes warnings for text_poke*

2024-03-26 Thread Tiwei Bie
On 3/26/24 10:13 PM, Lucas De Marchi wrote: > On Wed, Mar 06, 2024 at 06:19:24PM +0800, Tiwei Bie wrote: >> The prototypes for text_poke* are declared in asm/text-patching.h >> under arch/x86/include/. It's safe to include this header, as it's >> UML-aware (by checking CONFIG_UML_X86). > > but wou

Re: [PATCH v3 0/9] um: Minor fixes and cleanups

2024-03-26 Thread Lucas De Marchi
On Tue, Mar 26, 2024 at 08:27:25PM +0800, Tiwei Bie wrote: Hi, Gentle ping.. Please take a look at this series if possible. The changes in this series are very straightforward, so it shouldn't require much effort to review. But they cover a wide area, making them prone to conflicts with other pa

Re: [PATCH v3 8/9] um: Fix -Wmissing-prototypes warnings for text_poke*

2024-03-26 Thread Lucas De Marchi
On Wed, Mar 06, 2024 at 06:19:24PM +0800, Tiwei Bie wrote: The prototypes for text_poke* are declared in asm/text-patching.h under arch/x86/include/. It's safe to include this header, as it's UML-aware (by checking CONFIG_UML_X86). but would it work when building on something other than x86? Or

Re: [PATCH v3 0/9] um: Minor fixes and cleanups

2024-03-26 Thread Tiwei Bie
Hi, Gentle ping.. Please take a look at this series if possible. The changes in this series are very straightforward, so it shouldn't require much effort to review. But they cover a wide area, making them prone to conflicts with other patches :/, e.g. https://lore.kernel.org/linux-um/202403260737

[PATCH v4 6/7] kunit: Print last test location on fault

2024-03-26 Thread Mickaël Salaün
This helps identify the location of test faults with opportunistic calls to _KUNIT_SAVE_LOC(). This can be useful while writing tests or debugging them. It is possible to call KUNIT_SUCCESS() to explicit save last location. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: Shuah Khan Review

[PATCH v4 7/7] kunit: Add tests for fault

2024-03-26 Thread Mickaël Salaün
Add a test case to check NULL pointer dereference and make sure it would result as a failed test. The full kunit_fault test suite is marked as skipped when run on UML because it would result to a kernel panic. Tested with: ./tools/testing/kunit/kunit.py run --arch x86_64 kunit_fault ./tools/testi

[PATCH v4 2/7] kunit: Fix kthread reference

2024-03-26 Thread Mickaël Salaün
There is a race condition when a kthread finishes after the deadline and before the call to kthread_stop(), which may lead to use after free. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Fixes: adf505457032 ("kunit: fix UAF when run kfence test case test_gfpzero") Reviewed-by: Davi

[PATCH v4 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

2024-03-26 Thread Mickaël Salaün
Fix KUNIT_SUCCESS() calls to pass a test argument. This is a no-op for now because this macro does nothing, but it will be required for the next commit. Cc: Brendan Higgins Cc: Rae Moar Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Mickaël Salaün Link: https://

[PATCH v4 4/7] kunit: Handle test faults

2024-03-26 Thread Mickaël Salaün
Previously, when a kernel test thread crashed (e.g. NULL pointer dereference, general protection fault), the KUnit test hanged for 30 seconds and exited with a timeout error. Fix this issue by waiting on task_struct->vfork_done instead of the custom kunit_try_catch.try_completion, and track the ex

[PATCH v4 1/7] kunit: Handle thread creation error

2024-03-26 Thread Mickaël Salaün
Previously, if a thread creation failed (e.g. -ENOMEM), the function was called (kunit_catch_run_case or kunit_catch_run_case_cleanup) without marking the test as failed. Instead, fill try_result with the error code returned by kthread_run(), which will mark the test as failed and print "internal

[PATCH v4 3/7] kunit: Fix timeout message

2024-03-26 Thread Mickaël Salaün
The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Rae Moar Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20240326095118.126696-4-...@digikod.net --

[PATCH v4 0/7] Handle faults in KUnit tests

2024-03-26 Thread Mickaël Salaün
Hi, This patch series teaches KUnit to handle kthread faults as errors, and it brings a few related fixes and improvements. Shuah, everything should be OK now, could you please merge this series? All these tests pass (on top of v6.8): ./tools/testing/kunit/kunit.py run --alltests ./tools/testing

Re: [PATCH v3 4/7] kunit: Handle test faults

2024-03-26 Thread Mickaël Salaün
On Sat, Mar 23, 2024 at 03:37:21PM +0800, David Gow wrote: > On Tue, 19 Mar 2024 at 18:49, Mickaël Salaün wrote: > > > > Previously, when a kernel test thread crashed (e.g. NULL pointer > > dereference, general protection fault), the KUnit test hanged for 30 > > seconds and exited with a timeout e

Re: [PATCH vhost v5 2/6] virtio: remove support for names array entries being null.

2024-03-26 Thread Xuan Zhuo
On Tue, 26 Mar 2024 12:28:34 +0800, Jason Wang wrote: > On Mon, Mar 25, 2024 at 5:04 PM Xuan Zhuo wrote: > > > > commit 6457f126c888 ("virtio: support reserved vqs") introduced this > > support. Multiqueue virtio-net use 2N as ctrl vq finally, so the logic > > doesn't apply. And not one uses this

[PATCH 1/1] arch/um: fix forward declaration for vmalloc

2024-03-26 Thread Suren Baghdasaryan
Patch [1] replaced vmalloc() function with a new definition but it did not adjust the forward declaration used in UML architecture. Change it to act as before. Note that this prevents the vmalloc() allocations in __wrap_malloc() from being accounted. If accounting here is critical, we will have to

Re: [PATCH vhost v5 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-26 Thread Xuan Zhuo
On Mon, 25 Mar 2024 10:12:51 +0100, David Hildenbrand wrote: > On 25.03.24 10:04, Xuan Zhuo wrote: > > Currently, the init_vqs function within the virtio_balloon driver relies > > on the condition that certain names array entries are null in order to > > skip the initialization of some virtual que

Re: [PATCH vhost v5 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-26 Thread Xuan Zhuo
On Tue, 26 Mar 2024 12:14:17 +0800, Jason Wang wrote: > On Mon, Mar 25, 2024 at 5:04 PM Xuan Zhuo wrote: > > > > Currently, the init_vqs function within the virtio_balloon driver relies > > on the condition that certain names array entries are null in order to > > skip the initialization of some