Commit 8439381
committed
x86/mtrr: Prevent CPU hotplug lock recursion
Larry reported a CPU hotplug lock recursion in the MTRR code.
============================================
WARNING: possible recursive locking detected
systemd-udevd/153 is trying to acquire lock:
(cpu_hotplug_lock.rw_sem){.+.+.+}, at: [<c030fc26>] stop_machine+0x16/0x30
but task is already holding lock:
(cpu_hotplug_lock.rw_sem){.+.+.+}, at: [<c0234353>] mtrr_add_page+0x83/0x470
....
cpus_read_lock+0x48/0x90
stop_machine+0x16/0x30
mtrr_add_page+0x18b/0x470
mtrr_add+0x3e/0x70
mtrr_add_page() holds the hotplug rwsem already and calls stop_machine()
which acquires it again.
Call stop_machine_cpuslocked() instead.
Reported-and-tested-by: Larry Finger <[email protected]>
Reported-by: Dmitry Vyukov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1708140920250.1865@nanos
Cc: "Paul E. McKenney" <[email protected]>
Cc: Borislav Petkov <[email protected]>1 parent b45e4c4 commit 8439381
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
370 | 382 | | |
371 | 383 | | |
372 | 384 | | |
373 | | - | |
| 385 | + | |
374 | 386 | | |
375 | 387 | | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
379 | 391 | | |
380 | 392 | | |
381 | | - | |
| 393 | + | |
382 | 394 | | |
383 | 395 | | |
384 | 396 | | |
| |||
506 | 518 | | |
507 | 519 | | |
508 | 520 | | |
509 | | - | |
| 521 | + | |
510 | 522 | | |
511 | 523 | | |
512 | 524 | | |
| |||
0 commit comments