On 4/8/24 8:51 PM, Geliang Tang wrote:
+static void *send_recv_server(void *arg)
+{
+ struct send_recv_arg *a = (struct send_recv_arg *)arg;
+ ssize_t nr_sent = 0, bytes = 0;
+ char batch[1500];
+ int err = 0, fd;
+
+ fd = accept(a->fd, NULL, NULL);
+ while
On Mon, 2024-04-08 at 17:43 -0700, Dongli Zhang wrote:
> Hi Jack,
>
> On 4/8/24 15:07, Jack Allister wrote:
> > This test proves that there is an inherent KVM/PV clock drift away from the
> > guest TSC when KVM decides to update the PV time information structure due
> > to a
Hi Martin,
On Mon, 2024-04-08 at 11:45 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> This patch extracts the code to send and receive data into a new
> helper named send_recv_data() in network_helpers.c and export it
> in network_helpers.h.
>
> This helper will be used for MPTCP BPF
On Mon, Apr 8, 2024 at 1:09 AM Benjamin Tissoires wrote:
>
> New version of the sleepable bpf_timer code.
>
> I'm posting this as this is the result of the previous review, so we can
> have a baseline to compare to.
>
> The plan is now to introduce a new user API struct bpf_wq, as the timer
> API
net/lib/py/nsim.py already contains the most useful parts
of the netdevsim wrapper classes. Reuse them.
Signed-off-by: Jakub Kicinski
---
tools/testing/selftests/net/bpf_offload.py | 120 +
tools/testing/selftests/net/lib/py/nsim.py | 9 +-
2 files changed, 35
Non-ancient ip (iproute2-5.15.0, libbpf 0.7.0) refuses to load
the sample with maps because we don't generate BTF:
libbpf: BTF is required, but is missing or corrupted.
ERROR: opening BPF object file failed
Enable BTF by adding -g to clang flags. With that done
neither of the programs
We're building more python tests on the netdev side, and some
of the classes from the venerable BPF offload tests can be reused.
Signed-off-by: Jakub Kicinski
---
tools/testing/selftests/bpf/Makefile | 1 -
tools/testing/selftests/net/Makefile | 8
Maps are removed asynchronously. Either there's a bigger delay
now or the test has always been flaky. Retry waiting in the loop.
Signed-off-by: Jakub Kicinski
---
tools/testing/selftests/net/bpf_offload.py | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
On Mon, Apr 8, 2024 at 4:01 PM Eduard Zingerman wrote:
>
> > +SEC("tc")
> > +/* check that calling bpf_timer_start() with a delay on a sleepable
> > + * callback is returning -EINVAL
> > + */
> > +__retval(-22)
> > +long test_call_sleepable_delay(void *ctx)
> > +{
> > + int key = 2;
> > +
The test_offload.py test fits in networking and bpf equally
well. We started adding more Python tests in networking
and some of the code in test_offload.py can be reused,
so move it to networking. Looks like it bit rotted over
time and some fixes are needed.
Admittedly more code could be
On Mon, Apr 8, 2024 at 1:10 AM Benjamin Tissoires wrote:
>
> cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h
>
> Signed-off-by: Benjamin Tissoires
>
> ---
>
> updated in v6
>
> no changes in v5
>
> new in v4
> ---
> tools/include/uapi/linux/bpf.h | 20 +---
> 1 file
On Mon, Apr 8, 2024 at 3:36 PM Eduard Zingerman wrote:
>
> On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
> > Now that we have bpf_timer_set_sleepable_cb() available and working, we
> > can tag the attached callback as sleepable, and let the verifier check
> > in the correct context
Add the invalid filter test which sets the filter beyond the event
space and sets the invalid action to double check if the
KVM_ARM_VCPU_PMU_V3_FILTER will return the expected error.
Reviewed-by: Eric Auger
Signed-off-by: Shaoqin Huang
---
.../kvm/aarch64/pmu_event_filter_test.c | 38
Introduce pmu_event_filter_test for arm64 platforms. The test configures
PMUv3 for a vCPU, and sets different pmu event filters for the vCPU, and
check if the guest can see those events which user allow and can't use
those events which use deny.
This test refactor the create_vpmu_vm() and make it
Create a vcpu with vpmu would be a common requirement for the vpmu test,
so add the helper function for the vpmu vcpu creation. And use those
helper function in the vpmu_counter_access.c test.
Use this chance to delete the meaningless ASSERT about the pmuver,
because KVM does not advertise an
The test is inspired by the pmu_event_filter_test which implemented by x86. On
the arm64 platform, there is the same ability to set the pmu_event_filter
through the KVM_ARM_VCPU_PMU_V3_FILTER attribute. So add the test for arm64.
The series first create the helper function which can be used
for
On Mon, Apr 8, 2024 at 10:20 AM Benjamin Tissoires
wrote:
>
> On Mon, Apr 8, 2024 at 7:08 PM Eduard Zingerman wrote:
> >
> > On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
> >
> > [...]
> >
> > > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> > > index
On Thu, Apr 4, 2024 at 1:47 PM Björn Töpel wrote:
>
> Charlie Jenkins writes:
>
> > Add two tests to check vector save/restore when a signal is received
> > during a vector routine. One test ensures that a value is not clobbered
> > during signal handling. The other verifies that vector
On Fri, 15 Mar 2024 10:35:07 -0400, Maxim Levitsky wrote:
> max_guest_memory_test uses ucalls to sync with the host, but
> it also resets the guest RIP back to its initial value in between
> tests stages.
>
> This makes the guest never reach the code which frees the ucall struct
> and since a
Hi Jack,
On 4/8/24 15:07, Jack Allister wrote:
> This test proves that there is an inherent KVM/PV clock drift away from the
> guest TSC when KVM decides to update the PV time information structure due
> to a KVM_REQ_MASTERCLOCK_UPDATE. This drift is exascerbated when a guest is
Typo:
On 4/5/24 05:50, Andrew Jones wrote:
On Wed, Apr 03, 2024 at 01:04:49AM -0700, Atish Patra wrote:
...
+static void test_pmu_basic_sanity(void)
+{
+ long out_val = 0;
+ bool probe;
+ struct sbiret ret;
+ int num_counters = 0, i;
+ union sbi_pmu_ctr_info ctrinfo;
+
+
On 4/5/24 04:23, Andrew Jones wrote:
On Wed, Apr 03, 2024 at 01:04:41AM -0700, Atish Patra wrote:
PMU Snapshot function allows to minimize the number of traps when the
guest access configures/access the hpmcounters. If the snapshot feature
is enabled, the hypervisor updates the shared memory
On 4/4/24 05:01, Andrew Jones wrote:
On Wed, Apr 03, 2024 at 01:04:35AM -0700, Atish Patra wrote:
...
+static int pmu_sbi_snapshot_disable(void)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_SNAPSHOT_SET_SHMEM, -1,
+ -1, 0, 0, 0, 0);
On 4/4/24 04:08, Andrew Jones wrote:
On Wed, Apr 03, 2024 at 01:04:33AM -0700, Atish Patra wrote:
It is a good practice to use BIT() instead of (1UL << x).
(1UL << x) isn't generally a problem. The problem is with (1 << x).
Yes. That's why, the commit message said it's good to have :)
I
On 4/8/24 08:04, Muhammad Usama Anjum wrote:
On 4/8/24 5:01 PM, Michal Koutný wrote:
On Mon, Apr 08, 2024 at 04:53:11PM +0500, Muhammad Usama Anjum
wrote:
ksft_test_result_report(tests[i].fn(root), tests[i].name)
$ git grep ksft_test_result_report v6.9-rc3 --
(empty result)
I can't find
On 4/4/24 04:02, Andrew Jones wrote:
On Wed, Apr 03, 2024 at 01:04:32AM -0700, Atish Patra wrote:
SBI v2.0 introduced a explicit function to read the upper 32 bits
for any firmware counter width that is longer than 32bits.
This is only applicable for RV32 where firmware counter can be
64 bit.
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau :
On Sat, 6 Apr 2024 22:46:13 +0800 you wrote:
> From: Jason Xing
>
> The output goes like this if I make samples/bpf:
> ...warning: no previous prototype for ‘get_cgroup_id_from_path’...
>
> Make this function
On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
> bpf_experimental.h and ../bpf_testmod/bpf_testmod_kfunc.h are both
> including vmlinux.h, which is not compatible with including time.h
> or bpf_tcp_helpers.h.
>
> So keep sleepable tests in a separate bpf source file.
>
> The first
On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
> Now that we have bpf_timer_set_sleepable_cb() available and working, we
> can tag the attached callback as sleepable, and let the verifier check
> in the correct context the calls and kfuncs.
>
> Signed-off-by: Benjamin Tissoires
>
On Mon, Apr 08 2024 at 20:49, Oleg Nesterov wrote:
> To me this test should simply do
>
> ksft_test_result(!ctd_failed, "check signal distribution\n");
> return 0;
Right.
> but I am not familiar with tools/testing/selftests/ and I am not sure
> I understand the last email from
This test proves that there is an inherent KVM/PV clock drift away from the
guest TSC when KVM decides to update the PV time information structure due
to a KVM_REQ_MASTERCLOCK_UPDATE. This drift is exascerbated when a guest is
using TSC scaling and running at a different frequency to the host TSC
On Mon, 2024-04-08 at 10:09 +0200, bent...@kernel.org wrote:
> From: Kumar Kartikeya Dwivedi
>
> Introduce support for KF_ARG_PTR_TO_TIMER. The kfuncs will use bpf_timer
> as argument and that will be recognized as timer argument by verifier.
> bpf_timer_kern casting can happen inside kfunc, but
On Mon, 2024-04-08 at 19:20 +0200, Benjamin Tissoires wrote:
[...]
> That was my initial assumption too, but Alexei told me it was fine.
> And I think he is correct because kfree_rcu doesn't need the rcu_head
> to be initialized.
>
> So in the end, we initialize the memory as a work_struct, and
On 04/08, Oleg Nesterov wrote:
>
> On 04/08, Dmitry Vyukov wrote:
> >
> > >
> > > if (ctd_failed)
> > > ksft_test_result_skip("No signal distribution. Assuming
> > > old kernel\n");
> >
> > Shouldn't the test fail here? The goal of a test is to fail when
> > things don't
Hello,
On Fri, Apr 05, 2024 at 07:05:41PM +0200, Michal Koutný wrote:
> Currently, when pids.max limit is breached in the hierarchy, the event
> is counted and reported in the cgroup where the forking task resides.
>
> This decouples the limit and the notification caused by the limit making
> it
On Thu, Apr 04, 2024 at 09:47:47AM -0400, Waiman Long wrote:
> v2:
> - Found that rebuild_sched_domains() has external callers, revert its
> change and introduce rebuild_sched_domains_cpuslocked() instead.
>
> As discussed in the LKML thread [1], the asynchronous nature of cpuset
> hotplug
On Mon, Apr 8, 2024 at 7:08 PM Eduard Zingerman wrote:
>
> On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
>
> [...]
>
> > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> > index 9234174ccb21..fd05d4358b31 100644
> > --- a/kernel/bpf/helpers.c
> > +++
On Mon, Apr 8, 2024 at 4:31 PM Eduard Zingerman wrote:
>
> On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
> [...]
>
> > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> > index fd05d4358b31..d6528359b3f4 100644
> > --- a/kernel/bpf/helpers.c
> > +++ b/kernel/bpf/helpers.c
On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
[...]
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 9234174ccb21..fd05d4358b31 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -1096,12 +1096,19 @@ const struct bpf_func_proto
write_bm_pid_to_resctrl() uses resctrl_val to check test name which is
not a good interface generic resctrl FS functions should provide.
Only MBM and CMT tests define mongrp so the test name check in
write_bm_pid_to_resctrl() can be changed to depend simply on mongrp
being non-NULL.
With last
Nothing during MBA test uses mongrp even if it has been defined ever
since the introduction of the MBA test in the commit 01fee6b4d1f9
("selftests/resctrl: Add MBA test").
Remove the mongrp from MBA test.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/mba_test.c | 1 -
1 file
The struct resctrl_val_param has control and monitor groups as char
arrays but they are not supposed to be mutated within resctrl_val().
Convert the ctrlgrp and mongrp char array within resctrl_val_param to
plain const char pointers and adjust the strlen() based checks to
check NULL instead.
Control group, monitor group and resctrl_val are not mutated and
should not be mutated within resctrlfs.c functions.
Mark this by using const char * for the arguments.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/resctrl.h | 7 ---
bw_report is only needed for selecting the correct value from the
values IMC measured. It is a member in the resctrl_val_param struct and
is always set to "reads". The value is then checked in resctrl_val()
using validate_bw_report_request() that besides validating the input,
assumes it can mutate
The struct resctrl_val_param is there to customize behavior inside
resctrl_val() which is currently not used to full extent and there are
number of strcmp()s for test name in resctrl_val done by resctrl_val().
Create ->init() hook into the struct resctrl_val_param to cleanly
do per test
On Wed, Apr 03, 2024 at 06:34:12PM -0700, Jakub Kicinski wrote:
> On Wed, 3 Apr 2024 06:19:27 -0700 Guenter Roeck wrote:
> > dev_addr_lists_test generates lock warning noise at the end of tests
> > if lock debugging is enabled. There are two sets of warnings.
> >
> > WARNING: CPU: 0 PID: 689 at
The measurement done in resctrl_val() varies depending on test type.
The decision for how to measure is decided based on the string compare
to test name which is quite inflexible.
Add ->measure() callback into the struct resctrl_val_param to allow
each test to provide necessary code as a function
'bm_pid' and 'ppid' are global variables. As they are used by different
processes and in signal handler, they cannot be entirely converted into
local variables.
The scope of those variables can still be reduced into resctrl_val.c
only. As PARENT_EXIT() macro is using 'ppid', make it a function in
A few functions receive PIDs through int arguments. PIDs variables
should be of type pid_t, not int.
Convert pid arguments from int to pid_t.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/cache.c | 6 +++---
tools/testing/selftests/resctrl/resctrl.h | 4 ++--
initialize_mem_bw_resctrl() and set_mbm_path() contain complicated set
of conditions, each yielding different file to be opened to measure
memory bandwidth through resctrl FS. In practice, only two of them are
used. For MBA test, ctrlgrp is always provided, and for MBM test both
ctrlgrp and mongrp
measure_val() is awfully generic name so rename it to measure_mem_bw()
to describe better what it does and document the function parameters.
Signed-off-by: Ilpo Järvinen
---
tools/testing/selftests/resctrl/resctrl_val.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff
Both initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl() that
are called from resctrl_val() need to determine domain ID to construct
resctrl fs related paths. Both functions do it by taking CPU ID which
neither needs for any other purpose than determining the domain ID.
Consolidate
Resctrl selftests refer to "bandwidth" currently in two other forms in
the code ("B/W" and "band width").
Use "bandwidth" consistently everywhere. While at it, fix also one
"over flow" -> "overflow" on a line that is touched by the change.
Suggested-by: Reinette Chatre
Signed-off-by: Ilpo
If perf_open_imc_mem_bw() fails to open for a perf fd after the first
one, the already opened fds remain open and error is directly returned.
Close the fds inside perf_open_imc_mem_bw() if an error occurs.
Fixes: 7f4d257e3a2a ("selftests/resctrl: Add callback to start a benchmark")
For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs
the measurement over a duration of sleep(1) call. The memory bandwidth
numbers from IMC are derived over this duration. The resctrl FS derived
memory bandwidth, however, is calculated inside measure_vals() and only
takes delta
get_mem_bw_imc() handles fds in a for loop but close() is based on two
fixed indexes READ and WRITE.
Open code all for loops to READ+WRITE entries for clarity.
Suggested-by: Reinette Chatre
Signed-off-by: Ilpo Järvinen
---
v3:
- Rework entirely, use open coding instead of for loops for
Hi all,
This series does a number of cleanups into resctrl_val() and
generalizes it by removing test name specific handling from the
function.
One of the changes improves MBA/MBM measurement by narrowing down the
period the resctrl FS derived memory bandwidth numbers are measured
over. My feel
On Tue, Apr 02, 2024 at 05:20:51PM -0700, Mina Almasry wrote:
> +static char *server_ip = "192.168.1.4";
> +static char *client_ip = "192.168.1.2";
> +static char *port = "5201";
> +static size_t do_validation;
> +static int start_queue = 8;
> +static int num_queues = 8;
> +static char *ifname =
On Mon, Apr 01, 2024 at 12:22:24PM -0700, Mina Almasry wrote:
> On Thu, Mar 28, 2024 at 12:31 AM Christoph Hellwig wrote:
> >
> > On Tue, Mar 26, 2024 at 01:19:20PM -0700, Mina Almasry wrote:
> > >
> > > Are you envisioning that dmabuf support would be added to the block
> > > layer
> >
> > Yes.
On 4/6/24 7:46 AM, Jason Xing wrote:
From: Jason Xing
The output goes like this if I make samples/bpf:
...warning: no previous prototype for ‘get_cgroup_id_from_path’...
The CI does not build samples/bpf...
Make this function static could solve the warning problem since
no one outside
On 04/04/24 09:47, Waiman Long wrote:
> Since commit 3a5a6d0c2b03("cpuset: don't nest cgroup_mutex inside
> get_online_cpus()"), cpuset hotplug was done asynchronously via a work
> function. This is to avoid recursive locking of cgroup_mutex.
>
> Since then, the cgroup locking scheme has changed
On Mon, 2024-04-08 at 10:09 +0200, Benjamin Tissoires wrote:
[...]
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index fd05d4358b31..d6528359b3f4 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
[...]
> @@ -2726,6 +2764,7 @@ BTF_ID_FLAGS(func, bpf_dynptr_is_null)
On Mon, Apr 08, 2024 at 01:19:39PM +0200, Clément Léger wrote:
>
>
> On 08/04/2024 13:03, Andrew Jones wrote:
> > On Mon, Apr 08, 2024 at 10:01:12AM +0200, Clément Léger wrote:
> >>
> >>
> >> On 05/04/2024 19:33, Deepak Gupta wrote:
> >>> On Fri, Apr 5, 2024 at 8:26 AM Andrew Jones
> >>>
On Sun, Apr 07, 2024 at 02:15:15AM +0500, Muhammad Usama Anjum wrote:
> On 4/5/24 1:44 PM, Dev Jain wrote:
> > @@ -0,0 +1,31 @@
> > +KSelfTest ARM
> > +===
> > +
> > +- This is a series of compatibility tests, wherein the source files are
> > + built statically into a 32 bit ELF;
On Sun, Apr 07, 2024 at 02:28:06AM +0500, Muhammad Usama Anjum wrote:
> On 4/5/24 1:44 PM, Dev Jain wrote:
> > + ksft_print_msg("%s :: %s\n", current->name, current->descr);
> > + if (test_setup(current) && test_init(current)) {
> > + test_run(current);
> > +
On 4/8/24 5:01 PM, Michal Koutný wrote:
> On Mon, Apr 08, 2024 at 04:53:11PM +0500, Muhammad Usama Anjum
> wrote:
>> ksft_test_result_report(tests[i].fn(root), tests[i].name)
>
> $ git grep ksft_test_result_report v6.9-rc3 --
> (empty result)
>
> I can't find that helper. Is that in some
On Mon, Apr 08, 2024 at 04:53:11PM +0500, Muhammad Usama Anjum
wrote:
> ksft_test_result_report(tests[i].fn(root), tests[i].name)
$ git grep ksft_test_result_report v6.9-rc3 --
(empty result)
I can't find that helper. Is that in some devel repositories?
Michal
signature.asc
Description:
On 4/8/24 4:29 PM, Michal Koutný wrote:
> On Sun, Apr 07, 2024 at 02:37:44AM +0500, Muhammad Usama Anjum
> wrote:
>> The
>> ksft_print_header();
>> ksft_set_plan(total_number_of_tests);
>> are missing. Please use all of the ksft APIs to make the test TAP compliant.
>
> Will do.
>
>>>
On Sun, Apr 07, 2024 at 02:37:44AM +0500, Muhammad Usama Anjum
wrote:
> The
> ksft_print_header();
> ksft_set_plan(total_number_of_tests);
> are missing. Please use all of the ksft APIs to make the test TAP compliant.
Will do.
> > + for (i = 0; i < ARRAY_SIZE(tests); i++) {
> > +
On 08/04/2024 13:03, Andrew Jones wrote:
> On Mon, Apr 08, 2024 at 10:01:12AM +0200, Clément Léger wrote:
>>
>>
>> On 05/04/2024 19:33, Deepak Gupta wrote:
>>> On Fri, Apr 5, 2024 at 8:26 AM Andrew Jones wrote:
On Thu, Apr 04, 2024 at 12:32:46PM +0200, Clément Léger wrote:
> The
On Thu, Apr 04, 2024 at 12:32:46PM +0200, Clément Léger wrote:
> The Zimop ISA extension was ratified recently. This series adds support
> for parsing it from riscv,isa, hwprobe export and kvm support for
> Guest/VM.
>
> Clément Léger (5):
> dt-bindings: riscv: add Zimop ISA extension
On Mon, Apr 08, 2024 at 10:01:12AM +0200, Clément Léger wrote:
>
>
> On 05/04/2024 19:33, Deepak Gupta wrote:
> > On Fri, Apr 5, 2024 at 8:26 AM Andrew Jones wrote:
> >>
> >> On Thu, Apr 04, 2024 at 12:32:46PM +0200, Clément Léger wrote:
> >>> The Zimop ISA extension was ratified recently. This
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller :
On Fri, 05 Apr 2024 12:52:04 +0200 you wrote:
> Here are some patches from Geliang, doing different cleanups, and
> supporting 'ip mptcp' in more MPTCP selftests.
>
> Patch 1 checks that TC is available in
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller :
On Thu, 4 Apr 2024 19:45:21 -0700 you wrote:
> Currently the options for writing networking tests are C, bash or
> some mix of the two. YAML/Netlink gives us the ability to easily
> interface with Netlink in
On 04/08, Dmitry Vyukov wrote:
>
> >
> > if (ctd_failed)
> > ksft_test_result_skip("No signal distribution. Assuming old
> > kernel\n");
>
> Shouldn't the test fail here? The goal of a test is to fail when
> things don't work.
I've copied this from the previous patch from
On Mon, Apr 08 2024 at 10:30, Dmitry Vyukov wrote:
> On Sat, 6 Apr 2024 at 17:12, Oleg Nesterov wrote:
>> if (ctd_failed)
>> ksft_test_result_skip("No signal distribution. Assuming old
>> kernel\n");
>
> Shouldn't the test fail here? The goal of a test is to fail when
>
On Sat, 6 Apr 2024 at 17:12, Oleg Nesterov wrote:
>
> Dmitry, Thomas,
>
> To simplify the review I've attached the code with this patch applied below.
>
> Yes, this changes the "semantics" of check_timer_distribution(), perhaps it
> should be renamed.
>
> But I do not see a better approach, and
bpf_experimental.h and ../bpf_testmod/bpf_testmod_kfunc.h are both
including vmlinux.h, which is not compatible with including time.h
or bpf_tcp_helpers.h.
So keep sleepable tests in a separate bpf source file.
The first correct test is run twice for convenience:
- first through RUN_TESTS
- then
cp include/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h
Signed-off-by: Benjamin Tissoires
---
updated in v6
no changes in v5
new in v4
---
tools/include/uapi/linux/bpf.h | 20 +---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git
Now that we have bpf_timer_set_sleepable_cb() available and working, we
can tag the attached callback as sleepable, and let the verifier check
in the correct context the calls and kfuncs.
Signed-off-by: Benjamin Tissoires
---
no changes in v6
no changes in v5
changes in v4:
- use a function
In this patch, bpf_timer_set_sleepable_cb() is functionally equivalent
to bpf_timer_set_callback(), to the exception that it enforces
the timer to be started with BPF_F_TIMER_SLEEPABLE.
But given that bpf_timer_set_callback() is a helper when
bpf_timer_set_sleepable_cb() is a kfunc, we need to
From: Kumar Kartikeya Dwivedi
Introduce support for KF_ARG_PTR_TO_TIMER. The kfuncs will use bpf_timer
as argument and that will be recognized as timer argument by verifier.
bpf_timer_kern casting can happen inside kfunc, but using bpf_timer in
argument makes life easier for users who work with
They are implemented as a workqueue, which means that there are no
guarantees of timing nor ordering.
Signed-off-by: Benjamin Tissoires
---
changes in v6:
- dropped extra spinlock
- implement cancel_and_free of a sleepable timer through
a dedicated workqueue
no changes in v5
changes in v4:
New version of the sleepable bpf_timer code.
I'm posting this as this is the result of the previous review, so we can
have a baseline to compare to.
The plan is now to introduce a new user API struct bpf_wq, as the timer
API working on softIRQ seems to be quite far away from a wq.
For
On 05/04/2024 19:33, Deepak Gupta wrote:
> On Fri, Apr 5, 2024 at 8:26 AM Andrew Jones wrote:
>>
>> On Thu, Apr 04, 2024 at 12:32:46PM +0200, Clément Léger wrote:
>>> The Zimop ISA extension was ratified recently. This series adds support
>>> for parsing it from riscv,isa, hwprobe export and
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
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
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
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:
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/20240408074625.65017-4-...@digikod.net
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
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
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:
93 matches
Mail list logo