fix(driver): avoid kmod crash when a CPU gets enabled at runtime#2252
fix(driver): avoid kmod crash when a CPU gets enabled at runtime#2252
Conversation
| ASSERT(ring); | ||
|
|
||
| ring_info = ring->info; | ||
| if(!ring_info) { |
There was a problem hiding this comment.
We won't send any event on the newly enabled CPU; ring_info will be NULL and we would panic.
| 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.
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 testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks 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 <nierro92@gmail.com> Co-authored-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
fb31889 to
f121b29
Compare
|
/milestone next-driver |
|
/unhold |
|
[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 DetailsNeeds 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?: