diff options
author | Jinrong Liang <[email protected]> | 2023-08-10 17:09:42 +0800 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2023-08-17 13:22:17 -0700 |
commit | de527b1daf69a41a265f48ad7bb9207ca7b7d29b (patch) | |
tree | a1fc015a38b582e271e6bf185ac898251d8b2619 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | c853be2265ccd497ff17b878962a2dbcb4873abf (diff) |
KVM: selftests: Introduce "struct __kvm_pmu_event_filter" to manipulate filter
Add custom "__kvm_pmu_event_filter" structure to improve pmu event
filter settings. Simplifies event filter setup by organizing event
filter parameters in a cleaner, more organized way.
Alternatively, selftests could use a struct overlay ala vcpu_set_msr()
to avoid dynamically allocating the array:
struct {
struct kvm_msrs header;
struct kvm_msr_entry entry;
} buffer = {};
memset(&buffer, 0, sizeof(buffer));
buffer.header.nmsrs = 1;
buffer.entry.index = msr_index;
buffer.entry.data = msr_value;
but the extra layer added by the nested structs is counterproductive
to writing efficient, clean code.
Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Jinrong Liang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[sean: massage changelog to explain alternative]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions