mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
With support of private stack, relevant tests must pass on powerpc64. #./test_progs -t struct_ops_private_stack #434/1 struct_ops_private_stack/private_stack:OK #434/2 struct_ops_private_stack/private_stack_fail:OK #434/3 struct_ops_private_stack/private_stack_recur:OK #434 struct_ops_private_stack:OK Summary: 1/3 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Abhishek Dubey <adubey@linux.ibm.com> Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260401103215.104438-2-adubey@linux.ibm.com
57 lines
893 B
C
57 lines
893 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <vmlinux.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_tracing.h>
|
|
#include "../test_kmods/bpf_testmod.h"
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
void bpf_testmod_ops3_call_test_2(void) __ksym;
|
|
|
|
int val_i, val_j;
|
|
|
|
__noinline static int subprog2(int *a, int *b)
|
|
{
|
|
return val_i + a[10] + b[20];
|
|
}
|
|
|
|
__noinline static int subprog1(int *a)
|
|
{
|
|
/* stack size 200 bytes */
|
|
int b[50] = {};
|
|
|
|
b[20] = 2;
|
|
return subprog2(a, b);
|
|
}
|
|
|
|
|
|
SEC("struct_ops")
|
|
int BPF_PROG(test_1)
|
|
{
|
|
/* stack size 400 bytes */
|
|
int a[100] = {};
|
|
|
|
a[10] = 1;
|
|
val_i = subprog1(a);
|
|
bpf_testmod_ops3_call_test_2();
|
|
return 0;
|
|
}
|
|
|
|
SEC("struct_ops")
|
|
int BPF_PROG(test_2)
|
|
{
|
|
/* stack size 200 bytes */
|
|
int a[50] = {};
|
|
|
|
a[10] = 3;
|
|
val_j = subprog1(a);
|
|
return 0;
|
|
}
|
|
|
|
SEC(".struct_ops")
|
|
struct bpf_testmod_ops3 testmod_1 = {
|
|
.test_1 = (void *)test_1,
|
|
.test_2 = (void *)test_2,
|
|
};
|