-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(driver): avoid kmod crash when a CPU gets enabled at runtime #2252
base: master
Are you sure you want to change the base?
Conversation
@@ -1820,6 +1812,10 @@ static int record_event_consumer(struct ppm_consumer_t *consumer, | |||
ASSERT(ring); | |||
|
|||
ring_info = ring->info; | |||
if(!ring_info) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't send any event on the newly enabled CPU; ring_info will be NULL and we would panic.
driver/main.c
Outdated
struct hotplug_st st; | ||
st.sd_action = 1; | ||
st.cpu = cpu; | ||
return smp_call_on_cpu(0, do_cpu_callback, &st, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the do_cpu_callback
on the CPU 0 to make sure that we are able to send the PPME_CPU_HOTPLUG_E
event to userspace.
This is what we do in the bpf probes, since we are guaranteed that CPU 0 is always present.
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
Need to make newly introduced tests a little bit less flaky. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2252 +/- ##
=======================================
Coverage 75.16% 75.16%
=======================================
Files 278 278
Lines 34478 34478
Branches 5922 5922
=======================================
+ Hits 25916 25917 +1
+ Misses 8562 8561 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b9fdc85
to
8aa9e04
Compare
X64 kernel testing matrix
ARM64 kernel testing matrix
|
b5a9c14
to
8d73821
Compare
8d73821
to
a0e8b4b
Compare
e3c963a
to
95cc9b7
Compare
e5765a8
to
60cacc4
Compare
Please double check driver/SCHEMA_VERSION file. See versioning. /hold |
… is hotplugged. Signed-off-by: Federico Di Pierro <[email protected]> Co-authored-by: Andrea Terzolo <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
fb31889
to
f121b29
Compare
/milestone next-driver |
/unhold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area driver-kmod
/area tests
Does this PR require a change in the driver versions?
What this PR does / why we need it:
I also added tests for hotplug in the libscap_test suite.
Which issue(s) this PR fixes:
Fixes #2251
Special notes for your reviewer:
Does this PR introduce a user-facing change?: