[PATCH bpf-next v2] bpf: handle MADV_PAGEOUT error in uprobe_multi.c

2024-10-20 Thread Jason Xing
From: Jason Xing When I compiled the tools/testing/selftests/bpf, the following error pops out: uprobe_multi.c: In function ‘trigger_uprobe’: uprobe_multi.c:109:26: error: ‘MADV_PAGEOUT’ undeclared (first use in this function); did you mean ‘MADV_RANDOM’? madvise(addr, page_sz, MADV_PAGEOUT);

[PATCH v1 0/4] KVM selftests enhancements

2024-10-20 Thread Manali Shukla
This series was prompted by feedback given in [1]. Patch 1 : Adds safe_hlt() and cli() helpers. Patch 2, 3: Adds an interface to read vcpu stat in selftest. Adds a macro to generate compiler error to detect typos at compile time while parsing vcpu and vm stats. Patch 4

[PATCH v1 1/4] KVM: selftests: Add safe_halt() and cli() helpers to common code

2024-10-20 Thread Manali Shukla
Add safe_halt() and cli() helpers to processor.h to make them broadly available in KVM selftests. Suggested-by: Sean Christopherson Signed-off-by: Manali Shukla --- .../selftests/kvm/include/x86_64/processor.h| 17 + 1 file changed, 17 insertions(+) diff --git a/tools/testi

[PATCH v1 4/4] KVM: selftests: Replace previously used vm_get_stat() to macro

2024-10-20 Thread Manali Shukla
Previous patch converts vm_get_stat() to macro and adds a concatenation trickery to generate compilation error if the stat doesn't exist. Improve nx_huge_pages_test.c and dirty_log_page_splitting_test.c based on the macro. Compile tested both the selftests. Signed-off-by: Manali Shukla --- ...

[PATCH v1 3/4] KVM: selftests: convert vm_get_stat to macro

2024-10-20 Thread Manali Shukla
Convert vm_get_stat() to macro to detect typos at compile time. Add a concatenation trickery to trigger compiler error if vm stat doesn't exist, so that it is not possible to pass a vcpu stat into vm_get_stat(). Suggested-by: Sean Christopherson Signed-off-by: Manali Shukla --- .../testing/sel

[PATCH v1 2/4] KVM: selftests: Add an interface to read the data of named vcpu stat

2024-10-20 Thread Manali Shukla
From: Manali Shukla The interface is used to read the data values of a specified vcpu stat from the currenly available binary stats interface. Add a concatenation trickery to trigger compiler error if the stat doesn't exist, so that it is not possible to pass a per-VM stat into vcpu_get_stat().